letsdrink / ouzo

Ouzo Framework - PHP MVC ORM
https://github.com/letsdrink/ouzo
MIT License
70 stars 8 forks source link

ArrayWhereClause inconsistent behaviour for OR and empty array #257

Open bbankowski opened 7 years ago

bbankowski commented 7 years ago

When empty array is inside All:of then wrong SQL is created, e.g.

WHERE name IN ()
danon commented 3 years ago

This has been actually prevented by 8ae9a4ab0d48e5ab9bbf4167365ea6ff3edb83d4: mareckii 25.11.2016 10:25 fix handling of zero limit, where QueryExecutor::prepare() uses WhereClause.isNeverSatisfied().

danon commented 3 years ago

However, this still produces a malformed SQL: image

Looks like ArrayWhereClause.isNeverSatisfied() needs updating to call children's isNeverSatisfied().