Fix #17473: Fixed SimpleConditionBuilder::build() when column is not a string

This commit is contained in:
Alexander Kartavenko
2019-08-01 13:20:37 +03:00
committed by Alexander Makarov
parent e615f0f43e
commit 69cf9de56b
3 changed files with 3 additions and 2 deletions

View File

@ -1201,6 +1201,7 @@ abstract class QueryBuilderTest extends DatabaseTestCase
[['>=', 'date', new Expression('DATE_SUB(NOW(), INTERVAL 1 MONTH)')], '[[date]] >= DATE_SUB(NOW(), INTERVAL 1 MONTH)', []],
[['>=', 'date', new Expression('DATE_SUB(NOW(), INTERVAL :month MONTH)', [':month' => 2])], '[[date]] >= DATE_SUB(NOW(), INTERVAL :month MONTH)', [':month' => 2]],
[['=', 'date', (new Query())->select('max(date)')->from('test')->where(['id' => 5])], '[[date]] = (SELECT max(date) FROM [[test]] WHERE [[id]]=:qp0)', [':qp0' => 5]],
[['=', new Expression('date'), '2019-08-01'], 'date = :qp0', [':qp0' => '2019-08-01']], // operand1 is Expression
// hash condition
[['a' => 1, 'b' => 2], '([[a]]=:qp0) AND ([[b]]=:qp1)', [':qp0' => 1, ':qp1' => 2]],