Reverted casting JsonExpression(null) to SQL NULL

This commit is contained in:
SilverFire - Dmitry Naumenko
2018-03-10 11:14:08 +02:00
parent 0ca003343b
commit 79583a2c7e
2 changed files with 1 additions and 4 deletions

View File

@ -34,9 +34,6 @@ class JsonExpressionBuilder implements ExpressionBuilderInterface
public function build(ExpressionInterface $expression, array &$params = [])
{
$value = $expression->getValue();
if ($value === null) {
return 'NULL';
}
if ($value instanceof Query) {
list ($sql, $params) = $this->queryBuilder->build($value, $params);

View File

@ -205,7 +205,7 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
],
'null value' => [
['=', 'jsoncol', new JsonExpression(null)],
'[[jsoncol]] = NULL', []
'[[jsoncol]] = CAST(:qp0 AS JSON)', [':qp0' => 'null']
],
'null as array value' => [
['=', 'jsoncol', new JsonExpression([null])],