diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f736de24bed..38b7f0523fa 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -8697,13 +8697,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, } } - if (table->versioned() && !(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING) && - new_create_list.elements == VERSIONING_FIELDS) - { - my_error(ER_VERS_TABLE_MUST_HAVE_COLUMNS, MYF(0), table->s->table_name.str); - goto err; - } - if (!create_info->comment.str) { create_info->comment.str= table->s->comment.str; @@ -9785,11 +9778,13 @@ do_continue:; DBUG_RETURN(true); } - set_table_default_charset(thd, create_info, alter_ctx.db); - - if (create_info->check_period_fields(thd, alter_info) - || create_info->fix_period_fields(thd, alter_info)) + if (create_info->check_fields(thd, alter_info, *table_list) || + create_info->fix_period_fields(thd, alter_info)) + { DBUG_RETURN(true); + } + + set_table_default_charset(thd, create_info, alter_ctx.db); if (!opt_explicit_defaults_for_timestamp) promote_first_timestamp_column(&alter_info->create_list); @@ -10287,7 +10282,7 @@ do_continue:; close_all_tables_for_name(thd, table->s, alter_ctx.is_table_renamed() ? - HA_EXTRA_PREPARE_FOR_RENAME: + HA_EXTRA_PREPARE_FOR_RENAME: HA_EXTRA_NOT_USED, NULL); table_list->table= table= NULL; /* Safety */ @@ -10482,7 +10477,7 @@ bool mysql_trans_prepare_alter_copy_data(THD *thd) /* Turn off recovery logging since rollback of an alter table is to delete the new table so there is no need to log the changes to it. - + This needs to be done before external_lock. */ DBUG_RETURN(ha_enable_transaction(thd, FALSE) != 0); @@ -10640,7 +10635,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, char warn_buff[MYSQL_ERRMSG_SIZE]; bool save_abort_on_warning= thd->abort_on_warning; thd->abort_on_warning= false; - my_snprintf(warn_buff, sizeof(warn_buff), + my_snprintf(warn_buff, sizeof(warn_buff), "ORDER BY ignored as there is a user-defined clustered index" " in the table '%-.192s'", from->s->table_name.str); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, |