mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Revert "Fixed JsonExpressionBuilder to generate SQL NULL"
This reverts commit cf4bd39fc1927c3cbe85c08c6fc473d60921d96f.
This commit is contained in:
@ -4,7 +4,6 @@ Yii Framework 2 Change Log
|
||||
2.0.14.2 under development
|
||||
------------------------
|
||||
|
||||
- Bug #15863: Fixed `yii\db\pgsql\JsonExpressionBuilder` to generate SQL `NULL` instead of JSON `null` when the `JsonExpression` value is `NULL` (silverfire)
|
||||
- Bug #15783: Regenerate CSRF token only when logging in directly (samdark)
|
||||
- Bug #15801: Fixed `has-error` CSS class assignment in `yii\widgets\ActiveField` when attribute name is prefixed with tabular index (FabrizioCaldarelli)
|
||||
- Bug #15792: Added missing `yii\db\QueryBuilder::conditionClasses` setter (silverfire)
|
||||
|
@ -33,9 +33,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);
|
||||
|
@ -113,7 +113,7 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
|
||||
['=', 'data', new JsonExpression(['user' => ['login' => 'silverfire', 'password' => 'c4ny0ur34d17?'], 'props' => ['mood' => 'good']])],
|
||||
'"data" = :qp0', [':qp0' => '{"user":{"login":"silverfire","password":"c4ny0ur34d17?"},"props":{"mood":"good"}}']
|
||||
],
|
||||
'null value' => [['=', 'jsoncol', new JsonExpression(null)], '"jsoncol" = NULL', []],
|
||||
'null value' => [['=', 'jsoncol', new JsonExpression(null)], '"jsoncol" = :qp0', [':qp0' => 'null']],
|
||||
'null as array value' => [['=', 'jsoncol', new JsonExpression([null])], '"jsoncol" = :qp0', [':qp0' => '[null]']],
|
||||
'null as object value' => [['=', 'jsoncol', new JsonExpression(['nil' => null])], '"jsoncol" = :qp0', [':qp0' => '{"nil":null}']],
|
||||
|
||||
|
Reference in New Issue
Block a user