summaryrefslogtreecommitdiff
path: root/mysql-test/t/delayed.test
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-03-11 16:32:42 +0100
committerGuilhem Bichot <guilhem@mysql.com>2009-03-11 16:32:42 +0100
commitb0fcbc84ef609b1147c3624e90fe3dac66ef8c1d (patch)
treeee09976ab4dd9dee924a4c7e30eb0fc9f5e7d63f /mysql-test/t/delayed.test
parenta15d25f07e56cbd80aecbeadef635d3b55e00e85 (diff)
parent11570d64fcffa66feaf1fdb8072fdfb9dbd865ca (diff)
downloadmariadb-git-b0fcbc84ef609b1147c3624e90fe3dac66ef8c1d.tar.gz
merge of 5.1-main into 5.1-maria; MyISAM changes are also ported to Maria.
Diffstat (limited to 'mysql-test/t/delayed.test')
-rw-r--r--mysql-test/t/delayed.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 87d6ab55ee5..b8ab4fe31c0 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -298,4 +298,47 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2;
+#
+# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
+# even with low_priority_updates
+#
+
+set @old_delayed_updates = @@global.low_priority_updates;
+set global low_priority_updates = 1;
+select @@global.low_priority_updates;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b int);
+insert into t1 values (1,1);
+lock table t1 read;
+connect (update,localhost,root,,);
+connection update;
+--echo connection: update
+--send insert delayed into t1 values (2,2);
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where command = "Delayed insert" and state = "upgrading lock";
+--source include/wait_condition.inc
+connect (select,localhost,root,,);
+--echo connection: select
+select * from t1;
+connection default;
+--echo connection: default
+select * from t1;
+connection default;
+disconnect update;
+disconnect select;
+unlock tables;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where command = "Delayed insert" and state = "Waiting for INSERT";
+--source include/wait_condition.inc
+select * from t1;
+drop table t1;
+
+set global low_priority_updates = @old_delayed_updates;
+
--echo End of 5.1 tests