Debian Codegraph @

mysql-test/suite/galera_sr/t/galera_sr_ddl_schema.test

raw
1 --source include/galera_cluster.inc
2 --source include/have_innodb.inc
3
4 #
5 # Test the effect of DROP SCHEMA DDL on a concurrent SR transaction
6 # Most other DDL tests work on a table level, so this test exercises a
7 # different granularity.
8 #
9
10 --connection node_1
11 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
12 SET SESSION wsrep_trx_fragment_size = 1;
13
14 SET AUTOCOMMIT=OFF;
15 START TRANSACTION;
16
17 INSERT INTO t1 VALUES (1, 1);
18 INSERT INTO t1 VALUES (2, 2);
19 INSERT INTO t1 VALUES (3, 3);
20 INSERT INTO t1 VALUES (4, 4);
21 INSERT INTO t1 VALUES (5, 5);
22
23 --connection node_2
24 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
25 --let $wait_condition = SELECT COUNT(*) > 0 FROM t1;
26 --source include/wait_condition.inc
27
28 DROP SCHEMA test;
29
30 --error ER_NO_SUCH_TABLE
31 SELECT COUNT(*) = 0 FROM test.t1;
32
33 --connection node_1
34
35 # Transaction can not continue due to DDL
36 --error ER_LOCK_DEADLOCK
37 INSERT INTO test.t1 VALUES (6, 6);
38
39 # DDL is now in effect
40 --error ER_NO_SUCH_TABLE
41 INSERT INTO test.t1 VALUES (6, 6);
42
43 CREATE SCHEMA test;