diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index c88d50b28a..221e48aebe 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -130,6 +130,7 @@ Yii Framework 2 Change Log - Bug #14773: Fixed `yii\widgets\ActiveField::$options` does not support 'class' option in array format (klimov-paul) - Bug #14902: Fixed PHP notice in `yii\web\MultipartFormDataParser` (olimsaidov) - Bug #14921: Fixed bug with replacing numeric keys in `yii\helpers\Url::current()` (rob006) +- Bug #15122: Fixed bug with sql error if params has expression in `yii\db\Command::getRawSql()` (hiscaler) - Enh #4479: Implemented REST filters (klimov-paul) - Enh #4495: Added closure support in `yii\i18n\Formatter` (developeruz) - Enh #5786: Allowed to use custom constructors in ActiveRecord-based classes (ElisDN, klimov-paul) diff --git a/framework/db/Command.php b/framework/db/Command.php index 437421812d..5f1b3a3fee 100644 --- a/framework/db/Command.php +++ b/framework/db/Command.php @@ -211,7 +211,7 @@ class Command extends Component $params[$name] = ($value ? 'TRUE' : 'FALSE'); } elseif ($value === null) { $params[$name] = 'NULL'; - } elseif (!is_object($value) && !is_resource($value)) { + } elseif ((!is_object($value) && !is_resource($value)) || $value instanceof Expression) { $params[$name] = $value; } }