Debian Codegraph @

mysql-test/suite/parts/inc/part_exch_qa_7.inc

raw
1 CREATE USER test_2@localhost;
2
3 --disable_result_log
4 --disable_query_log
5 --source suite/parts/inc/part_exch_tabs.inc
6 --enable_result_log
7 --enable_query_log
8
9 # 8) Exchanges partition and table and back in 2 sessions with an insert.
10 # Parallel INSERT and SELECT
11 # LOCK behaviour when exchanging different partitons.
12 --echo send
13 --send
14 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
15
16 --echo connect (test_2,localhost,test_2,,test,MASTER_MYPORT,MASTER_MYSOCK);
17 connect (test_2,localhost,test_2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
18 # Wait until exchange has been done.
19 let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=1;
20 --source include/wait_condition.inc
21 # Expect 1,3,5,9 in tp and 2,4,6,8 in t_10
22 --sorted_result
23 SELECT * FROM t_10;
24 --sorted_result
25 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
26 # Exchange back.
27 INSERT INTO tp VALUES (7,"Seven");
28 # Expect 2,4,6,8 in tp
29 --sorted_result
30 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
31 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
32
33 --echo connection default;
34 connection default;
35 --echo reap;
36 reap;
37 --sorted_result
38 SELECT * FROM t_10;
39 --sorted_result
40 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
41
42 --echo connection test_2;
43 connection test_2;
44 let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=2;
45 --source include/wait_condition.inc
46 --sorted_result
47 SELECT * FROM t_10;
48 --sorted_result
49 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
50 --echo disconnect test_2;
51 disconnect test_2;
52
53 --echo connection default;
54 connection default;
55 --sorted_result
56 SELECT * FROM t_10;
57 --sorted_result
58 SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
59 --source suite/parts/inc/part_exch_drop_tabs.inc
60
61 DROP USER test_2@localhost;
62