summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-08-30 17:05:49 -0600
committerunknown <malff/marcsql@weblab.(none)>2007-08-30 17:05:49 -0600
commit0458c3cfc8dbe6a0c3914047d9a21e31f87bb28b (patch)
tree8d65d220bef4f17bd52089e795255decee7a73af /mysql-test
parent89d3d585112fd71d62bcac511dab6530b6df793e (diff)
parent97844e982b8e75752bf145392982a9c8562cd125 (diff)
downloadmariadb-git-0458c3cfc8dbe6a0c3914047d9a21e31f87bb28b.tar.gz
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt50-merge sql/sql_insert.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/insert_update.result19
-rw-r--r--mysql-test/t/insert_update.test35
2 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 704cf444681..3aec9594d36 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -407,3 +407,22 @@ select if( @stamp1 = @stamp2, "correct", "wrong");
if( @stamp1 = @stamp2, "correct", "wrong")
correct
drop table t1;
+connection: default
+set low_priority_updates=1;
+drop table if exists t1;
+create table t1 (a int, b int, unique key t1$a (a));
+lock table t1 read;
+connection: update
+set low_priority_updates=1;
+show variables like 'low_priority_updates';
+Variable_name Value
+low_priority_updates ON
+insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;;
+connection: select
+select * from t1;
+a b
+connection: default
+select * from t1;
+a b
+drop table t1;
+set low_priority_updates=default;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 67f21731afe..aad241e031f 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -306,3 +306,38 @@ insert into t1(f1) values(1) on duplicate key update f1=1;
select @stamp2:=f2 from t1;
select if( @stamp1 = @stamp2, "correct", "wrong");
drop table t1;
+
+#
+# Bug#28587 SELECT is blocked by INSERT waiting on read lock, even with low_priority_updates
+#
+--echo connection: default
+set low_priority_updates=1;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b int, unique key t1$a (a));
+lock table t1 read;
+connect (update,localhost,root,,);
+connection update;
+--echo connection: update
+set low_priority_updates=1;
+show variables like 'low_priority_updates';
+let $ID= `select connection_id()`;
+--send insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;
+connection default;
+# we must wait till the insert opens and locks the table
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Locked" and id = $ID;
+--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;
+drop table t1;
+set low_priority_updates=default;