mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
11f38687f7
commit
a3f25ee5e3
2 changed files with 7 additions and 2 deletions
|
@ -2443,7 +2443,7 @@ class DboSource extends DataSource {
|
|||
break;
|
||||
}
|
||||
$value = "({$value})";
|
||||
} elseif ($null) {
|
||||
} elseif ($null || $value === 'NULL') {
|
||||
switch ($operator) {
|
||||
case '=':
|
||||
$operator = 'IS';
|
||||
|
|
|
@ -2219,10 +2219,15 @@ class MysqlTest extends CakeTestCase {
|
|||
$expected = " WHERE `Book`.`id` = 0";
|
||||
$this->assertEqual($expected, $result);
|
||||
|
||||
$result = $this->Dbo->conditions(array("Book.id" => NULL));
|
||||
$result = $this->Dbo->conditions(array("Book.id" => null));
|
||||
$expected = " WHERE `Book`.`id` IS NULL";
|
||||
$this->assertEqual($expected, $result);
|
||||
|
||||
$conditions = array('MysqlModel.id' => '');
|
||||
$result = $this->Dbo->conditions($conditions, true, true, $this->model);
|
||||
$expected = " WHERE `MysqlModel`.`id` IS NULL";
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
|
||||
$expected = " WHERE `Listing`.`beds` >= 0";
|
||||
$this->assertEqual($expected, $result);
|
||||
|
|
Loading…
Reference in a new issue