summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-26 09:41:16 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-26 09:41:16 +0100
commit11b498d6e0972d33dd35df9ef5211f3f969829f3 (patch)
tree9cd98fb85c2e6656d43377e9aebf5993f401deb8 /sql/unireg.cc
parent525c3c243580824db18834e676eb0ce31600ff49 (diff)
downloadmariadb-git-11b498d6e0972d33dd35df9ef5211f3f969829f3.tar.gz
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.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc13
1 files changed, 2 insertions, 11 deletions
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<Create_field> 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;