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';
17 set @@global.sql_mode=
'';
18 --echo #######################################################
19 --echo # UPDATE without partition selection
21 connect (session1, localhost, test_user_1,
'testpw',
test);
22 SELECT * FROM t1 PARTITION (`p0-29`);
25 UPDATE t1 SET b=
'table-upd-1' WHERE a BETWEEN 0 AND 9;
27 connect (session2, localhost, test_user_2,
'testpw',
test);
28 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'table-upd-1';
29 --source include/wait_condition.inc
30 UPDATE t1 SET b=
'table-upd-2' WHERE a BETWEEN 0 AND 9;
31 SELECT * FROM t1 PARTITION (`p0-29`);
32 INSERT INTO t1 VALUES (11,
'table-ins');
33 INSERT INTO t1 VALUES (12,
'table-ins');
34 SELECT * FROM t1 PARTITION (`p0-29`);
35 DELETE FROM t1 WHERE b=
'table-ins';
36 SELECT * FROM t1 PARTITION (`p0-29`);
41 SELECT * FROM t1 PARTITION (`p0-29`);
44 SELECT * FROM t1 PARTITION (`p0-29`);
46 --echo #######################################################
47 --echo # UPDATE with partition selection
48 #connect (session1, localhost, test_user_1,'testpw',test);
50 SELECT * FROM t1 PARTITION (`p0-29`);
53 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
55 #connect (session2, localhost, test_user_2,'testpw',test);
57 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'p0-29-upd-1';
58 --source include/wait_condition.inc
59 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
60 SELECT * FROM t1 PARTITION (`p0-29`);
61 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
62 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
63 SELECT * FROM t1 PARTITION (`p0-29`);
64 DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
65 SELECT * FROM t1 PARTITION (`p0-29`);
70 SELECT * FROM t1 PARTITION (`p0-29`);
73 SELECT * FROM t1 PARTITION (`p0-29`);
80 --source suite/parts/inc/partition-dml_cr_tab.inc
81 --source suite/parts/inc/partition-dml_ins_tab.inc
82 --echo
# Run in ANSI mode
83 set @@global.sql_mode= ansi;
84 --echo #######################################################
85 --echo # UPDATE without partition selection
87 connect (session1, localhost, test_user_1,
'testpw',
test);
88 SELECT * FROM t1 PARTITION (`p0-29`);
91 UPDATE t1 SET b=
'table-upd-1' WHERE a BETWEEN 0 AND 9;
93 connect (session2, localhost, test_user_2,
'testpw',
test);
94 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'table-upd-1';
95 --source include/wait_condition.inc
96 UPDATE t1 SET b=
'table-upd-2' WHERE a BETWEEN 0 AND 9;
97 SELECT * FROM t1 PARTITION (`p0-29`);
98 INSERT INTO t1 VALUES (11,
'table-ins');
99 INSERT INTO t1 VALUES (12,
'table-ins');
100 SELECT * FROM t1 PARTITION (`p0-29`);
101 DELETE FROM t1 WHERE b=
'table-ins';
102 SELECT * FROM t1 PARTITION (`p0-29`);
107 SELECT * FROM t1 PARTITION (`p0-29`);
110 SELECT * FROM t1 PARTITION (`p0-29`);
112 --echo #######################################################
113 --echo # UPDATE with partition selection
114 #connect (session1, localhost, test_user_1,'testpw',test);
116 SELECT * FROM t1 PARTITION (`p0-29`);
119 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
121 #connect (session2, localhost, test_user_2,'testpw',test);
123 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'p0-29-upd-1';
124 --source include/wait_condition.inc
125 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
126 SELECT * FROM t1 PARTITION (`p0-29`);
127 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
128 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
129 SELECT * FROM t1 PARTITION (`p0-29`);
130 DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
131 SELECT * FROM t1 PARTITION (`p0-29`);
136 SELECT * FROM t1 PARTITION (`p0-29`);
139 SELECT * FROM t1 PARTITION (`p0-29`);
146 --source suite/parts/inc/partition-dml_cr_tab.inc
147 --source suite/parts/inc/partition-dml_ins_tab.inc
148 --echo
# Run in traditional mode
149 set @@global.sql_mode= traditional;
150 --echo #######################################################
151 --echo # UPDATE without partition selection
153 connect (session1, localhost, test_user_1,
'testpw',
test);
154 SELECT * FROM t1 PARTITION (`p0-29`);
157 UPDATE t1 SET b=
'table-upd-1' WHERE a BETWEEN 0 AND 9;
159 connect (session2, localhost, test_user_2,
'testpw',
test);
160 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'table-upd-1';
161 --source include/wait_condition.inc
162 UPDATE t1 SET b=
'table-upd-2' WHERE a BETWEEN 0 AND 9;
163 SELECT * FROM t1 PARTITION (`p0-29`);
164 INSERT INTO t1 VALUES (11,
'table-ins');
165 INSERT INTO t1 VALUES (12,
'table-ins');
166 SELECT * FROM t1 PARTITION (`p0-29`);
167 DELETE FROM t1 WHERE b=
'table-ins';
168 SELECT * FROM t1 PARTITION (`p0-29`);
173 SELECT * FROM t1 PARTITION (`p0-29`);
176 SELECT * FROM t1 PARTITION (`p0-29`);
178 --echo #######################################################
179 --echo # UPDATE with partition selection
180 #connect (session1, localhost, test_user_1,'testpw',test);
182 SELECT * FROM t1 PARTITION (`p0-29`);
185 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-1' WHERE a BETWEEN 0 AND 9;
187 #connect (session2, localhost, test_user_2,'testpw',test);
189 let $wait_condition= SELECT count(*)= 4 FROM t1 WHERE b =
'p0-29-upd-1';
190 --source include/wait_condition.inc
191 UPDATE t1 PARTITION (`p0-29`) SET b='p0-29-upd-2' WHERE a BETWEEN 0 AND 9;
192 SELECT * FROM t1 PARTITION (`p0-29`);
193 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (11, '(p0-29-)ins');
194 INSERT INTO t1 PARTITION (`p0-29`, subp4) VALUES (12, '(p0-29-)ins');
195 SELECT * FROM t1 PARTITION (`p0-29`);
196 DELETE FROM t1 PARTITION (`p0-29`,subp5) WHERE b= '(p0-29-)ins';
197 SELECT * FROM t1 PARTITION (`p0-29`);
202 SELECT * FROM t1 PARTITION (`p0-29`);
205 SELECT * FROM t1 PARTITION (`p0-29`);
211 DROP USER test_user_1;
212 DROP USER test_user_2;