Commit 77897268 authored by Jan Lindström's avatar Jan Lindström

MDEV-24447 : galera.galera_toi_lock_shared MTR failed: WSREP: ALTER TABLE isolation failure

Add wait_condition so that INSERT is replicated before ALTER
and ALTER is replicated before we try to INSERT with new
number of columns.
parent ffc384e0
......@@ -6,12 +6,21 @@ connection node_2;
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;
connection node_1;
INSERT INTO t1 VALUES (2, 2);
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
SELECT COUNT(*) AS EXPECT_2 FROM t1;
EXPECT_2
2
SELECT * FROM t1;
id f2
1 NULL
2 2
connection node_2;
INSERT INTO t1 VALUES (3, 3);
SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
1
SELECT COUNT(*) AS EXPECT_3 FROM t1;
EXPECT_3
3
SELECT * FROM t1;
id f2
1 NULL
2 2
3 3
DROP TABLE t1;
......@@ -10,17 +10,25 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1
--source include/wait_condition.inc
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
INSERT INTO t1 VALUES (2, 2);
SELECT COUNT(*) = 2 FROM t1;
SELECT COUNT(*) AS EXPECT_2 FROM t1;
SELECT * FROM t1;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1
--source include/wait_condition.inc
INSERT INTO t1 VALUES (3, 3);
SELECT COUNT(*) = 3 FROM t1;
SELECT COUNT(*) AS EXPECT_3 FROM t1;
SELECT * FROM t1;
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment