db icon indicating copy to clipboard operation
db copied to clipboard

Bug: Adding a comment on DB column fails when using MySQL with ANSI_QUOTES enabled

Open neumannjan opened this issue 6 years ago • 6 comments

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)

neumannjan avatar Jul 24 '17 15:07 neumannjan

You've pull requested to wrong repository.

samdark avatar Jul 24 '17 19:07 samdark

Indeed, sorry. Fixed above.

neumannjan avatar Jul 24 '17 21:07 neumannjan

@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

rugabarbo avatar Jan 04 '19 14:01 rugabarbo

Agree. Moved.

samdark avatar Jan 04 '19 15:01 samdark

https://github.com/yiisoft/yii2/pull/14531

samdark avatar Jan 04 '19 15:01 samdark

It's fixed in yii2 https://github.com/yiisoft/yii2/pull/18500

darkdef avatar Oct 06 '21 19:10 darkdef

done.

terabytesoftw avatar Mar 30 '23 19:03 terabytesoftw