summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 666f79550c7..28c0ba60d70 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9404,6 +9404,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
const LEX_CSTRING *new_name,
HA_CREATE_INFO *create_info,
TABLE_LIST *table_list,
+ Recreate_info *recreate_info,
Alter_info *alter_info,
uint order_num, ORDER *order, bool ignore,
bool if_exists)
@@ -10860,11 +10861,10 @@ end_temporary:
thd->variables.option_bits&= ~OPTION_BIN_COMMIT_OFF;
- my_snprintf(alter_ctx.tmp_buff, sizeof(alter_ctx.tmp_buff),
- ER_THD(thd, ER_INSERT_INFO),
- (ulong) (copied + deleted), (ulong) deleted,
- (ulong) thd->get_stmt_da()->current_statement_warn_count());
- my_ok(thd, copied + deleted, 0L, alter_ctx.tmp_buff);
+ *recreate_info= Recreate_info(copied, deleted);
+ thd->my_ok_with_recreate_info(*recreate_info,
+ (ulong) thd->get_stmt_da()->
+ current_statement_warn_count());
DEBUG_SYNC(thd, "alter_table_inplace_trans_commit");
DBUG_RETURN(false);
@@ -11373,7 +11373,8 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
Like mysql_alter_table().
*/
-bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool table_copy)
+bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list,
+ Recreate_info *recreate_info, bool table_copy)
{
HA_CREATE_INFO create_info;
Alter_info alter_info;
@@ -11399,8 +11400,11 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool table_copy)
Alter_info::ALTER_TABLE_ALGORITHM_COPY);
bool res= mysql_alter_table(thd, &null_clex_str, &null_clex_str, &create_info,
- table_list, &alter_info, 0,
- (ORDER *) 0, 0, 0);
+ table_list, recreate_info, &alter_info, 0,
+ (ORDER *) 0,
+ // Ignore duplicate records on REPAIR
+ thd->lex->sql_command == SQLCOM_REPAIR,
+ 0);
table_list->next_global= next_table;
DBUG_RETURN(res);
}