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.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 936c97b8ac5..84242d7138f 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7579,9 +7579,9 @@ static int mysql_inplace_alter_table(THD *thd,
bool reopen_tables= false;
bool res;
handlerton *hton;
- Master_info *mi= NULL;
- if (thd->slave_thread)
- mi= thd->rgi_slave->rli->mi;
+// Master_info *mi= NULL;
+ //if (thd->slave_thread)
+ //mi= thd->rgi_slave->rli->mi;
int return_result= 0;
DBUG_ENTER("mysql_inplace_alter_table");
@@ -7747,7 +7747,8 @@ static int mysql_inplace_alter_table(THD *thd,
thd->abort_on_warning= false;
if (thd->lex->alter_info.alter_identifier && !thd->direct_commit_alter)
{
- if ((return_result= master_result(thd, mi, info, res)))
+ wait_for_master(thd, info);
+ if (info->state == start_alter_state::ROLLBACK_ALTER)
goto rollback;
}
if (res)
@@ -10303,6 +10304,10 @@ do_continue:;
if(write_bin_log(thd, false, send_query, strlen(send_query), true, true))
DBUG_RETURN(true);
}
+ if (start_alter_id)
+ {
+ master_result(thd, mi, info, res);
+ }
cleanup_table_after_inplace_alter(&altered_table);
DBUG_RETURN(true);
}