We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version: 3.1.4
Sending array parameter without keys to whereOr function returns imploded query with IS NULL AND FALSE
whereOr
Example:
$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...
where
$values = []; ... if (is_int($key)) { // whereOr(['full condition']) $columns[] = $val; ... $columnsString = '(' . implode(') OR (', $columns) . ')'; return $this->where($columnsString, $values);
DOCUMENTATION:
doc $table->where('id', []); // id IS NULL AND FALSE
$table->where('id', []); // id IS NULL AND FALSE
expected behavior is
doc
// WHERE (user_id IS NULL) OR (SUM(`field1`) > SUM(`field2`)) $table->whereOr([ 'user_id IS NULL', 'SUM(field1) > SUM(field2)', ]);
The text was updated successfully, but these errors were encountered:
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)
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: