From 71c211d48bafaf3e7fe1283b7a01b312ca8c8db1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Apr 2013 11:17:10 +0200 Subject: [PATCH] Fix race in test case. --- mysql-test/suite/multi_source/gtid.result | 2 +- mysql-test/suite/multi_source/gtid.test | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result index fb727aabae2..2aeec5835f7 100644 --- a/mysql-test/suite/multi_source/gtid.result +++ b/mysql-test/suite/multi_source/gtid.result @@ -14,9 +14,9 @@ Note 1937 SLAVE '' started include/wait_for_slave_to_start.inc SET GLOBAL gtid_domain_id= 1; SET SESSION gtid_domain_id= 1; +CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES (1, "initial"); -CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t3 VALUES (101, "initial 1"); SET GLOBAL gtid_domain_id= 2; SET SESSION gtid_domain_id= 2; diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test index 06a0edf2ccc..d6b84fb7f3e 100644 --- a/mysql-test/suite/multi_source/gtid.test +++ b/mysql-test/suite/multi_source/gtid.test @@ -32,11 +32,17 @@ start all slaves; --connection master1 SET GLOBAL gtid_domain_id= 1; SET SESSION gtid_domain_id= 1; +CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES (1, "initial"); -CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t3 VALUES (101, "initial 1"); +# Make sure we have CREATE TABLE t3 from master1 before replicating INSERT INTO +# t3 from master2. +--connection slave1 +--let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.tables WHERE table_name = "t3" AND table_schema = "test" +--source include/wait_condition.inc + --connection master2 SET GLOBAL gtid_domain_id= 2; SET SESSION gtid_domain_id= 2;