Coder Social home page Coder Social logo

TypeError on manipulating queries about fsql HOT 4 CLOSED

sbuberl avatar sbuberl commented on July 22, 2024
TypeError on manipulating queries

from fsql.

Comments (4)

sbuberl avatar sbuberl commented on July 22, 2024

Hello,

Thanks for the report. What version were you using? Or were you using cloned version of this repo?

Steve

from fsql.

pocketoffice avatar pocketoffice commented on July 22, 2024

hi

yes, i use a cloned version of this repo.
meanwhile i think i've found whats causing the error, at least changing CachedTable.php Line 229 from
$entries = null;
to
$entries = array();
does let me insert without errors.

from fsql.

sbuberl avatar sbuberl commented on July 22, 2024

Good catch. Possibly some legacy code I didn't notice. So $entries was assigned to empty array if table was not empty, but for empty tables, it was using that NULL. I pushed the fix.

Unfortunately my unit tests are only at like 50% code coverage. Mostly CREATE and SELECT tests.
Otherwise, that definitely would been caught by an INSERT test. If I have some free time this weekend, hopefully I can work on some tests.

from fsql.

sbuberl avatar sbuberl commented on July 22, 2024

I apparently had a test for this in CachedTableTest for the class level test. But I was checking whether the returned entries were empty (as in the php function "empty"). So both null and empty arrays were passing the test. I pushed a fix for the test as well so only empty arrays pass.

Hopefully I'll still work on adding new tests this weekend.

from fsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.