mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
more tests, moving code around
This commit is contained in:
@ -8429,9 +8429,25 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
mysql_audit_alter_table(thd, table_list);
|
||||
|
||||
THD_STAGE_INFO(thd, stage_setup);
|
||||
|
||||
handle_if_exists_options(thd, table, alter_info);
|
||||
|
||||
/*
|
||||
Look if we have to do anything at all.
|
||||
ALTER can become NOOP after handling
|
||||
the IF (NOT) EXISTS options.
|
||||
*/
|
||||
if (alter_info->flags == 0)
|
||||
{
|
||||
my_snprintf(alter_ctx.tmp_name, sizeof(alter_ctx.tmp_name),
|
||||
ER(ER_INSERT_INFO), 0L, 0L,
|
||||
thd->get_stmt_da()->current_statement_warn_count());
|
||||
my_ok(thd, 0L, 0L, alter_ctx.tmp_name);
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
if (!(alter_info->flags & ~(Alter_info::ALTER_RENAME |
|
||||
Alter_info::ALTER_KEYS_ONOFF)) &&
|
||||
alter_info->flags != 0 &&
|
||||
alter_info->requested_algorithm !=
|
||||
Alter_info::ALTER_TABLE_ALGORITHM_COPY &&
|
||||
!table->s->tmp_table) // no need to touch frm
|
||||
@ -8450,23 +8466,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
if (alter_info->flags != 0)
|
||||
handle_if_exists_options(thd, table, alter_info);
|
||||
|
||||
/*
|
||||
Look if we have to do anything at all.
|
||||
Normally ALTER can become NOOP only after handling
|
||||
the IF (NOT) EXISTS options.
|
||||
*/
|
||||
if (alter_info->flags == 0)
|
||||
{
|
||||
my_snprintf(alter_ctx.tmp_name, sizeof(alter_ctx.tmp_name),
|
||||
ER(ER_INSERT_INFO), 0L, 0L,
|
||||
thd->get_stmt_da()->current_statement_warn_count());
|
||||
my_ok(thd, 0L, 0L, alter_ctx.tmp_name);
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
/* We have to do full alter table. */
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
|
Reference in New Issue
Block a user