From 1c4ddcf0aa120d4d1f0ef78ba8df15e39808ba54 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 15 Feb 2011 11:59:12 +0000 Subject: [PATCH 1/2] BUG#11754075: BUG#45621: A FEW TEST FILES ARE DISABLED DUE TO WL#4284 Backporting the patch from BUG#11753489 into mysql-5.5 as it is already in mysql-trunk but not in mysql-5.5. --- .../extra/rpl_tests/rpl_failed_optimize.test | 14 ++++++++------ mysql-test/suite/rpl/r/rpl_failed_optimize.result | 7 ------- mysql-test/suite/rpl/t/disabled.def | 1 - .../suite/rpl/t/rpl_failed_optimize-master.opt | 1 - 4 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt diff --git a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test index 6817405b2d9..af048aeb92a 100644 --- a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test +++ b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test @@ -2,22 +2,24 @@ # # BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log" -# Replication should work when OPTIMIZE TABLE timeouts, and -# when OPTIMIZE TABLE is executed on a non-existing table +# Replication should work when when OPTIMIZE TABLE is +# executed on a non-existing table. # +# Due to patch for BUG#989, checking that an OPTIMIZE +# that fails due to a lock wait timeout on an InnoDB table +# is not valid anymore, as an mdl lock is hit before, +# thence no timeout occurs, but instead a deadlock. +# + eval CREATE TABLE t1 ( a int ) ENGINE=$engine_type; BEGIN; INSERT INTO t1 VALUES (1); connection master1; -OPTIMIZE TABLE t1; - OPTIMIZE TABLE non_existing; sync_slave_with_master; -# End of 4.1 tests - connection master; select * from t1; commit; diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result index b0c331fa557..0d46f78c150 100644 --- a/mysql-test/suite/rpl/r/rpl_failed_optimize.result +++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result @@ -3,13 +3,6 @@ include/master-slave.inc CREATE TABLE t1 ( a int ) ENGINE=InnoDB; BEGIN; INSERT INTO t1 VALUES (1); -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead -test.t1 optimize error Lock wait timeout exceeded; try restarting transaction -test.t1 optimize status Operation failed -Warnings: -Error 1205 Lock wait timeout exceeded; try restarting transaction OPTIMIZE TABLE non_existing; Table Op Msg_type Msg_text test.non_existing optimize Error Table 'test.non_existing' doesn't exist diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 1aa596ec783..deb32e7d504 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,7 +10,6 @@ # ############################################################################## -rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table). rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released. rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way than earlier with bug#45576 rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt deleted file mode 100644 index 3f82baff598..00000000000 --- a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-innodb-lock-wait-timeout=1 From b9819e703ecbfbdca9cdb3871b73e4307662546c Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 15 Feb 2011 12:01:52 +0000 Subject: [PATCH 2/2] BUG#11754075: BUG#45621: A FEW TEST FILES ARE DISABLED DUE TO WL#4284 Backporting the patch from BUG#11753506 into mysql-5.5 as it is already in mysql-trunk but not in mysql-5.5. --- mysql-test/suite/rpl/r/rpl_read_only.result | 25 +++++++++++++-------- mysql-test/suite/rpl/t/disabled.def | 1 - mysql-test/suite/rpl/t/rpl_read_only.test | 23 +++++++++++++------ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result index f75ddd62d76..2f1f8cc1efb 100644 --- a/mysql-test/suite/rpl/r/rpl_read_only.result +++ b/mysql-test/suite/rpl/r/rpl_read_only.result @@ -27,15 +27,26 @@ a 2001 set global read_only=0; BEGIN; +BEGIN; +select @@read_only; +@@read_only +0 +set global read_only=1; +*** On SUPER USER connection *** insert into t1 values(1002); insert into t2 values(2002); -BEGIN; +*** On regular USER connection *** insert into t1 values(1003); -insert into t2 values(2003); -set global read_only=1; -COMMIT; -COMMIT; ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +insert into t2 values(2003); +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +*** SUPER USER COMMIT (must succeed) *** +COMMIT; +*** regular USER COMMIT (must succeed - nothing to commit) *** +COMMIT; +select @@read_only; +@@read_only +1 set global read_only=0; insert into t1 values(1004); insert into t2 values(2004); @@ -48,7 +59,6 @@ select * from t2; a 2001 2002 -2003 2004 select * from t1; a @@ -59,7 +69,6 @@ select * from t2; a 2001 2002 -2003 2004 set global read_only=1; select @@read_only; @@ -87,7 +96,6 @@ select * from t2; a 2001 2002 -2003 2004 2005 select * from t1; @@ -100,7 +108,6 @@ select * from t2; a 2001 2002 -2003 2004 2005 insert into t1 values(1006); diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index deb32e7d504..5d10653b7d9 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,7 +10,6 @@ # ############################################################################## -rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released. rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way than earlier with bug#45576 rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock diff --git a/mysql-test/suite/rpl/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test index 19514dc7ed7..fb92803847a 100644 --- a/mysql-test/suite/rpl/t/rpl_read_only.test +++ b/mysql-test/suite/rpl/t/rpl_read_only.test @@ -41,30 +41,39 @@ set global read_only=0; connection master1; BEGIN; + +connection master2; +BEGIN; + +connection master; +select @@read_only; +set global read_only=1; + +connection master1; +-- echo *** On SUPER USER connection *** insert into t1 values(1002); --disable_warnings insert into t2 values(2002); --enable_warnings connection master2; -BEGIN; +-- echo *** On regular USER connection *** +--error ER_OPTION_PREVENTS_STATEMENT insert into t1 values(1003); ---disable_warnings +--error ER_OPTION_PREVENTS_STATEMENT insert into t2 values(2003); ---enable_warnings - -connection master; -set global read_only=1; connection master1; ## works even with read_only=1, because master1 is root +-- echo *** SUPER USER COMMIT (must succeed) *** COMMIT; connection master2; ---error ER_OPTION_PREVENTS_STATEMENT +-- echo *** regular USER COMMIT (must succeed - nothing to commit) *** COMMIT; connection master; +select @@read_only; set global read_only=0; connection master1;