yii2-debug
yii2-debug copied to clipboard
Quoted DB expression when used in param
This issue has originally been reported by @klevron at https://github.com/yiisoft/yii2/issues/6382. Moved here by @cebe.
Hello
DB Expression is quoted when used in param, e.g.
MyModel::deleteAll("expire < :expire", [':expire' => new Expression('NOW()')]);
This will make the following query :
DELETE FROM `expire` WHERE expire < 'NOW()';
Be careful, debug tool will log the correct one :
DELETE FROM `expire` WHERE expire < NOW();
http://stackoverflow.com/questions/27312579/odd-behavior-of-now-and-db-expression-in-yii2-mysql