Nette\Database NOT IN? with empty array

Notice: This thread is very old.
priman
Member | 7
+
0
-

Hello,

i found possible bug in select. Code for reproduction is:

$empty = array();
$connection->table("foo")->select("*")->where("(id NOT IN ?)",$empty);

Badly generated SQL is: SELECT * FROM foo WHERE ((id NOT IS NULL AND FALSE))

hrach
Member | 1838
+
0
-

@duke: what? I thing your code doesn't solve anything.

@priman: correct solution, but you probably know it and you are just reporting bug.

$connection->table("foo")->select("*")->where("(id NOT ?)", []);
duke
Member | 650
+
0
-

@hrach My bad. I thought @priman's use of brackets was different than Nette\Database requires and didn't notice it was the IN operator that confused it instead…

I am removing my previous comment.