2 # Make directory for partition data
3 let $data_dir_path= $MYSQLTEST_VARDIR/mysql-
test-data-dir;
5 let $DATA_PATH= DATA DIRECTORY =
'$data_dir_path';
8 # Make directory for partition index
9 let $idx_dir_path= $MYSQLTEST_VARDIR/mysql-
test-idx-dir;
11 let $INDEX_PATH= INDEX DIRECTORY =
'$idx_dir_path';
13 --source include/have_partition.inc
15 --echo # Additional tests
for WL#5217 by QA, testplan 1.1
20 --source suite/parts/inc/partition-dml_cr_tab.inc
23 --source suite/parts/inc/partition-dml_ins_tab.inc
27 GRANT ALL PRIVILEGES ON
test.* TO test_user_1 IDENTIFIED BY
'testpw';
28 GRANT ALL PRIVILEGES ON
test.* TO test_user_2 IDENTIFIED BY
'testpw';
30 connect (session1, localhost, test_user_1,
'testpw',
test);
32 SELECT * FROM t1 PARTITION (`p0-29`);
35 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
37 connect (session2, localhost, test_user_2,'testpw',
test);
38 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b ='p0-29-upd-1';
39 --source include/wait_condition.inc
41 SELECT * FROM t1 PARTITION (`p30-299`);
42 UPDATE t1 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
44 SELECT * FROM t1 PARTITION (`p30-299`);
46 SELECT * FROM t1 PARTITION (`p300-2999`);
47 UPDATE t1 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
49 SELECT * FROM t1 PARTITION (`p300-2999`);
51 SELECT * FROM t1 PARTITION (`p3000-299999`);
52 UPDATE t1 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
54 SELECT * FROM t1 PARTITION (`p3000-299999`);
55 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
57 SELECT * FROM t1 PARTITION (`p0-29`);
58 UPDATE t1 PARTITION (subp3) SET b='subp3-upd';
59 UPDATE t1 PARTITION (subp4) SET b='subp4-upd';
60 UPDATE t1 PARTITION (subp5) SET b='subp5-upd';
62 SELECT * FROM t1 PARTITION (subp3);
64 SELECT * FROM t1 PARTITION (subp4);
66 SELECT * FROM t1 PARTITION (subp5);
67 SELECT * FROM t1 PARTITION (subp4,subp5,subp3) order by b,a;
73 SELECT * FROM t1 PARTITION (`p0-29`);
77 SELECT * FROM t1 PARTITION (`p0-29`);
79 (SELECT count(*) FROM t1 PARTITION (pneg,`p0-29`,`p30-299`,`p300-2999`,`p3000-299999`)) =
80 (SELECT count(*) FROM t1) as `MUST BE TRUE (1)` ;
82 # 2) empty (sub)partitions
86 --source suite/parts/inc/partition-dml_cr_tab.inc
90 SELECT * FROM t2 PARTITION (`p30-299`);
91 UPDATE t2 PARTITION (`p30-299`) SET b='p30-299-upd' WHERE a BETWEEN 30 AND 39;
92 DELETE FROM t2 PARTITION (`p30-299`) WHERE a BETWEEN 30 AND 39;
93 SELECT * FROM t2 PARTITION (`p300-2999`);
94 UPDATE t2 PARTITION (`p300-2999`) SET b='p300-2999-upd' WHERE a BETWEEN 300 AND 309;
95 DELETE FROM t2 PARTITION (`p300-2999`) WHERE a BETWEEN 300 AND 309;
96 SELECT * FROM t2 PARTITION (`p3000-299999`);
97 UPDATE t2 PARTITION (`p3000-299999`) SET b='p3000-299999-upd' WHERE a BETWEEN 3000 AND 3009;
98 DELETE FROM t2 PARTITION (`p3000-299999`) WHERE a BETWEEN 3000 AND 3009;
99 SELECT * FROM t2 PARTITION (`p0-29`);
100 UPDATE t2 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
101 DELETE FROM t2 PARTITION (`p0-29`) WHERE a BETWEEN 0 AND 9;
102 UPDATE t2 PARTITION (subp3) SET b='subp3-upd';
103 DELETE FROM t2 PARTITION (subp3);
104 UPDATE t2 PARTITION (subp4) SET b='subp4-upd';
105 DELETE FROM t2 PARTITION (subp4);
106 UPDATE t2 PARTITION (subp5) SET b='subp5-upd';
107 DELETE FROM t2 PARTITION (subp5);
108 UPDATE t2 PARTITION (subp4,subp5,subp3) SET b='subp-upd';
109 DELETE FROM t2 PARTITION (subp4,subp5,subp3);
110 SELECT * FROM t2 PARTITION (subp3);
111 SELECT * FROM t2 PARTITION (subp4);
112 SELECT * FROM t2 PARTITION (subp5);
119 --rmdir $data_dir_path/test
120 --rmdir $data_dir_path
121 --rmdir $idx_dir_path
122 DROP USER test_user_1;
123 DROP USER test_user_2;