1
by brian
clean slate |
1 |
--disable_warnings |
2 |
drop table if exists t1; |
|
3 |
--enable_warnings |
|
4 |
||
5 |
#
|
|
6 |
# Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates
|
|
7 |
#
|
|
8 |
--echo connection: default |
|
9 |
set low_priority_updates=1; |
|
10 |
--disable_warnings |
|
11 |
drop table if exists t1; |
|
12 |
--enable_warnings |
|
13 |
create table t1 (a int, b int, unique key t1$a (a)); |
|
14 |
lock table t1 read; |
|
15 |
connect (update,localhost,root,,); |
|
16 |
connection update; |
|
17 |
--echo connection: update |
|
18 |
set low_priority_updates=1; |
|
19 |
show variables like 'low_priority_updates'; |
|
20 |
let $ID= `select connection_id()`; |
|
21 |
--send insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2; |
|
22 |
connection default; |
|
23 |
# we must wait till the insert opens and locks the table
|
|
24 |
let $wait_condition= |
|
25 |
select count(*) = 1 from information_schema.processlist |
|
26 |
where state = "Table lock" and id = $ID; |
|
27 |
--source include/wait_condition.inc |
|
28 |
connect (select,localhost,root,,); |
|
29 |
--echo connection: select |
|
30 |
select * from t1; |
|
31 |
connection default; |
|
32 |
--echo connection: default |
|
33 |
select * from t1; |
|
34 |
connection default; |
|
35 |
disconnect update; |
|
36 |
disconnect select; |
|
37 |
unlock tables; |
|
38 |
drop table t1; |
|
39 |
set low_priority_updates=default; |