|
1 | 1 | # Can't test with embedded server
|
2 | 2 | -- source include/not_embedded.inc
|
| 3 | +# Disable concurrent inserts to avoid test failures |
| 4 | +set @old_concurrent_insert= @@global.concurrent_insert; |
| 5 | +set @@global.concurrent_insert= 0; |
3 | 6 |
|
4 |
| ---sleep 2 |
5 | 7 | --disable_warnings
|
6 | 8 | drop table if exists t1,t3;
|
7 | 9 | --enable_warnings
|
@@ -39,10 +41,14 @@ create procedure bug4902_2()
|
39 | 41 | begin
|
40 | 42 | show processlist;
|
41 | 43 | end|
|
42 |
| ---replace_column 1 # 6 # 3 localhost |
| 44 | +--disable_result_log |
43 | 45 | call bug4902_2()|
|
44 |
| ---replace_column 1 # 6 # 3 localhost |
| 46 | +--enable_result_log |
| 47 | +show warnings| |
| 48 | +--disable_result_log |
45 | 49 | call bug4902_2()|
|
| 50 | +--enable_result_log |
| 51 | +show warnings| |
46 | 52 | drop procedure bug4902_2|
|
47 | 53 |
|
48 | 54 | #
|
@@ -268,69 +274,72 @@ drop procedure 15298_1;
|
268 | 274 | drop procedure 15298_2;
|
269 | 275 |
|
270 | 276 | #
|
271 |
| -# Test case disabled due to Bug#34891: sp_notembedded.test fails sporadically. |
| 277 | +# Bug#29936 Stored Procedure DML ignores low_priority_updates setting |
272 | 278 | #
|
273 |
| -# # |
274 |
| -# # Bug#29936 Stored Procedure DML ignores low_priority_updates setting |
275 |
| -# # |
276 |
| -# |
277 |
| -# --disable_warnings |
278 |
| -# drop table if exists t1; |
279 |
| -# drop procedure if exists p1; |
280 |
| -# --enable_warnings |
281 |
| -# |
282 |
| -# create table t1 (value varchar(15)); |
283 |
| -# create procedure p1() update t1 set value='updated' where value='old'; |
284 |
| -# |
285 |
| -# # load the procedure into sp cache and execute once |
286 |
| -# call p1(); |
287 |
| -# |
288 |
| -# insert into t1 (value) values ("old"); |
289 |
| -# |
290 |
| -# connect (rl_holder, localhost, root,,); |
291 |
| -# connect (rl_acquirer, localhost, root,,); |
292 |
| -# connect (rl_contender, localhost, root,,); |
293 |
| -# connect (rl_wait, localhost, root,,); |
294 |
| -# |
295 |
| -# connection rl_holder; |
296 |
| -# select get_lock('b26162',120); |
297 |
| -# |
298 |
| -# connection rl_acquirer; |
299 |
| -# --send select 'rl_acquirer', value from t1 where get_lock('b26162',120); |
300 |
| -# |
301 |
| -# # we must wait till this select opens and locks the tables |
302 |
| -# connection rl_wait; |
303 |
| -# let $wait_condition= |
304 |
| -# select count(*) = 1 from information_schema.processlist |
305 |
| -# where state = "User lock" and |
306 |
| -# info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)"; |
307 |
| -# --source include/wait_condition.inc |
308 |
| -# |
309 |
| -# connection default; |
310 |
| -# set session low_priority_updates=on; |
311 |
| -# --send call p1(); |
312 |
| -# |
313 |
| -# connection rl_wait; |
314 |
| -# let $wait_condition= |
315 |
| -# select count(*) = 1 from information_schema.processlist |
316 |
| -# where state = "Locked" and |
317 |
| -# info = "update t1 set value='updated' where value='old'"; |
318 |
| -# --source include/wait_condition.inc |
319 |
| -# |
320 |
| -# connection rl_contender; |
321 |
| -# select 'rl_contender', value from t1; |
322 |
| -# |
323 |
| -# connection rl_holder; |
324 |
| -# select release_lock('b26162'); |
| 279 | + |
| 280 | +--disable_warnings |
| 281 | +drop table if exists t1; |
| 282 | +drop procedure if exists p1; |
| 283 | +--enable_warnings |
| 284 | + |
| 285 | +create table t1 (value varchar(15)); |
| 286 | +create procedure p1() update t1 set value='updated' where value='old'; |
| 287 | + |
| 288 | +# load the procedure into sp cache and execute once |
| 289 | +call p1(); |
| 290 | + |
| 291 | +insert into t1 (value) values ("old"); |
| 292 | + |
| 293 | +connect (rl_holder, localhost, root,,); |
| 294 | +connect (rl_acquirer, localhost, root,,); |
| 295 | +connect (rl_contender, localhost, root,,); |
| 296 | +connect (rl_wait, localhost, root,,); |
| 297 | + |
| 298 | +connection rl_holder; |
| 299 | +select get_lock('b26162',120); |
| 300 | + |
| 301 | +connection rl_acquirer; |
| 302 | +--send select 'rl_acquirer', value from t1 where get_lock('b26162',120); |
| 303 | + |
| 304 | +# we must wait till this select opens and locks the tables |
| 305 | +connection rl_wait; |
| 306 | +let $wait_condition= |
| 307 | + select count(*) = 1 from information_schema.processlist |
| 308 | + where state = "User lock" and |
| 309 | + info = "select 'rl_acquirer', value from t1 where get_lock('b26162',120)"; |
| 310 | +--source include/wait_condition.inc |
| 311 | + |
| 312 | +connection default; |
| 313 | +set session low_priority_updates=on; |
| 314 | +--send call p1(); |
| 315 | + |
| 316 | +connection rl_wait; |
| 317 | +let $wait_condition= |
| 318 | + select count(*) = 1 from information_schema.processlist |
| 319 | + where state = "Locked" and |
| 320 | + info = "update t1 set value='updated' where value='old'"; |
| 321 | +--source include/wait_condition.inc |
| 322 | + |
| 323 | +connection rl_contender; |
| 324 | +select 'rl_contender', value from t1; |
| 325 | + |
| 326 | +connection rl_holder; |
| 327 | +select release_lock('b26162'); |
| 328 | + |
| 329 | +connection rl_acquirer; |
| 330 | +--reap |
| 331 | +connection default; |
| 332 | +--reap |
| 333 | + |
| 334 | +disconnect rl_holder; |
| 335 | +disconnect rl_acquirer; |
| 336 | +disconnect rl_wait; |
| 337 | +drop procedure p1; |
| 338 | +drop table t1; |
| 339 | +set session low_priority_updates=default; |
| 340 | + |
325 | 341 | #
|
326 |
| -# connection rl_acquirer; |
327 |
| -# --reap |
328 |
| -# connection default; |
329 |
| -# --reap |
| 342 | +# Restore global concurrent_insert value. Keep in the end of the test file. |
330 | 343 | #
|
331 |
| -# disconnect rl_holder; |
332 |
| -# disconnect rl_acquirer; |
333 |
| -# disconnect rl_wait; |
334 |
| -# drop procedure p1; |
335 |
| -# drop table t1; |
336 |
| -# set session low_priority_updates=default; |
| 344 | + |
| 345 | +set @@global.concurrent_insert= @old_concurrent_insert; |
0 commit comments