mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Reverted casting JsonExpression(null) to SQL NULL
This commit is contained in:
@ -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);
|
||||
|
@ -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])],
|
||||
|
Reference in New Issue
Block a user