From 4aaab47ea948b6e19de5bbc6bae41c20db7bf01b Mon Sep 17 00:00:00 2001 From: "davi@moksha.local" <> Date: Thu, 6 Sep 2007 13:22:34 -0300 Subject: [PATCH] The test case for bug 28587 doesn't work with the embedded version, the first query is not running while we are doing wait queries on a second connection. --- mysql-test/r/insert_notembedded.result | 19 ++++++++++++++ mysql-test/r/insert_update.result | 19 -------------- mysql-test/t/insert_notembedded.test | 35 ++++++++++++++++++++++++++ mysql-test/t/insert_update.test | 35 -------------------------- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result index 816060b7ec9..ac69cb65972 100644 --- a/mysql-test/r/insert_notembedded.result +++ b/mysql-test/r/insert_notembedded.result @@ -105,3 +105,22 @@ DROP VIEW view_target2; DROP VIEW view_target3; DROP USER user20989@localhost; DROP DATABASE meow; +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/r/insert_update.result b/mysql-test/r/insert_update.result index 3aec9594d36..704cf444681 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -407,22 +407,3 @@ 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_notembedded.test b/mysql-test/t/insert_notembedded.test index bdea72e9eca..24040f9c310 100644 --- a/mysql-test/t/insert_notembedded.test +++ b/mysql-test/t/insert_notembedded.test @@ -152,3 +152,38 @@ disconnect root; connection default; DROP DATABASE meow; + +# +# 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; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index aad241e031f..67f21731afe 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -306,38 +306,3 @@ 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;