1 CREATE USER test_2@localhost;
3 --source include/not_embedded.inc
6 --source suite/parts/inc/part_exch_tabs.inc
10 # 8) Exchanges partition and table and back in 2 sessions with an insert.
11 # Parallel INSERT and SELECT
12 # LOCK behaviour when exchanging different partitons.
15 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
17 --echo connect (test_2,localhost,test_2,,
test,MASTER_MYPORT,MASTER_MYSOCK);
18 connect (test_2,localhost,test_2,,
test,$MASTER_MYPORT,$MASTER_MYSOCK);
19 # Wait until exchange has been done.
20 let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=1;
21 --source include/wait_condition.inc
22 # Expect 1,3,5,9 in tp and 2,4,6,8 in t_10
26 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
28 INSERT INTO tp VALUES (7,
"Seven");
29 # Expect 2,4,6,8 in tp
31 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
32 ALTER
TABLE tp EXCHANGE PARTITION p0 WITH
TABLE t_10;
34 --echo connection
default;
41 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
43 --echo connection test_2;
45 let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=2;
46 --source include/wait_condition.inc
50 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
51 --echo disconnect test_2;
54 --echo connection
default;
59 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
60 --source suite/parts/inc/part_exch_drop_tabs.inc
62 DROP USER test_2@localhost;