=== modified file 'sql/sql_priv.h' --- sql/sql_priv.h 2012-06-12 07:29:56 +0000 +++ sql/sql_priv.h 2012-09-12 07:24:00 +0000 @@ -151,6 +151,11 @@ */ #define OPTION_ALLOW_BATCH (ULL(1) << 36) // THD, intern (slave) +/* + Allow ALTER table commands to reset a column's comment when the length > 0 + */ +#define OPTION_ALLOW_RESET_COMMENT (ULL(1) << 37) + /* The rest of the file is included in the server only */ #ifndef MYSQL_CLIENT === modified file 'sql/sql_table.cc' --- sql/sql_table.cc 2012-07-10 14:13:02 +0000 +++ sql/sql_table.cc 2012-09-12 07:24:00 +0000 @@ -5370,6 +5370,12 @@ } if (def) { // Field is changed + if (!(thd->variables.option_bits & OPTION_ALLOW_RESET_COMMENT) && field->comment.length && !def->comment.length) + { + my_error(ER_FPARSER_EOF_IN_COMMENT, MYF(0), def->change); + goto err; + } + def->field=field; if (!def->after) { === modified file 'sql/sys_vars.cc' --- sql/sys_vars.cc 2012-06-12 07:29:56 +0000 +++ sql/sys_vars.cc 2012-09-12 07:24:00 +0000 @@ -2525,6 +2525,12 @@ REVERSE(OPTION_NO_FOREIGN_KEY_CHECKS), DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG); +static Sys_var_bit Sys_not_allow_reset_comment( + "not_allow_reset_comment", "not_allow_reset_comment", + SESSION_VAR(option_bits), NO_CMD_LINE, + REVERSE(OPTION_ALLOW_RESET_COMMENT), + DEFAULT(FALSE), NO_MUTEX_GUARD, IN_BINLOG); + static Sys_var_bit Sys_unique_checks( "unique_checks", "unique_checks", SESSION_VAR(option_bits), NO_CMD_LINE,