mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fix #19693: Fix db/Command not caching NULL result with scalar fetchMode
This commit is contained in:
@ -727,6 +727,11 @@ abstract class QueryTest extends DatabaseTestCase
|
||||
$this->assertEquals('user1', $query->noCache()->where(['id' => 1])->scalar($db));
|
||||
$this->assertEquals('user11', $query->cache()->where(['id' => 1])->scalar($db));
|
||||
}, 10);
|
||||
|
||||
$update->bindValues([':id' => 3, ':name' => null])->execute();
|
||||
$this->assertEquals(null, $query->cache()->where(['id' => 3])->scalar($db));
|
||||
$update->bindValues([':id' => 3, ':name' => 'user3'])->execute();
|
||||
$this->assertEquals(null, $query->cache()->where(['id' => 3])->scalar($db), 'Null value should be cached.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user