Open matXias opened 2 years ago
Problem sitll persists in nette/database 3.2.1
$table->whereOr([
'user_id IS NULL',
'SUM(field1) > SUM(field2)',
]);
generates query:
SELECT * FROM `table` WHERE ((`user_id` IS NULL) OR (SUM(`field1`) > SUM(`field2`)) IS NULL AND FALSE)
Version: 3.1.4
Sending array parameter without keys to
whereOr
function returns imploded query with IS NULL AND FALSEExample:
$table->whereOr(['DATE(...) < DATE(NOW())', 'DATE(...) >= DATE(NOW())])
variable $values is default [] in
whereOr
function and after final imploding send this query to where function like:->where('DATE(...) < DATE(NOW()) OR DATE(...) >= DATE(NOW())', []);
and this is problem, because
where
with second parameter as empty array add IS NULL...DOCUMENTATION:
doc
$table->where('id', []); // id IS NULL AND FALSE
expected behavior is
doc