From 11b498d6e0972d33dd35df9ef5211f3f969829f3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 26 Mar 2014 09:41:16 +0100 Subject: build_frm_image(): don't try to guess the "real table name" from the field list, it doesn't work if ALTER TABLE has replaced all fields. Instead, pass the correct original table name down from the caller. --- sql/unireg.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'sql/unireg.cc') diff --git a/sql/unireg.cc b/sql/unireg.cc index ad2d711be99..4e4af221ddb 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -173,24 +173,15 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, if (tmp_len < create_info->comment.length) { - char *real_table_name= (char*) table; - List_iterator it(create_fields); - Create_field *field; - while ((field=it++)) - { - if (field->field && field->field->table && - (real_table_name= field->field->table->s->table_name.str)) - break; - } if (thd->is_strict_mode()) { my_error(ER_TOO_LONG_TABLE_COMMENT, MYF(0), - real_table_name, TABLE_COMMENT_MAXLEN); + table, TABLE_COMMENT_MAXLEN); DBUG_RETURN(frm); } char warn_buff[MYSQL_ERRMSG_SIZE]; my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_TABLE_COMMENT), - real_table_name, TABLE_COMMENT_MAXLEN); + table, TABLE_COMMENT_MAXLEN); push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, ER_TOO_LONG_TABLE_COMMENT, warn_buff); create_info->comment.length= tmp_len; -- cgit v1.2.1