Skip to content

Commit f29023c

Browse files
committed
Replace != with IS NOT when comparing to null
1 parent 37b3bdc commit f29023c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Query/Generator/SQL.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ private function generateWhere(Query $query, WhereCondition|WhereGroup $where =
118118
$where = $query->getWhere();
119119
}
120120
if ($where instanceof WhereCondition) {
121-
if ($where->value === null && $where->operator === "=") {
122-
$where->operator = "IS";
121+
if ($where->value === null) {
122+
if ($where->operator === "=") {
123+
$where->operator = "IS";
124+
} elseif ($where->operator === "!=") {
125+
$where->operator = "IS NOT";
126+
}
123127
}
124128

125129
$value = $where->value;

0 commit comments

Comments
 (0)