summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin <sachin.setiya@mariadb.com>2020-01-30 13:49:14 +0530
committerSachin <sachin.setiya@mariadb.com>2020-01-30 13:49:14 +0530
commit337ea589c9908fd2f80025757e9a5e884a79e2ad (patch)
treeb8ffeeabbae74fa157e813137ecbe20a7f35e086
parent6da5b79183b972663a4fa5ad605f0381ad9b1d40 (diff)
downloadmariadb-git-337ea589c9908fd2f80025757e9a5e884a79e2ad.tar.gz
new commit
-rw-r--r--mysql-test/suite/rpl/t/r_ttt.test2
-rw-r--r--mysql-test/suite/rpl/t/r_ttt2.test23
-rw-r--r--sql/sql_parse.cc7
-rw-r--r--sql/sql_table.cc6
4 files changed, 25 insertions, 13 deletions
diff --git a/mysql-test/suite/rpl/t/r_ttt.test b/mysql-test/suite/rpl/t/r_ttt.test
index e58947f5dcc..fcc2312bcac 100644
--- a/mysql-test/suite/rpl/t/r_ttt.test
+++ b/mysql-test/suite/rpl/t/r_ttt.test
@@ -10,7 +10,7 @@ start slave;
--connection master
-set global binlog_split_alter=true;
+#set global binlog_split_alter=true;
create table t1( a int primary key, b int) engine=innodb;
insert into t1 values(1,1),(2,2);
create table t2( a int primary key, b int) engine=innodb;
diff --git a/mysql-test/suite/rpl/t/r_ttt2.test b/mysql-test/suite/rpl/t/r_ttt2.test
index 074e84811eb..4533e4c4e34 100644
--- a/mysql-test/suite/rpl/t/r_ttt2.test
+++ b/mysql-test/suite/rpl/t/r_ttt2.test
@@ -16,20 +16,23 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
--connection con1
--send alter table t1 add column c int, force, algorithm=inplace;
---connection con2
---send alter table t2 add column c int, force, algorithm=inplace;
+#--connection con2
+#--send alter table t2 add column c int, force, algorithm=inplace;
---connection con1
---reap
---connection con2
---reap
-create table t3( a int primary key, b int) engine=innodb;
+#--connection con1
+#--reap
+#--connection con2
+#--reap
+#create table t3( a int primary key, b int) engine=innodb;
-show binlog events;
+#show binlog events;
+--sleep 5
--connection slave
---sleep 30
-show binlog events;
+stop slave;
+show create table t1;
+#--sleep 30
+#show binlog events;
--sleep 60000
--connection master
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a5fafc28985..e679cde9e57 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5767,6 +5767,13 @@ mysql_execute_command(THD *thd)
}
//thd->rgi_slave->mark_start_commit();
//thd->wakeup_subsequent_commits(0);
+ /*
+ Wait for other thread to commit/rollback the alter
+ */
+ mysql_mutex_lock(&mi->start_alter_lock);
+ while(info->state <= start_alter_state:: ROLLBACK_ALTER )
+ mysql_cond_wait(&mi->start_alter_cond, &mi->start_alter_lock);
+ mysql_mutex_unlock(&mi->start_alter_lock);
thd->rpt->__finish_event_group(thd->rgi_slave);
// ha_commit_trans(thd, true);
// trans_commit_implicit(thd);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 44ea9aea585..b2b7bd5a7c1 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -7677,7 +7677,8 @@ static bool mysql_inplace_alter_table(THD *thd,
goto cleanup;
if (write_start_alter(thd, partial_alter, send_query))
DBUG_RETURN(true);
- my_sleep(10000000);
+ if (thd->slave_thread && !strcmp("t1", table->alias.c_ptr()))
+ my_sleep(1000000000);
DEBUG_SYNC(thd, "alter_table_inplace_after_lock_upgrade");
THD_STAGE_INFO(thd, stage_alter_inplace_prepare);
@@ -10276,7 +10277,8 @@ do_continue:;
//If issues by binlog/master complete the prepare phase of alter and then commit
if (write_start_alter(thd, &partial_alter ,send_query))
DBUG_RETURN(true);
- my_sleep(10000000);
+ if (thd->slave_thread && !strcmp("t1", table->alias.c_ptr()))
+ my_sleep(1000000000);
if (ha_create_table(thd, alter_ctx.get_tmp_path(),
alter_ctx.new_db.str, alter_ctx.new_name.str,
create_info, &frm))