3 --source include/have_partition.inc
5 --echo # Additional tests
for WL#5217 by QA, testplan 1.1
8 --source suite/parts/inc/partition-dml_cr_tab.inc
9 --source suite/parts/inc/partition-dml_ins_tab.inc
13 GRANT ALL PRIVILEGES ON
test.* TO test_user_1 IDENTIFIED BY
'testpw';
14 GRANT ALL PRIVILEGES ON
test.* TO test_user_2 IDENTIFIED BY
'testpw';
16 connect (session1, localhost, test_user_1,
'testpw',
test);
18 SELECT * FROM t1 PARTITION (`p0-29`);
21 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
23 connect (session2, localhost, test_user_2,'testpw',
test);
24 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
25 --source include/wait_condition.inc
27 SELECT * FROM t1 PARTITION (`p30-299`);
28 UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
30 SELECT * FROM t1 PARTITION (`p30-299`);
32 SELECT * FROM t1 PARTITION (`p300-2999`);
33 UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
35 SELECT * FROM t1 PARTITION (`p300-2999`);
37 SELECT * FROM t1 PARTITION (`p3000-299999`);
38 UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
40 SELECT * FROM t1 PARTITION (`p3000-299999`);
41 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
43 SELECT * FROM t1 PARTITION (`p0-29`);
44 UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
45 UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
46 UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
48 SELECT * FROM t1 PARTITION (subp3);
50 SELECT * FROM t1 PARTITION (subp4);
52 SELECT * FROM t1 PARTITION (subp5);
53 SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
59 SELECT * FROM t1 PARTITION (`p0-29`);
63 SELECT * FROM t1 PARTITION (`p0-29`);
65 (SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) =
66 (SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
68 # 2) empty (sub)partitions
70 --source suite/parts/inc/partition-dml_cr_tab.inc
72 SELECT * FROM t2 PARTITION (`p30-299`);
73 UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
74 DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
75 SELECT * FROM t2 PARTITION (`p300-2999`);
76 UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
77 DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
78 SELECT * FROM t2 PARTITION (`p3000-299999`);
79 UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
80 DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
81 SELECT * FROM t2 PARTITION (`p0-29`);
82 UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
83 DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
84 UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
85 DELETE FROM t2 PARTITION (subp3);
86 UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
87 DELETE FROM t2 PARTITION (subp4);
88 UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
89 DELETE FROM t2 PARTITION (subp5);
90 UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
91 DELETE FROM t2 PARTITION (subp4,subp5,subp3);
92 SELECT * FROM t2 PARTITION (subp3);
93 SELECT * FROM t2 PARTITION (subp4);
94 SELECT * FROM t2 PARTITION (subp5);
100 DROP USER test_user_1;
101 DROP USER test_user_2;