Fix #19693: Fix db/Command not caching NULL result with scalar fetchMode

This commit is contained in:
Arkeins
2022-12-04 17:55:12 +01:00
committed by GitHub
parent 173cc5eeb6
commit 948029f583
3 changed files with 7 additions and 2 deletions

View File

@ -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.');
}