diff options
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r-- | mysql-test/t/multi_update.test | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 5298701d790..496d045075a 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -474,7 +474,8 @@ drop table t1,t2; # # Test alter table and a concurrent multi update -# (This will force update to reopen tables) +# (Before we have introduced data-lock-aware metadata locks +# this test case forced update to reopen tables). # create table t1 (a int, b int); @@ -494,9 +495,9 @@ send alter table t1 add column c int default 100 after a; connect (updater,localhost,root,,test); connection updater; # Wait till "alter table t1 ..." of session changer is in work. -# = There is one session is in state "Locked". +# = There is one session waiting. let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Locked'; + where state= 'Waiting for table metadata lock'; --source include/wait_condition.inc send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a; @@ -505,9 +506,9 @@ connection locker; # - "alter table t1 ..." of session changer and # - "update t1, v1 ..." of session updater # are in work. -# = There are two session is in state "Locked". +# = There are two session waiting. let $wait_condition= select count(*)= 2 from information_schema.processlist - where state= 'Locked'; + where state= 'Waiting for table metadata lock'; --source include/wait_condition.inc unlock tables; @@ -585,8 +586,7 @@ reset master; UPDATE t2,t1 SET t2.a=t1.a+2; # check select * from t2 /* must be (3,1), (4,4) */; -let wait_binlog_event= UPDATE; -source include/wait_for_binlog_event.inc; +source include/show_binlog_events.inc; # B. testing multi_update::send_error() ineffective update # (as there is a policy described at mysql_update() still go to binlog) @@ -597,8 +597,7 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; --error ER_DUP_ENTRY UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; -let wait_binlog_event= UPDATE; -source include/wait_for_binlog_event.inc; +source include/show_binlog_events.inc; # cleanup drop table t1, t2; @@ -684,4 +683,24 @@ UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1; DROP FUNCTION f1; DROP TABLE t1; +--echo # +--echo # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a +--echo # table is updated twice +--echo # + +# Results differ between storage engines. +# See multi_update_innodb.test for the InnoDB variant of this test +CREATE TABLE t1( + pk INT, + a INT, + PRIMARY KEY (pk) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (0,0); +UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2; +--echo +--echo # Should be (1,2) +SELECT * FROM t1; +DROP TABLE t1; + --echo end of tests |