db
db copied to clipboard
Bug: Adding a comment on DB column fails when using MySQL with ANSI_QUOTES enabled
What steps will reproduce the problem?
Use MySQL database with sql_mode set to ANSI_QUOTES
What is the expected result?
QueryBuilder::addCommentOnColumn
works as expected
What do you get instead?
QueryBuilder::addCommentOnColumn
crashes with a MySQL syntax error, because QueryBuilder::getColumnDefinition
returns null
, because its regular expression pattern suddenly does not work.
I am already preparing a fix (a pull request)
You've pull requested to wrong repository.
Indeed, sorry. Fixed above.
@rob006 @samdark I think that support of ANSI_QUOTES mode is a new feature. This is not a bug. This task should be moved to https://github.com/yiisoft/db – if the team accepts this improvement, it will be implemented in the future.
This feature will require much more tests, because in ANSI_QUOTES mode you cannot use double quotation marks to quote literal strings. See details here: https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_ansi_quotes
Agree. Moved.
https://github.com/yiisoft/yii2/pull/14531
It's fixed in yii2 https://github.com/yiisoft/yii2/pull/18500
done.