diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-08-20 10:24:32 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-08-20 10:24:32 +0200 |
commit | 02863b41804352f1371407ccdc9e1cb51b9e20e3 (patch) | |
tree | 454ab81e4898c9102f39f0802a13bbb0a5236f09 /mysql-test | |
parent | ac6026ce2774222b4607fcad4e36bbd5c25ff60a (diff) | |
parent | 72b228c581e81dc07a6ac61a57b89ce80d0e5847 (diff) | |
download | mariadb-git-02863b41804352f1371407ccdc9e1cb51b9e20e3.tar.gz |
Merge from mysql-5.5-runtime to mysql-5.5-bugfixing.
Diffstat (limited to 'mysql-test')
58 files changed, 1332 insertions, 342 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test index 4bc1c004ba7..8b9b7e7ff39 100644 --- a/mysql-test/extra/rpl_tests/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -153,7 +153,7 @@ connection master; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info = "RENAME TABLE t1 TO t3, t2 TO t1" and - state = "Waiting for table"; + state = "Waiting for table metadata lock"; --source include/wait_condition.inc COMMIT; diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc index 57772dddefc..c615ebd02cd 100644 --- a/mysql-test/include/check_no_concurrent_insert.inc +++ b/mysql-test/include/check_no_concurrent_insert.inc @@ -43,7 +43,8 @@ connection default; # of our statement. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "insert into $table (i) values (0)"; + where state = "Waiting for table level lock" and + info = "insert into $table (i) values (0)"; --source include/wait_condition.inc --disable_result_log diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index 98988ab55ba..65e9e61d077 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -523,7 +523,7 @@ connection waiter; --echo connection: waiter let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Flushing tables"; + where state = "Waiting for table flush"; --source include/wait_condition.inc connection default; --echo connection: default @@ -557,7 +557,8 @@ connection waiter; --echo connection: waiter let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t0"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t0"; --source include/wait_condition.inc connection default; --echo connection: default @@ -743,7 +744,8 @@ send alter table t1 engine=memory; connection con2; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 engine=memory"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 engine=memory"; --source include/wait_condition.inc connection default; --error ER_ILLEGAL_HA @@ -764,7 +766,8 @@ send alter table t1 engine=memory; connection con2; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 engine=memory"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 engine=memory"; --source include/wait_condition.inc connection default; --echo # Since S metadata lock was already acquired at HANDLER OPEN time @@ -1024,7 +1027,9 @@ connection con1; --echo # --> connection con2 connection con2; --echo # Waitng for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1055,7 +1060,9 @@ connection con1; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1097,7 +1104,8 @@ send rename table t0 to t3, t1 to t0, t3 to t1; connection con1; --echo # Waiting for 'rename table ...' to get blocked... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='rename table t0 to t3, t1 to t0, t3 to t1'; + where state='Waiting for table metadata lock' and + info='rename table t0 to t3, t1 to t0, t3 to t1'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1137,7 +1145,9 @@ connection con2; --echo # --> connection con1 connection con1; --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # --> connection default connection default; @@ -1146,7 +1156,9 @@ send select * from t2; --echo # --> connection con1 connection con1; --echo # Waiting for 'select * from t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='select * from t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='select * from t2'; unlock tables; --echo # --> connection con2 connection con2; @@ -1190,10 +1202,14 @@ connection default; --echo # --> connection con3 connection con3; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # Demonstrate that t2 lock was released and t2 was dropped --echo # after ROLLBACK TO SAVEPOINT @@ -1255,10 +1271,14 @@ connection default; --echo # --> connection con3 connection con3; --echo # Waiting for 'drop table t1' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t1'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t1'; --source include/wait_condition.inc --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # Demonstrate that t2 lock was released and t2 was dropped --echo # after ROLLBACK TO SAVEPOINT @@ -1314,7 +1334,9 @@ drop table t1, t2; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t3' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t3'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t3'; --source include/wait_condition.inc --echo # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler --echo # lock. @@ -1348,7 +1370,9 @@ send drop table t2; --echo # --> connection con2 connection con2; --echo # Waiting for 'drop table t2' to get blocked... -let $wait_condition=select count(*)=1 from information_schema.processlist where state='Waiting for table' and info='drop table t2'; +let $wait_condition=select count(*)=1 from information_schema.processlist + where state='Waiting for table metadata lock' and + info='drop table t2'; --source include/wait_condition.inc --echo # --> connection con1 connection con1; @@ -1400,7 +1424,8 @@ connection con2; --echo # has read from the table commits. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock tables t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock tables t1 write"; --source include/wait_condition.inc --echo # --> connection default @@ -1427,7 +1452,8 @@ connection con1; --echo # Waiting for 'handler t1 read a next' to get blocked... let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "handler t1 read a next"; + where state = "Waiting for table level lock" and + info = "handler t1 read a next"; --source include/wait_condition.inc --echo # The below 'drop table t1' should be able to proceed without diff --git a/mysql-test/include/have_thread_concurrency.inc b/mysql-test/include/have_thread_concurrency.inc deleted file mode 100644 index 730edbf4895..00000000000 --- a/mysql-test/include/have_thread_concurrency.inc +++ /dev/null @@ -1,10 +0,0 @@ -disable_query_log; -disable_result_log; -set @have_thread_concurrency=0; -select @have_thread_concurrency:=1 from information_schema.global_variables where variable_name='thread_concurrency'; -if (`select @have_thread_concurrency = 0`) -{ - skip Need @@thread_concurrency; -} -enable_result_log; -enable_query_log; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index f1cefe24704..3481d572514 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -1580,7 +1580,7 @@ connect (con1, localhost, root,,); --echo # Connection default connection default; let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='TRUNCATE TABLE t1'; + WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1'; --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a; ROLLBACK; diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result index 16ec64b4c50..37951c30787 100644 --- a/mysql-test/r/events_trans.result +++ b/mysql-test/r/events_trans.result @@ -116,3 +116,22 @@ OK: create event: database does not exist delete from t1; commit work; drop database events_test; +# +# Bug#54105 assert in MDL_context::release_locks_stored_before +# +USE test; +DROP TABLE IF EXISTS t1, t2; +DROP EVENT IF EXISTS e1; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT); +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SAVEPOINT A; +SHOW CREATE EVENT e1; +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci +SELECT * FROM t2; +a +ROLLBACK WORK TO SAVEPOINT A; +DROP TABLE t1, t2; diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index 3702443d04a..aee18d91edf 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -205,6 +205,51 @@ a insert into t2 (a) values (3); # --> connection default; unlock tables; +# +# Check that "FLUSH TABLES <list> WITH READ LOCK" is +# compatible with active "FLUSH TABLES WITH READ LOCK". +# Vice versa it is not true, since tables read-locked by +# "FLUSH TABLES <list> WITH READ LOCK" can't be flushed. +flush tables with read lock; +# --> connection con1; +flush table t1 with read lock; +select * from t1; +a +1 +unlock tables; +# --> connection default; +unlock tables; +# +# Check that FLUSH TABLES t1 WITH READ LOCK +# does not conflict with an existing FLUSH TABLES t2 +# WITH READ LOCK. +# +flush table t1 with read lock; +# --> connection con1 +flush table t2 with read lock; +unlock tables; +# --> connection default +unlock tables; +# +# Check that FLUSH TABLES t1 WITH READ LOCK +# does not conflict with SET GLOBAL read_only=1. +# +set global read_only=1; +# connection con1 +flush table t1 with read lock; +unlock tables; +# connection default +set global read_only=0; +# +# Check that it's possible to read-lock +# tables locked with FLUSH TABLE <list> WITH READ LOCK. +# +flush tables t1, t2 with read lock; +# connection con1 +lock table t1 read, t2 read; +unlock tables; +# connection default +unlock tables; # --> connection con1 drop table t1, t2, t3; # @@ -234,3 +279,97 @@ drop temporary table v1; unlock tables; drop view v2, v3; drop table t1, v1; +# +# FLUSH TABLES <list> WITH READ LOCK and HANDLER +# +drop table if exists t1; +create table t1 (a int, key a (a)); +insert into t1 (a) values (1), (2), (3); +handler t1 open; +handler t1 read a next; +a +1 +handler t1 read a next; +a +2 +flush tables t1 with read lock; +handler t1 read a next; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +unlock tables; +# +# Sic: lost handler position. +# +handler t1 read a next; +a +1 +handler t1 close; +drop table t1; +# +# Bug#52117 Pending FLUSH TALBES <list> aborts +# transactions unnecessarily. +# +drop table if exists t1; +# --> conection default +create table t1 (a int); +begin; +select * from t1; +a +# --> connection con1 +# +# Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN +# or a long-running select -- anything that +# prevents FLUSH TABLE t1 from immediate completion would do. +# +lock table t1 read; +# --> connection con2 +# +# FLUSH TABLE expels the table definition from the cache. +# Sending 'flush table t1'... +flush table t1; +# --> connection default +# Let flush table sync in. +select * from t1; +# --> connection con1 +select * from t1; +a +unlock tables; +# --> connection con2 +# Reaping 'flush table t1'... +# --> connection default +# Reaping 'select * from t1'... +a +commit; +# +# Repeat the same test but with FLUSH TABLES +# +begin; +select * from t1; +a +# --> connection con1 +# +# Issue a LOCK TABLE t1 READ. +# +lock table t1 read; +# --> connection con2 +# +# FLUSH TABLES expels the table definition from the cache. +# Sending 'flush tables'... +flush tables; +# --> connection default +# Let flush table sync in. +select * from t1; +# --> connection con1 +select * from t1; +a +unlock tables; +# --> connection con2 +# Reaping 'flush tables'... +# --> connection default +# Reaping 'select * from t1'... +a +commit; +# Cleanup +# --> connection con1 +# --> connection con2 +# --> connection default +drop table t1; diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result index fbb7e7e8397..838a7ad5162 100644 --- a/mysql-test/r/information_schema_inno.result +++ b/mysql-test/r/information_schema_inno.result @@ -89,3 +89,15 @@ UNIQUE_CONSTRAINT_NAME NULL drop table t2; set foreign_key_checks = 1; +# +# Bug#55973 Assertion `thd->transaction.stmt.is_empty()' +# on CREATE TABLE .. SELECT I_S.PART +# +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +CREATE VIEW v1 AS SELECT 1; +CREATE TABLE t1 engine = InnoDB AS +SELECT * FROM information_schema.partitions +WHERE table_schema= 'test' AND table_name= 'v1'; +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index 0fd408b0208..d484ab77701 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -2034,6 +2034,155 @@ set debug_sync='now SIGNAL go2'; # Switching to connection 'default'. # Reaping ALTER. It should succeed and not produce ER_LOCK_DEADLOCK. drop table t1; +# +# Now, test for a situation in which deadlock involves waiting not +# only in MDL subsystem but also for TDC. Such deadlocks should be +# successfully detected. If possible, they should be resolved without +# resorting to ER_LOCK_DEADLOCK error. +# +create table t1(i int); +create table t2(j int); +# +# First, let us check how we handle a simple scenario involving +# waits in MDL and TDC. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con1'. +# Start a statement, which will acquire SR metadata lock on t1, open it +# and then stop, before trying to acquire SW lock on t2 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# Sending: +select * from t1 where i in (select j from t2 for update); +# Switching to connection 'deadlock_con2'. +# Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t1 and t2 and wait till SELECT closes t1. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'deadlock_con3'. +# Wait until FLUSH TABLES WITH t1, t2 READ LOCK starts waiting +# for SELECT to close t1. +# Resume SELECT, so it tries to acquire SW lock on t1 and blocks, +# creating a deadlock. This deadlock should be detected and resolved +# by backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +unlock tables; +# Switching to connection 'deadlock_con1'. +# Reap SELECT. +i +# +# The same scenario with a slightly different order of events +# which emphasizes that setting correct deadlock detector weights +# for flush waits is important. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con2'. +set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WAIT_FOR go'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t1 and t2 and wait on debug sync point. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'deadlock_con1'. +# Wait till FLUSH TABLE WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; +# Start statement which will acquire SR metadata lock on t1, open +# it and then will block while trying to acquire SW lock on t2. +# Sending: +select * from t1 where i in (select j from t2 for update); +# Switching to connection 'deadlock_con3'. +# Wait till the above SELECT blocks. +# Resume FLUSH TABLES, so it tries to flush t1, thus creating +# a deadlock. This deadlock should be detected and resolved by +# backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +unlock tables; +# Switching to connection 'deadlock_con1'. +# Reap SELECT. +i +# +# Now a more complex scenario involving two connections +# waiting for MDL and one for TDC. +# +set debug_sync= 'RESET'; +# Switching to connection 'deadlock_con1'. +# Start a statement which will acquire SR metadata lock on t2, open it +# and then stop, before trying to acquire SR on t1 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# Sending: +select * from t2, t1; +# Switching to connection 'deadlock_con2'. +# Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +# The below FLUSH TABLES WITH READ LOCK should acquire +# SNW locks on t2 and wait till SELECT closes t2. +# Sending: +flush tables t2 with read lock; +# Switching to connection 'deadlock_con3'. +# Wait until FLUSH TABLES WITH READ LOCK starts waiting +# for SELECT to close t2. +# The below DROP TABLES should acquire X lock on t1 and start +# waiting for X lock on t2. +# Sending: +drop tables t1, t2; +# Switching to connection 'default'. +# Wait until DROP TABLES starts waiting for X lock on t2. +# Resume SELECT, so it tries to acquire SR lock on t1 and blocks, +# creating a deadlock. This deadlock should be detected and resolved +# by backing-off SELECT. As a result, FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; +# Switching to connection 'deadlock_con2'. +# Reap FLUSH TABLES WITH READ LOCK. +# Unblock DROP TABLES. +unlock tables; +# Switching to connection 'deadlock_con3'. +# Reap DROP TABLES. +# Switching to connection 'deadlock_con1'. +# Reap SELECT. It should emit error about missing table. +ERROR 42S02: Table 'test.t2' doesn't exist +# Switching to connection 'default'. +set debug_sync= 'RESET'; +# +# Test for a scenario in which FLUSH TABLES <list> WITH READ LOCK +# used to erroneously release metadata locks. +# +drop tables if exists t1, t2; +set debug_sync= 'RESET'; +create table t1(i int); +create table t2(j int); +# Switching to connection 'con2'. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +# The below FLUSH TABLES <list> WITH READ LOCK should acquire +# SNW locks on t1 and t2, open table t1 and block on the debug +# sync point. +# Sending: +flush tables t1, t2 with read lock; +# Switching to connection 'con1'. +# Wait till FLUSH TABLES <list> WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; +# Start a statement which will flush all tables and thus +# invalidate table t1 open by FLUSH TABLES <list> WITH READ LOCK. +# Sending: +flush tables; +# Switching to connection 'default'. +# Wait till the above FLUSH TABLES blocks. +# Resume FLUSH TABLES <list> WITH READ LOCK, so it tries to open t2 +# discovers that its t1 is obsolete and tries to reopen all tables. +# Such reopen should not cause releasing of SNW metadata locks +# which would result in assertion failures. +set debug_sync='now SIGNAL go'; +# Switching to connection 'con2'. +# Reap FLUSH TABLES <list> WITH READ LOCK. +unlock tables; +# Switching to connection 'con1'. +# Reap FLUSH TABLES. +# Clean-up. +# Switching to connection 'default'. +drop tables t1, t2; set debug_sync= 'RESET'; # # Test for bug #46748 "Assertion in MDL_context::wait_for_locks() diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 112a86e0c88..f209e401764 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -701,6 +701,7 @@ drop table t1,t2,t3,t4; set query_cache_wlock_invalidate=1; create table t1 (a int not null); create table t2 (a int not null); +create view v1 as select * from t1; select * from t1; a select * from t2; @@ -713,6 +714,17 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 unlock table; +select * from t1; +a +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +lock table v1 write; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +unlock table; +drop view v1; drop table t1,t2; set query_cache_wlock_invalidate=default; CREATE TABLE t1 (id INT PRIMARY KEY); @@ -853,7 +865,7 @@ Variable_name Value Qcache_queries_in_cache 0 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 18 +Qcache_inserts 19 show status like "Qcache_hits"; Variable_name Value Qcache_hits 6 @@ -866,7 +878,7 @@ Variable_name Value Qcache_queries_in_cache 1 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 19 +Qcache_inserts 20 show status like "Qcache_hits"; Variable_name Value Qcache_hits 7 diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result index 853c3bcf575..809d652053e 100644 --- a/mysql-test/r/schema.result +++ b/mysql-test/r/schema.result @@ -16,21 +16,19 @@ drop schema foo; # Bug #48940 MDL deadlocks against mysql_rm_db # DROP SCHEMA IF EXISTS schema1; -DROP SCHEMA IF EXISTS schema2; # Connection default CREATE SCHEMA schema1; -CREATE SCHEMA schema2; CREATE TABLE schema1.t1 (a INT); SET autocommit= FALSE; INSERT INTO schema1.t1 VALUES (1); # Connection 2 DROP SCHEMA schema1; # Connection default -ALTER SCHEMA schema2 DEFAULT CHARACTER SET utf8; +ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8; +Got one of the listed errors SET autocommit= TRUE; # Connection 2 # Connection default -DROP SCHEMA schema2; # # Bug #49988 MDL deadlocks with mysql_create_db, reload_acl_and_cache # diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result index a7823175b3c..0d3e87f17e2 100644 --- a/mysql-test/r/sp-lock.result +++ b/mysql-test/r/sp-lock.result @@ -148,12 +148,12 @@ f1() # Sending 'drop procedure p1'... drop procedure p1; # --> connection con2 -# Waitng for 'drop procedure t1' to get blocked on MDL lock... +# Waiting for 'drop procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -174,12 +174,12 @@ f1() # Sending 'create procedure p1'... create procedure p1() begin end; # --> connection con2 -# Waitng for 'create procedure t1' to get blocked on MDL lock... +# Waiting for 'create procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -200,12 +200,12 @@ f1() # Sending 'alter procedure p1'... alter procedure p1 contains sql; # --> connection con2 -# Waitng for 'alter procedure t1' to get blocked on MDL lock... +# Waiting for 'alter procedure t1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -226,12 +226,12 @@ f1() # Sending 'drop function f1'... drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -252,12 +252,12 @@ f1() # Sending 'create function f1'... create function f1() returns int return 2; # --> connection con2 -# Waitng for 'create function f1' to get blocked on MDL lock... +# Waiting for 'create function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -279,12 +279,12 @@ f1() # Sending 'alter function f1'... alter function f1 contains sql; # --> connection con2 -# Waitng for 'alter function f1' to get blocked on MDL lock... +# Waiting for 'alter function f1' to get blocked on MDL lock... # Demonstrate that there is a pending exclusive lock. # Sending 'select f1()'... select f1(); # --> connection con3 -# Waitng for 'select f1()' to get blocked by a pending MDL lock... +# Waiting for 'select f1()' to get blocked by a pending MDL lock... # --> connection default commit; # --> connection con1 @@ -360,7 +360,7 @@ insert into t1 (a) values (1); # Sending 'drop function f1' drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -379,7 +379,7 @@ a # Sending 'drop function f1' drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -403,7 +403,7 @@ a # Sending 'drop procedure p1' drop procedure p1; # --> connection con2 -# Waitng for 'drop procedure p1' to get blocked on MDL lock... +# Waiting for 'drop procedure p1' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -424,7 +424,7 @@ insert into t1 (a) values (3); # Sending 'drop function f2' drop function f2; # --> connection con2 -# Waitng for 'drop function f2' to get blocked on MDL lock... +# Waiting for 'drop function f2' to get blocked on MDL lock... # --> connnection default commit; # --> connection con1 @@ -479,11 +479,11 @@ f2() # Sending 'drop function f1'... drop function f1; # --> connection con2 -# Waitng for 'drop function f1' to get blocked on MDL lock... +# Waiting for 'drop function f1' to get blocked on MDL lock... # Sending 'drop function f2'... drop function f2; # --> connection default -# Waitng for 'drop function f2' to get blocked on MDL lock... +# Waiting for 'drop function f2' to get blocked on MDL lock... rollback to savepoint sv; # --> connection con2 # Reaping 'drop function f2'... @@ -537,10 +537,10 @@ f1() # Sending 'alter function f1 ...'... alter function f1 comment "comment"; # --> connection con2 -# Waitng for 'alter function f1 ...' to get blocked on MDL lock... +# Waiting for 'alter function f1 ...' to get blocked on MDL lock... # Sending 'call p1()'... call p1(); -# Waitng for 'call p1()' to get blocked on MDL lock on f1... +# Waiting for 'call p1()' to get blocked on MDL lock on f1... # Let 'alter function f1 ...' go through... commit; # --> connection con1 @@ -573,7 +573,7 @@ f1() # Sending 'alter function f1 ...'... alter function f1 comment "comment"; # --> connection con2 -# Waitng for 'alter function f1 ...' to get blocked on MDL lock... +# Waiting for 'alter function f1 ...' to get blocked on MDL lock... # # We just mention p1() in the body of f2() to make # sure that p1() is prelocked for f2(). @@ -595,7 +595,7 @@ select f2() into @var; end| # Sending 'call p1()'... call p1(); -# Waitng for 'call p1()' to get blocked on MDL lock on f1... +# Waiting for 'call p1()' to get blocked on MDL lock on f1... # Let 'alter function f1 ...' go through... commit; # --> connection con1 @@ -634,7 +634,7 @@ get_lock("30977", 0) # Sending 'select f3()'... select f3(); # --> connection con1 -# Waitng for 'select f3()' to get blocked on the user level lock... +# Waiting for 'select f3()' to get blocked on the user level lock... # Do something to change the cache version. create function f4() returns int return 4; drop function f4; diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result index a14d099c673..9b458e25615 100644 --- a/mysql-test/r/sp-threads.result +++ b/mysql-test/r/sp-threads.result @@ -35,7 +35,7 @@ call bug9486(); show processlist; Id User Host db Command Time State Info # root localhost test Sleep # NULL -# root localhost test Query # Waiting for table update t1, t2 set val= 1 where id1=id2 +# root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 # root localhost test Query # NULL show processlist # root localhost test Sleep # NULL unlock tables; diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test index 6165048c7d4..87758d57725 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_row.test +++ b/mysql-test/suite/binlog/t/binlog_stm_row.test @@ -60,7 +60,7 @@ let $wait_condition= --echo # con1 let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE - state = "Table lock" and info = "INSERT INTO t2 VALUES (3)"; + state = "Waiting for table level lock" and info = "INSERT INTO t2 VALUES (3)"; --source include/wait_condition.inc SELECT RELEASE_LOCK('Bug#34306'); --connection con2 diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index 9c6bd585fde..1327338e761 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -367,14 +367,14 @@ echo ; connection default; echo -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. ; let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL AND STATE = 'Waiting for table'; + WHERE INFO IS NOT NULL AND STATE = 'Waiting for table metadata lock'; --source include/wait_condition.inc # -# Expect to see the state 'Waiting for table' for the third connection because the SELECT -# collides with the WRITE TABLE LOCK. +# Expect to see the state 'Waiting for table metadata lock' for the third +# connection because the SELECT collides with the WRITE TABLE LOCK. --replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; UNLOCK TABLES; @@ -422,10 +422,10 @@ echo ; connection default; echo -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. ; let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE INFO IS NOT NULL AND STATE = 'Waiting for table'; + WHERE INFO IS NOT NULL AND STATE = 'Waiting for table metadata lock'; --source include/wait_condition.inc echo # Expect result: diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result index 5f79fd04a90..fbc1f2d5015 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result @@ -193,11 +193,11 @@ LOCK TABLE test.t1 WRITE; SELECT COUNT(*) FROM test.t1; # ----- switch to connection default (user = root) ----- -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table SELECT COUNT(*) FROM test.t1 +<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <ID> root <HOST_NAME> information_schema Query <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST UNLOCK TABLES; @@ -221,7 +221,7 @@ LOCK TABLE test.t1 WRITE; SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1; # ----- switch to connection default (user = root) ----- -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. # Expect result: # Statement Content of INFO diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result index bb8e25c87ab..c003b5b66f6 100644 --- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result @@ -193,11 +193,11 @@ LOCK TABLE test.t1 WRITE; SELECT COUNT(*) FROM test.t1; # ----- switch to connection default (user = root) ----- -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST; ID USER HOST DB COMMAND TIME STATE INFO -<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table SELECT COUNT(*) FROM test.t1 +<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <ID> root <HOST_NAME> information_schema Execute <TIME> executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST UNLOCK TABLES; @@ -221,7 +221,7 @@ LOCK TABLE test.t1 WRITE; SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1; # ----- switch to connection default (user = root) ----- -# Poll till INFO is no more NULL and State = 'Waiting for table'. +# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'. # Expect result: # Statement Content of INFO diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test index 05df3615822..96f555e3ecc 100644 --- a/mysql-test/suite/innodb/t/innodb-lock.test +++ b/mysql-test/suite/innodb/t/innodb-lock.test @@ -87,7 +87,8 @@ connection con1; --echo # Wait until LOCK TABLE is blocked on SQL-level lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock table t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # We should be able to do UPDATEs and SELECTs within transaction. update t1 set x=1 where id = 0; diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test index a6db0d39925..915a3f2ceb6 100644 --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -28,7 +28,8 @@ ALTER TABLE t1 TRUNCATE PARTITION pMax; --echo # con default let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE STATE = "Waiting for table" AND INFO = "ALTER TABLE t1 TRUNCATE PARTITION pMax"; + WHERE STATE = "Waiting for table metadata lock" AND + INFO = "ALTER TABLE t1 TRUNCATE PARTITION pMax"; --source include/wait_condition.inc --sorted_result SELECT * FROM t1; diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result index 55256894743..2338252976c 100644 --- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -40,12 +40,12 @@ wait/synch/cond/sql/COND_flush_thread_cache YES YES wait/synch/cond/sql/COND_global_read_lock YES YES wait/synch/cond/sql/COND_manager YES YES wait/synch/cond/sql/COND_queue_state YES YES -wait/synch/cond/sql/COND_refresh YES YES wait/synch/cond/sql/COND_rpl_status YES YES wait/synch/cond/sql/COND_server_started YES YES wait/synch/cond/sql/COND_thread_cache YES YES wait/synch/cond/sql/COND_thread_count YES YES wait/synch/cond/sql/Delayed_insert::cond YES YES +wait/synch/cond/sql/Delayed_insert::cond_client YES YES select * from performance_schema.SETUP_INSTRUMENTS where name='Wait'; select * from performance_schema.SETUP_INSTRUMENTS diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result index 8c35425029e..5f3b071484d 100644 --- a/mysql-test/suite/perfschema/r/server_init.result +++ b/mysql-test/suite/perfschema/r/server_init.result @@ -182,7 +182,7 @@ count(name) select count(name) from COND_INSTANCES where name like "wait/synch/cond/sql/COND_refresh"; count(name) -1 +0 select count(name) from COND_INSTANCES where name like "wait/synch/cond/sql/COND_thread_count"; count(name) diff --git a/mysql-test/suite/rpl/t/rpl_savepoint.test b/mysql-test/suite/rpl/t/rpl_savepoint.test index c3d1f44d162..7fe8a0da651 100644 --- a/mysql-test/suite/rpl/t/rpl_savepoint.test +++ b/mysql-test/suite/rpl/t/rpl_savepoint.test @@ -30,7 +30,7 @@ connection master1; connection master; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" AND info = "DROP TABLE tt"; + WHERE state = "Waiting for table metadata lock" AND info = "DROP TABLE tt"; --source include/wait_condition.inc ROLLBACK TO SAVEPOINT insert_statement; COMMIT; diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test index 8510f387111..b2e7418ce14 100644 --- a/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-test/suite/rpl/t/rpl_sp.test @@ -655,7 +655,8 @@ connection master; connection master1; --echo # Waitng for 'insert into t1 ...' to get blocked on table lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='insert into t1 (a) values (f1())'; +where state='Waiting for table metadata lock' and + info='insert into t1 (a) values (f1())'; --source include/wait_condition.inc --echo # Sending 'drop function f1'. It will wait till insert finishes. --send drop function f1; @@ -663,7 +664,7 @@ where state='Waiting for table' and info='insert into t1 (a) values (f1())'; connection default; --echo # Check that 'drop function f1' gets blocked. let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f1'; +where state='Waiting for stored function metadata lock' and info='drop function f1'; --source include/wait_condition.inc --echo # Now let's let 'insert' go through... unlock tables; diff --git a/mysql-test/suite/rpl/t/rpl_view_multi.test b/mysql-test/suite/rpl/t/rpl_view_multi.test index 852d1d8d20c..5b3e7cf76f8 100644 --- a/mysql-test/suite/rpl/t/rpl_view_multi.test +++ b/mysql-test/suite/rpl/t/rpl_view_multi.test @@ -56,7 +56,7 @@ let $wait_condition= connection master; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "drop view v1"; + where state = "Waiting for table metadata lock" and info = "drop view v1"; --source include/wait_condition.inc select release_lock("lock_bg25144"); @@ -106,7 +106,7 @@ let $wait_condition= connection master; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter view v1 as select * from t2"; --source include/wait_condition.inc diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 8eda2f18958..3dca5048213 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -10,8 +10,6 @@ # ############################################################################## -rpl_ndb_stm_innodb : Bug#54850 2010-07-02 alik rpl_ndb.rpl_ndb_stm_innodb and rpl_ndb.rpl_ndb_2other fails -rpl_ndb_2other : Bug#54850 2010-07-02 alik rpl_ndb.rpl_ndb_stm_innodb and rpl_ndb.rpl_ndb_2other fails rpl_ndb_row_implicit_commit_binlog : Bug#55849 2010-08-09 alik rpl_ndb.rpl_ndb_row_implicit_commit_binlog fails # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt index dff423702b4..378a377e053 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt @@ -1 +1 @@ ---innodb --loose-ndbcluster=OFF --log-slave-updates=0 +--innodb --loose-ndbcluster=OFF --log-slave-updates=0 --default-storage-engine=MyISAM diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt new file mode 100644 index 00000000000..96f0ce3f36c --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt @@ -0,0 +1 @@ +--default-storage-engine=MyISAM diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result index 0b5b342e134..56e83d98872 100644 --- a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result +++ b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result @@ -37,9 +37,9 @@ INSERT INTO t1(name) VALUES('Record_7'); connection default; ## show processlist info and state ## SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST -WHERE state= "Table lock" AND info LIKE "INSERT INTO t1%"; +WHERE state= "Waiting for table level lock" AND info LIKE "INSERT INTO t1%"; state info -Table lock INSERT INTO t1(name) VALUES('Record_7') +Waiting for table level lock INSERT INTO t1(name) VALUES('Record_7') ## table contents befor UNLOCK ## SELECT * FROM t1; name diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result index abb8fdcd2a0..6b90b61a035 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result +++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result @@ -11,7 +11,6 @@ CREATE TABLE t1(id int, value varchar(10)); INSERT INTO t1 VALUES(1, 'val1'); INSERT INTO t1 VALUES(2, 'val2'); INSERT INTO t1 VALUES(3, 'val3'); -CREATE VIEW v1 AS SELECT * FROM t1; SET GLOBAL query_cache_size = 131072; FLUSHING CACHE SET GLOBAL query_cache_size = 0; @@ -33,11 +32,11 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 1 1 Expected -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; UNLOCK TABLES; SHOW STATUS LIKE 'Qcache_queries_in_cache'; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 0 0 Expected '#----------------------------FN_DYNVARS_136_02-----------------------#' SELECT * FROM t1; @@ -49,13 +48,12 @@ id value 2 val2 3 val3 ** Connection con0 ** -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; ** Connection con1 ** ** Asynchronous Execution ** SELECT * FROM t1; ** Connection con0 ** wait until table is locked -Timeout in wait_condition.inc for SELECT count(*) > 0 FROM information_schema.processlist WHERE state= 'Table lock' UNLOCK TABLES; ** Connection con1 ** ** Asynchronous Result ** @@ -79,7 +77,7 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache'; Variable_name Value Qcache_queries_in_cache 1 1 Expected -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; UNLOCK TABLES; SHOW STATUS LIKE 'Qcache_queries_in_cache'; Variable_name Value @@ -102,7 +100,7 @@ id value 2 val2 3 val3 ** Connection con0 ** -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; ** Connection con1 ** ** Should not be blocked ** SELECT * FROM t1; @@ -165,4 +163,3 @@ SET @@GLOBAL.query_cache_type = @old_cache_type; ** Connection default ** Disconnecting Connections con0, con1 DROP TABLE t1; -DROP VIEW v1; diff --git a/mysql-test/suite/sys_vars/t/concurrent_insert_func.test b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test index 018247df3ff..b97c926e6b5 100644 --- a/mysql-test/suite/sys_vars/t/concurrent_insert_func.test +++ b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test @@ -98,12 +98,13 @@ INSERT INTO t1(name) VALUES('Record_7'); connection default; # wait until INSERT will be locked (low performance) let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE state= "Table lock" AND info LIKE "INSERT INTO t1%"; + WHERE state= "Waiting for table level lock" AND + info LIKE "INSERT INTO t1%"; --source include/wait_condition.inc --echo ## show processlist info and state ## SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST -WHERE state= "Table lock" AND info LIKE "INSERT INTO t1%"; +WHERE state= "Waiting for table level lock" AND info LIKE "INSERT INTO t1%"; --echo ## table contents befor UNLOCK ## SELECT * FROM t1; UNLOCK TABLES; diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test index 60092dbb8e8..427f2730e47 100644 --- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test @@ -123,7 +123,7 @@ connection default; --echo ** Wait till con0 is blocked ** let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = 'Table lock' AND info = '$my_select'; + WHERE state = 'Waiting for table level lock' AND info = '$my_select'; --source include/wait_condition.inc UNLOCK TABLES; @@ -219,7 +219,7 @@ connection default; --echo ** Wait till con0 is blocked ** let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = 'Table lock' AND info = '$my_select'; + WHERE state = 'Waiting for table level lock' AND info = '$my_select'; --source include/wait_condition.inc UNLOCK TABLES; diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test index a72d73105a6..e7486614ec7 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test +++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test @@ -60,8 +60,6 @@ INSERT INTO t1 VALUES(1, 'val1'); INSERT INTO t1 VALUES(2, 'val2'); INSERT INTO t1 VALUES(3, 'val3'); -CREATE VIEW v1 AS SELECT * FROM t1; - # # Clearing the query cache and setting up cache size # @@ -101,7 +99,7 @@ SELECT * FROM t1; SHOW STATUS LIKE 'Qcache_queries_in_cache'; --echo 1 Expected -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; UNLOCK TABLES; @@ -129,7 +127,7 @@ SELECT * FROM t1; --echo ** Connection con0 ** connection con0; -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; --echo ** Connection con1 ** connection con1; @@ -141,7 +139,8 @@ send SELECT * FROM t1; connection con0; --echo wait until table is locked -let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state= 'Table lock'; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist + WHERE state= 'Waiting for table metadata lock'; --source include/wait_condition.inc UNLOCK TABLES; @@ -177,7 +176,7 @@ SELECT * FROM t1; SHOW STATUS LIKE 'Qcache_queries_in_cache'; --echo 1 Expected -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; UNLOCK TABLES; @@ -201,7 +200,7 @@ SELECT * FROM t1; --echo ** Connection con0 ** connection con0; -LOCK TABLE v1 WRITE; +LOCK TABLE t1 WRITE; --echo ** Connection con1 ** connection con1; @@ -283,7 +282,6 @@ disconnect con0; disconnect con1; DROP TABLE t1; -DROP VIEW v1; --enable_ps_protocol diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test index 03f56f1fe16..ba13558a135 100644 --- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test +++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test @@ -86,7 +86,9 @@ delimiter ;| --echo ** Connection con0 ** connection con0; -let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state='Table lock' AND info LIKE 'UPDATE t1 SET a = CONCAT(a,"-updated")'; +let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist + WHERE state='Waiting for table level lock' AND + info LIKE 'UPDATE t1 SET a = CONCAT(a,"-updated")'; --source include/wait_condition.inc --echo ** Asynchronous Execution ** @@ -102,7 +104,8 @@ delimiter ;| --echo ** Connection default ** connection default; -let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist WHERE state LIKE 'Table lock'; +let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist + WHERE state LIKE 'Waiting for table level lock'; --source include/wait_condition.inc UNLOCK TABLES; @@ -157,7 +160,9 @@ delimiter ;| --echo ** Connection con0 ** connection con0; -let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state='Table lock' AND info LIKE 'UPDATE t1 SET a = CONCAT(a,"-updated")'; +let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist + WHERE state='Waiting for table level lock' AND + info LIKE 'UPDATE t1 SET a = CONCAT(a,"-updated")'; --source include/wait_condition.inc --echo ** Asynchronous Execution ** @@ -173,7 +178,8 @@ delimiter ;| --echo ** Connection default ** connection default; -let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist WHERE state LIKE 'Table lock'; +let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist + WHERE state LIKE 'Waiting for table level lock'; --source include/wait_condition.inc UNLOCK TABLES; diff --git a/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test index d4acc961752..6d4ca3e2b4d 100644 --- a/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test +++ b/mysql-test/suite/sys_vars/t/thread_concurrency_basic.test @@ -1,4 +1,3 @@ ---source include/have_thread_concurrency.inc # # only global # diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 142f1b241d6..2bf0d5d2633 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -307,7 +307,7 @@ connection update; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where command = "Delayed insert" and state = "Table lock"; + where command = "Delayed insert" and state = "Waiting for table level lock"; --source include/wait_condition.inc connect (select,localhost,root,,); --echo connection: select diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index e2e1d76ef65..c80532a4295 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -19,3 +19,4 @@ plugin_load : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5 plugin_not_embedded : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5 query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution +ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06 diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test index a94b75bb812..4cf2583ac96 100644 --- a/mysql-test/t/events_trans.test +++ b/mysql-test/t/events_trans.test @@ -121,3 +121,28 @@ let $wait_condition= drop database events_test; + +--echo # +--echo # Bug#54105 assert in MDL_context::release_locks_stored_before +--echo # + +USE test; + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +DROP EVENT IF EXISTS e1; +--enable_warnings + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT); +CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1; + +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SAVEPOINT A; +--replace_regex /STARTS '[^']+'/STARTS '#'/ +SHOW CREATE EVENT e1; +SELECT * FROM t2; +ROLLBACK WORK TO SAVEPOINT A; + +DROP TABLE t1, t2; diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 0d406338394..d4c3533847d 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -318,6 +318,58 @@ insert into t2 (a) values (3); --echo # --> connection default; connection default; unlock tables; +--echo # +--echo # Check that "FLUSH TABLES <list> WITH READ LOCK" is +--echo # compatible with active "FLUSH TABLES WITH READ LOCK". +--echo # Vice versa it is not true, since tables read-locked by +--echo # "FLUSH TABLES <list> WITH READ LOCK" can't be flushed. +flush tables with read lock; +--echo # --> connection con1; +connection con1; +flush table t1 with read lock; +select * from t1; +unlock tables; +--echo # --> connection default; +connection default; +unlock tables; +--echo # +--echo # Check that FLUSH TABLES t1 WITH READ LOCK +--echo # does not conflict with an existing FLUSH TABLES t2 +--echo # WITH READ LOCK. +--echo # +flush table t1 with read lock; +--echo # --> connection con1 +connection con1; +flush table t2 with read lock; +unlock tables; +--echo # --> connection default +connection default; +unlock tables; +--echo # +--echo # Check that FLUSH TABLES t1 WITH READ LOCK +--echo # does not conflict with SET GLOBAL read_only=1. +--echo # +set global read_only=1; +--echo # connection con1 +connection con1; +flush table t1 with read lock; +unlock tables; +--echo # connection default +connection default; +set global read_only=0; +--echo # +--echo # Check that it's possible to read-lock +--echo # tables locked with FLUSH TABLE <list> WITH READ LOCK. +--echo # +flush tables t1, t2 with read lock; +--echo # connection con1 +connection con1; +lock table t1 read, t2 read; +unlock tables; +--echo # connection default +connection default; +unlock tables; + --echo # --> connection con1 connection con1; disconnect con1; @@ -355,3 +407,142 @@ drop temporary table v1; unlock tables; drop view v2, v3; drop table t1, v1; + + +--echo # +--echo # FLUSH TABLES <list> WITH READ LOCK and HANDLER +--echo # +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int, key a (a)); +insert into t1 (a) values (1), (2), (3); +handler t1 open; +handler t1 read a next; +handler t1 read a next; +flush tables t1 with read lock; +--error ER_LOCK_OR_ACTIVE_TRANSACTION +handler t1 read a next; +unlock tables; +--echo # +--echo # Sic: lost handler position. +--echo # +handler t1 read a next; +handler t1 close; +drop table t1; + +--echo # +--echo # Bug#52117 Pending FLUSH TALBES <list> aborts +--echo # transactions unnecessarily. +--echo # +--disable_warnings +drop table if exists t1; +--enable_warnings +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +--echo # --> conection default +connection default; + +create table t1 (a int); +begin; +select * from t1; +--echo # --> connection con1 +connection con1; +--echo # +--echo # Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN +--echo # or a long-running select -- anything that +--echo # prevents FLUSH TABLE t1 from immediate completion would do. +--echo # +lock table t1 read; +--echo # --> connection con2 +connection con2; +--echo # +--echo # FLUSH TABLE expels the table definition from the cache. +--echo # Sending 'flush table t1'... +send flush table t1; +--echo # --> connection default +connection default; +--echo # Let flush table sync in. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" + and info = "flush table t1"; +--source include/wait_condition.inc +send select * from t1; +--echo # --> connection con1 +connection con1; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" + and info = "select * from t1"; +select * from t1; +unlock tables; +--echo # --> connection con2 +connection con2; +--echo # Reaping 'flush table t1'... +reap; +--echo # --> connection default +connection default; +--echo # Reaping 'select * from t1'... +reap; +commit; + +--echo # +--echo # Repeat the same test but with FLUSH TABLES +--echo # + +begin; +select * from t1; +--echo # --> connection con1 +connection con1; +--echo # +--echo # Issue a LOCK TABLE t1 READ. +--echo # +lock table t1 read; +--echo # --> connection con2 +connection con2; +--echo # +--echo # FLUSH TABLES expels the table definition from the cache. +--echo # Sending 'flush tables'... +send flush tables; +--echo # --> connection default +connection default; +--echo # Let flush table sync in. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" + and info = "flush tables"; +--source include/wait_condition.inc +send select * from t1; +--echo # --> connection con1 +connection con1; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" + and info = "select * from t1"; +select * from t1; +unlock tables; +--echo # --> connection con2 +connection con2; +--echo # Reaping 'flush tables'... +reap; +--echo # --> connection default +connection default; +--echo # Reaping 'select * from t1'... +reap; +commit; + +--echo # Cleanup + +--echo # --> connection con1 +connection con1; +disconnect con1; +--source include/wait_until_disconnected.inc +--echo # --> connection con2 +connection con2; +disconnect con2; +--source include/wait_until_disconnected.inc +--echo # --> connection default +connection default; +drop table t1; + diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 87022d65fcc..f5fab966bdd 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1470,7 +1470,8 @@ connection con3726_2; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info like "rename table t2 to t3"; + where state = "Waiting for table metadata lock" and + info like "rename table t2 to t3"; --source include/wait_condition.inc --echo # These statements should not be blocked by pending lock requests select table_name, column_name, data_type from information_schema.columns diff --git a/mysql-test/t/information_schema_inno.test b/mysql-test/t/information_schema_inno.test index 1a537d740b7..657d0effd7e 100644 --- a/mysql-test/t/information_schema_inno.test +++ b/mysql-test/t/information_schema_inno.test @@ -89,3 +89,23 @@ from information_schema.referential_constraints where constraint_schema = schema(); drop table t2; set foreign_key_checks = 1; + + +--echo # +--echo # Bug#55973 Assertion `thd->transaction.stmt.is_empty()' +--echo # on CREATE TABLE .. SELECT I_S.PART +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +--enable_warnings + +CREATE VIEW v1 AS SELECT 1; +# This used to case an assert. +CREATE TABLE t1 engine = InnoDB AS + SELECT * FROM information_schema.partitions + WHERE table_schema= 'test' AND table_name= 'v1'; + +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index c8ece729b19..975444a44b1 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -42,7 +42,7 @@ let $wait_condition= let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info = "DROP TABLE t1" and - state = "Waiting for table"; + state = "Waiting for table metadata lock"; --source include/wait_condition.inc --echo # Connection 1 is now holding the lock. --echo # Issuing insert from connection 1 while connection 2&3 @@ -97,7 +97,8 @@ connection default; --echo # connection holds SW metadata lock on table to be altered. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c4 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c4 int"; --source include/wait_condition.inc --echo # The below statement should succeed. It should not @@ -196,7 +197,7 @@ connection default; --echo # Connection con1 connection con1; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='OPTIMIZE TABLE t1'; + WHERE state='Waiting for table metadata lock' AND info='OPTIMIZE TABLE t1'; --source include/wait_condition.inc SELECT * FROM t1; COMMIT; @@ -241,7 +242,7 @@ connection con2; --echo # Waiting for 'SELECT * FROM v1' to sync in. let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" AND info = "SELECT * FROM v1"; + WHERE state = "Waiting for table metadata lock" AND info = "SELECT * FROM v1"; --source include/wait_condition.inc # This should block due to v1 being locked. --echo # Sending: @@ -252,7 +253,8 @@ connection con3; --echo # Waiting for 'ALTER VIEW v1 AS SELECT 2 FROM t2' to sync in. let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" AND info = "ALTER VIEW v1 AS SELECT 2 FROM t2"; + WHERE state = "Waiting for table metadata lock" AND + info = "ALTER VIEW v1 AS SELECT 2 FROM t2"; --source include/wait_condition.inc # Unlock t1 allowing SELECT * FROM v1 to proceed. UNLOCK TABLES; diff --git a/mysql-test/t/innodb_mysql_lock2.test b/mysql-test/t/innodb_mysql_lock2.test index 4ad30b9f25b..b7259e771ae 100644 --- a/mysql-test/t/innodb_mysql_lock2.test +++ b/mysql-test/t/innodb_mysql_lock2.test @@ -799,8 +799,9 @@ connection default; --echo # table as it acquires LOCK_S locks on rows of old version, which --echo # are compatible with locks acquired by connection 'con1'. let $wait_condition= - select count(*) = 1 from information_schema.processlist where state = - "Waiting for table" and info = "alter table t1 add column j int"; + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column j int"; --source include/wait_condition.inc --echo # The below statement will deadlock because it will try to acquire @@ -844,7 +845,8 @@ connection default; --echo # Wait until ALTER is blocked because of active SR lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 rebuild partition p0"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 rebuild partition p0"; --source include/wait_condition.inc --echo # The below statement should succeed as transaction diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test index 510dc56e8f7..4e5fe6f6755 100644 --- a/mysql-test/t/insert_notembedded.test +++ b/mysql-test/t/insert_notembedded.test @@ -174,7 +174,7 @@ 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 = "Table lock" and id = $ID; + where state = "Waiting for table level lock" and id = $ID; --source include/wait_condition.inc connect (select,localhost,root,,); --echo connection: select diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index b91feb3a1d5..706c2514d92 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -357,7 +357,8 @@ let $ID= `select connection_id()`; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --replace_result $ID ID eval kill query $ID; @@ -372,7 +373,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "drop table t1"; --source include/wait_condition.inc --replace_result $ID ID @@ -388,7 +389,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "create trigger t1_bi before insert on t1 for each row set @a:=1"; --source include/wait_condition.inc --replace_result $ID ID @@ -407,7 +408,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter table t1 add column j int"; --source include/wait_condition.inc --replace_result $ID ID @@ -423,7 +424,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter table t1 rename to t2"; --source include/wait_condition.inc --replace_result $ID ID @@ -437,7 +438,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter table t1 disable keys"; --source include/wait_condition.inc --replace_result $ID ID @@ -452,7 +453,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter table t1 alter column i set default 100"; --source include/wait_condition.inc --replace_result $ID ID @@ -474,7 +475,7 @@ connection ddl; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "alter table t2 alter column i set default 100"; --source include/wait_condition.inc --replace_result $ID ID @@ -499,7 +500,7 @@ connection ddl; connection dml; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "rename tables t1 to t3, t2 to t1"; --source include/wait_condition.inc let $ID2= `select connection_id()`; @@ -508,7 +509,7 @@ let $ID2= `select connection_id()`; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info = "insert into t2 values (1)"; --source include/wait_condition.inc --replace_result $ID2 ID2 @@ -536,7 +537,7 @@ connection ddl; connection dml; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Flushing tables" and + where state = "Waiting for table flush" and info = "flush tables"; --source include/wait_condition.inc --send select * from t1 @@ -544,7 +545,7 @@ let $wait_condition= connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table flush" and info = "select * from t1"; --source include/wait_condition.inc --replace_result $ID2 ID2 diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 6983947d1c4..6bdb235903d 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -32,7 +32,8 @@ connection reader; # Sleep a bit till the update of connection writer is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "update low_priority t1 set n = 4"; + where state = "Waiting for table level lock" and + info = "update low_priority t1 set n = 4"; --source include/wait_condition.inc send select n from t1; @@ -40,7 +41,8 @@ connection locker2; # Sleep a bit till the select of connection reader is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "select n from t1"; + where state = "Waiting for table level lock" and + info = "select n from t1"; --source include/wait_condition.inc select release_lock("mysqltest_lock"); connection locker; @@ -72,7 +74,8 @@ connection reader; # Sleep a bit till the update of connection writer is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "update low_priority t1 set n = 4"; + where state = "Waiting for table level lock" and + info = "update low_priority t1 set n = 4"; --source include/wait_condition.inc select n from t1; connection locker2; @@ -120,7 +123,8 @@ insert t1 select * from t2; connection locker; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "insert t1 select * from t2"; + where state = "Waiting for table metadata lock" and + info = "insert t1 select * from t2"; --source include/wait_condition.inc drop table t2; unlock tables; @@ -145,7 +149,8 @@ connection locker; # Sleep a bit till the insert of connection reader is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "insert t1 select * from t2"; + where state = "Waiting for table metadata lock" and + info = "insert t1 select * from t2"; --source include/wait_condition.inc drop table t2; unlock tables; @@ -191,7 +196,7 @@ connection locker; # Sleep a bit till the select of connection reader is in work and hangs let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" AND info = + WHERE state = "Waiting for table metadata lock" AND info = "SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1"; --source include/wait_condition.inc # Make test case independent from earlier grants. @@ -223,7 +228,8 @@ connection writer; # Sleep a bit till the flush of connection locker is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "FLUSH TABLES WITH READ LOCK"; + where state = "Waiting for global metadata lock" and + info = "FLUSH TABLES WITH READ LOCK"; --source include/wait_condition.inc # This must not block. --error ER_TABLE_NOT_LOCKED @@ -254,7 +260,8 @@ connection writer; # Sleep a bit till the flush of connection locker is in work and hangs let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "FLUSH TABLES WITH READ LOCK"; + where state = "Waiting for global metadata lock" and + info = "FLUSH TABLES WITH READ LOCK"; --source include/wait_condition.inc --error ER_TABLE_NOT_LOCKED CREATE TABLE t2 AS SELECT * FROM t1; @@ -326,7 +333,8 @@ connection reader; # Wait till connection writer is blocked let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 auto_increment=0"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 auto_increment=0"; --source include/wait_condition.inc send alter table t1 auto_increment=0; @@ -334,7 +342,8 @@ connection locker; # Wait till connection reader is blocked let $wait_condition= select count(*) = 2 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 auto_increment=0"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 auto_increment=0"; --source include/wait_condition.inc unlock tables; connection writer; @@ -367,7 +376,8 @@ connection con5; --echo # con5 let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "flush tables with read lock"; + where state = "Waiting for global metadata lock" and + info = "flush tables with read lock"; --source include/wait_condition.inc --echo # global read lock is taken connection con3; @@ -489,16 +499,20 @@ update t1 set i= 10; connection reader; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "update t1 set i= 10"; + where state = "Waiting for table level lock" and + info = "update t1 set i= 10"; --source include/wait_condition.inc send select * from t1; connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "select * from t1"; + where state = "Waiting for table level lock" and + info = "select * from t1"; --source include/wait_condition.inc -let $ID= `select id from information_schema.processlist where state = "Table lock" and info = "update t1 set i= 10"`; +let $ID= `select id from information_schema.processlist + where state = "Waiting for table level lock" and + info = "update t1 set i= 10"`; --replace_result $ID ID eval kill query $ID; connection reader; @@ -557,7 +571,7 @@ connection default; --echo connection: default let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc alter table t1 add column j int; connect (insert,localhost,root,,test,,); @@ -565,7 +579,7 @@ connection insert; --echo connection: insert let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc --send insert into t1 values (1,2); --echo connection: default @@ -615,12 +629,12 @@ connection default; --echo connection: default let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc flush tables; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc unlock tables; connection flush; @@ -646,7 +660,8 @@ send insert into t1 values(1); connection default; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "insert into t1 values(1)"; + where state = "Waiting for table level lock" and + info = "insert into t1 values(1)"; --source include/wait_condition.inc let $tlwb= `show status like 'Table_locks_waited'`; unlock tables; @@ -683,12 +698,12 @@ connection default; --echo connection: default let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc flush tables; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc drop table t1; connection flush; @@ -725,7 +740,8 @@ connection default; --echo # connection holds SW metadata lock on table to be altered. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c4 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c4 int"; --source include/wait_condition.inc --echo # The below statement should succeed. It should not @@ -825,7 +841,8 @@ connection default; --echo # Wait until ALTER TABLE gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column j int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column j int"; --source include/wait_condition.inc --echo # The below statement should try to acquire SW lock on 't1' --echo # and therefore should get ER_LOCK_DEADLOCK error. Before @@ -855,7 +872,8 @@ connection default; --echo # Wait until ALTER TABLE gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 drop column j"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 drop column j"; --source include/wait_condition.inc --echo # The below statement should try to acquire SW lock on 't1' --echo # and therefore should get ER_LOCK_DEADLOCK error. Before @@ -982,7 +1000,7 @@ connection con3; connection con2; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Flushing tables" AND info = "FLUSH TABLES"; + WHERE state = "Waiting for table flush" AND info = "FLUSH TABLES"; --source include/wait_condition.inc --error ER_LOCK_WAIT_TIMEOUT SELECT * FROM t1; @@ -1014,7 +1032,8 @@ connection con3; connection con2; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" AND info = "DROP TABLE t1, t2"; + WHERE state = "Waiting for table metadata lock" AND + info = "DROP TABLE t1, t2"; --source include/wait_condition.inc # Note: This query causes two timeouts. # 1: try_acquire_high_prio_shared_mdl_lock on t1 @@ -1069,7 +1088,8 @@ connection default; --echo # Wait until RENAME TABLE is blocked on table 't3'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename tables t1 to t2, t2 to t3"; + where state = "Waiting for table metadata lock" and + info = "rename tables t1 to t2, t2 to t3"; --source include/wait_condition.inc --echo # Kill RENAME TABLE. --replace_result $ID ID diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test index 2f35da9d1ee..49f8f59ec5a 100644 --- a/mysql-test/t/lock_sync.test +++ b/mysql-test/t/lock_sync.test @@ -898,7 +898,7 @@ set debug_sync= 'now WAIT_FOR parked'; connection default; --echo # Wait until this LOCK TABLES statement starts waiting for table lock. let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Table lock' and + where state= 'Waiting for table level lock' and info='lock table v1 write'; --source include/wait_condition.inc --echo # Allow SELECT ... FOR UPDATE to resume. @@ -972,7 +972,7 @@ connection default; connection con2; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Waiting for table" + WHERE state = "Waiting for table metadata lock" AND info = "ALTER TABLE t1 ADD COLUMN j INT"; --source include/wait_condition.inc diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test index 6b721ace07f..55c04d7870b 100644 --- a/mysql-test/t/mdl_sync.test +++ b/mysql-test/t/mdl_sync.test @@ -128,7 +128,8 @@ connection mdl_con2; --echo # Check that the above RENAME is blocked because of S lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -158,7 +159,8 @@ connection mdl_con2; --echo # Check that the above ALTER TABLE is blocked because of S lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c2 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -190,7 +192,8 @@ connection mdl_con2; --echo # because of S lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c2 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -245,7 +248,8 @@ connection mdl_con2; --echo # Check that the above RENAME is blocked because of SH lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. set debug_sync= 'now SIGNAL finish'; @@ -280,7 +284,8 @@ connection mdl_con2; --echo # Check that the above ALTER TABLE is blocked because of SH lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c2 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. set debug_sync= 'now SIGNAL finish'; @@ -316,7 +321,8 @@ connection mdl_con2; --echo # because of S lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c2 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. set debug_sync= 'now SIGNAL finish'; @@ -367,7 +373,8 @@ connection default; --echo # Check that the above LOCK TABLES is blocked because of SR lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock table t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Unblock LOCK TABLES. commit; @@ -395,7 +402,8 @@ connection mdl_con2; --echo # Check that the above RENAME is blocked because of SR lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -426,7 +434,8 @@ connection mdl_con2; --echo # Check that the above ALTER TABLE is blocked because of SR lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column c2 int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -479,7 +488,8 @@ connection default; --echo # Check that the above ALTER TABLE is blocked because of SW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. commit; @@ -506,7 +516,8 @@ connection default; --echo # Check that the above LOCK TABLES is blocked because of SW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock table t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Unblock LOCK TABLES. commit; @@ -534,7 +545,8 @@ connection mdl_con2; --echo # Check that the above RENAME is blocked because of SW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -583,7 +595,8 @@ connection mdl_con2; --echo # Check that the above DELETE is blocked because of SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "delete from t1 limit 2"; + where state = "Waiting for table metadata lock" and + info = "delete from t1 limit 2"; --source include/wait_condition.inc --echo # Unblock ALTER and thus DELETE. set debug_sync= 'now SIGNAL finish'; @@ -617,7 +630,8 @@ connection mdl_con2; --echo # Check that the above ALTER is blocked because of SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Unblock ALTERs. set debug_sync= 'now SIGNAL finish'; @@ -652,7 +666,8 @@ connection mdl_con2; --echo # Check that the above LOCK TABLES is blocked because of SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock table t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Unblock ALTER and thus LOCK TABLES. set debug_sync= 'now SIGNAL finish'; @@ -688,7 +703,8 @@ connection mdl_con2; --echo # Check that the above RENAME is blocked because of SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Unblock ALTER and thus RENAME TABLE. set debug_sync= 'now SIGNAL finish'; @@ -735,7 +751,8 @@ connection default; --echo # Check that the above SELECT is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "select count(*) from t1"; + where state = "Waiting for table metadata lock" and + info = "select count(*) from t1"; --source include/wait_condition.inc --echo # Unblock SELECT. unlock tables; @@ -760,7 +777,8 @@ connection default; --echo # Check that the above DELETE is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "delete from t1 limit 1"; + where state = "Waiting for table metadata lock" and + info = "delete from t1 limit 1"; --source include/wait_condition.inc --echo # Unblock DELETE. unlock tables; @@ -785,7 +803,8 @@ connection default; --echo # Check that the above ALTER is blocked because of UNWR lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Unblock ALTER. unlock tables; @@ -811,7 +830,8 @@ connection default; --echo # Check that the above LOCK TABLES is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock table t1 write"; + where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Unblock waiting LOCK TABLES. unlock tables; @@ -838,7 +858,8 @@ connection default; --echo # Check that the above RENAME is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -879,7 +900,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that S lock in incompatible with X lock. --echo # Sending: @@ -890,7 +912,8 @@ connection mdl_con2; --echo # Check that the above HANDLER statement is blocked because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "handler t1 open"; +where state = "Waiting for table metadata lock" and + info = "handler t1 open"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -922,7 +945,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SH lock in incompatible with X lock. --echo # Sending: @@ -934,7 +958,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info like "select column_name from information_schema.columns%"; +where state = "Waiting for table metadata lock" and + info like "select column_name from information_schema.columns%"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -965,7 +990,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SR lock in incompatible with X lock. --echo # Sending: @@ -977,7 +1003,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t1"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t1"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -1008,7 +1035,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SW lock in incompatible with X lock. --echo # Sending: @@ -1020,7 +1048,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "delete from t1 limit 1"; +where state = "Waiting for table metadata lock" and + info = "delete from t1 limit 1"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -1051,7 +1080,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SNW lock is incompatible with X lock. --echo # Sending: @@ -1063,7 +1093,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; +where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -1095,7 +1126,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SNRW lock is incompatible with X lock. --echo # Sending: @@ -1107,7 +1139,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -1139,7 +1172,8 @@ connection mdl_con1; --echo # Check that RENAME has acquired X lock on t1 and is waiting for t2. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that X lock is incompatible with X lock. --echo # Sending: @@ -1151,7 +1185,8 @@ connection mdl_con2; --echo # because of X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t3"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t3"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE unlock tables; @@ -1195,7 +1230,8 @@ connection mdl_con1; --echo # Check that ALTER TABLE is waiting with pending SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; +where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Check that S, SH and SR locks are compatible with pending SNW handler t1 open t; @@ -1212,7 +1248,8 @@ connection mdl_con2; --echo # Check that the above DELETE is blocked because of pending SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "delete from t1 limit 1"; +where state = "Waiting for table metadata lock" and + info = "delete from t1 limit 1"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. commit; @@ -1252,7 +1289,8 @@ connection mdl_con1; --echo # Check that LOCK TABLE is waiting with pending SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that S and SH locks are compatible with pending SNRW handler t1 open t; @@ -1268,7 +1306,8 @@ connection mdl_con2; --echo # Check that the above SELECT is blocked because of pending SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t1"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t1"; --source include/wait_condition.inc --echo # Unblock LOCK TABLE. commit; @@ -1300,7 +1339,8 @@ connection mdl_con1; --echo # Check that LOCK TABLE is waiting with pending SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that SW is incompatible with pending SNRW --echo # Sending: @@ -1311,7 +1351,8 @@ connection mdl_con2; --echo # Check that the above INSERT is blocked because of pending SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "insert into t1 values (1)"; +where state = "Waiting for table metadata lock" and + info = "insert into t1 values (1)"; --source include/wait_condition.inc --echo # Unblock LOCK TABLE. commit; @@ -1343,7 +1384,8 @@ connection mdl_con1; --echo # Check that LOCK TABLE is waiting with pending SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that SNW is compatible with pending SNRW --echo # So ALTER TABLE statements are not starved by LOCK TABLEs. @@ -1385,7 +1427,8 @@ connection mdl_con1; --echo # Check that RENAME TABLE is waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SH locks are compatible with pending X select column_name from information_schema.columns where @@ -1399,7 +1442,8 @@ connection mdl_con2; --echo # Check that the above HANDLER OPEN is blocked because of pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "handler t1 open"; +where state = "Waiting for table metadata lock" and + info = "handler t1 open"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -1433,7 +1477,8 @@ connection mdl_con1; --echo # Check that RENAME TABLE is waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SR is incompatible with pending X --echo # Sending: @@ -1444,7 +1489,8 @@ connection mdl_con2; --echo # Check that the above SELECT is blocked because of pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t1"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t1"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -1477,7 +1523,8 @@ connection mdl_con1; --echo # Check that RENAME TABLE is waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SW is incompatible with pending X --echo # Sending: @@ -1488,7 +1535,8 @@ connection mdl_con2; --echo # Check that the above DELETE is blocked because of pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "delete from t1 limit 1"; +where state = "Waiting for table metadata lock" and + info = "delete from t1 limit 1"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -1521,7 +1569,8 @@ connection mdl_con1; --echo # Check that RENAME TABLE is waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SNW is incompatible with pending X --echo # Sending: @@ -1532,7 +1581,8 @@ connection mdl_con2; --echo # Check that the above ALTER TABLE is blocked because of pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; +where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -1565,7 +1615,8 @@ connection mdl_con1; --echo # Check that RENAME TABLE is waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that SNRW is incompatible with pending X --echo # Sending: @@ -1576,7 +1627,8 @@ connection mdl_con3; --echo # Check that the above LOCK TABLES is blocked because of pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'mdl_con2'. @@ -1642,7 +1694,8 @@ connection mdl_con2; --echo # Check that the above INSERT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "insert into t2 values (1)"; +where state = "Waiting for table metadata lock" and + info = "insert into t2 values (1)"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE and thus INSERT. set debug_sync= 'now SIGNAL finish'; @@ -1691,7 +1744,8 @@ connection mdl_con2; --echo # Check that the above INSERT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "insert into t1 values (1)"; +where state = "Waiting for table metadata lock" and + info = "insert into t1 values (1)"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE and thus INSERT. set debug_sync= 'now SIGNAL finish'; @@ -1726,7 +1780,8 @@ connection default; --echo # Wait until ALTER TABLE starts waiting for SNW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t1 add primary key (c1)"; +where state = "Waiting for table metadata lock" and + info = "alter table t1 add primary key (c1)"; --source include/wait_condition.inc --echo # We should still be able to get both SW and SR locks without waiting. select count(*) from t1; @@ -1769,7 +1824,8 @@ connection default; --echo # Wait until ALTER TABLE starts waiting X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t2 add column c2 int"; +where state = "Waiting for table metadata lock" and + info = "alter table t2 add column c2 int"; --source include/wait_condition.inc --echo # Check that attempt to acquire SR lock on t2 causes waiting. --echo # Sending: @@ -1780,7 +1836,8 @@ connection mdl_con2; --echo # Check that the above SELECT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t2"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t2"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. commit; @@ -1817,7 +1874,8 @@ connection default; --echo # Wait until ALTER TABLE starts waiting X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t2 drop column c2"; +where state = "Waiting for table metadata lock" and + info = "alter table t2 drop column c2"; --source include/wait_condition.inc --echo # Check that attempt to acquire SW lock on t2 causes waiting. --echo # Sending: @@ -1828,7 +1886,8 @@ connection mdl_con2; --echo # Check that the above INSERT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "insert into t2 values (1)"; +where state = "Waiting for table metadata lock" and + info = "insert into t2 values (1)"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. commit; @@ -1861,7 +1920,8 @@ connection default; --echo # Wait until ALTER TABLE starts waiting X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "alter table t1 add column c2 int"; +where state = "Waiting for table metadata lock" and + info = "alter table t1 add column c2 int"; --source include/wait_condition.inc --echo # Check that transaction is still able to acquire SR lock. select count(*) from t1; @@ -1904,7 +1964,8 @@ connection mdl_con1; --echo # Check that the above SELECT is blocked let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t2"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t2"; --source include/wait_condition.inc --echo # Unblock SELECT. unlock tables; @@ -1934,7 +1995,8 @@ connection mdl_con1; --echo # Check that the above DELETE is blocked let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "delete from t2 limit 1"; +where state = "Waiting for table metadata lock" and + info = "delete from t2 limit 1"; --source include/wait_condition.inc --echo # Unblock DELETE. unlock tables; @@ -1964,7 +2026,8 @@ connection default; --echo # Wait until LOCK TABLE is blocked creating pending request for X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that another instance of SR lock is granted without waiting. select count(*) from t1; @@ -1999,7 +2062,8 @@ connection default; --echo # Wait until LOCK TABLE is blocked creating pending request for X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "lock table t1 write"; +where state = "Waiting for table metadata lock" and + info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that both SR and SW locks are granted without waiting --echo # and errors. @@ -2043,7 +2107,8 @@ connection default; --echo # Wait until RENAME TABLE starts waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t2 to t3"; +where state = "Waiting for table metadata lock" and + info = "rename table t2 to t3"; --source include/wait_condition.inc --echo # Check that attempt to acquire SR lock on t2 causes waiting. --echo # Sending: @@ -2054,7 +2119,8 @@ connection mdl_con2; --echo # Check that the above SELECT is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "select count(*) from t2"; +where state = "Waiting for table metadata lock" and + info = "select count(*) from t2"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -2093,7 +2159,8 @@ connection default; --echo # Wait until RENAME TABLE starts waiting with pending X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t2 to t3"; +where state = "Waiting for table metadata lock" and + info = "rename table t2 to t3"; --source include/wait_condition.inc --echo # Check that attempt to acquire SW lock on t2 causes waiting. --echo # Sending: @@ -2104,7 +2171,8 @@ connection mdl_con2; --echo # Check that the above DELETE is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "delete from t2 limit 1"; +where state = "Waiting for table metadata lock" and + info = "delete from t2 limit 1"; --source include/wait_condition.inc --echo # Unblock RENAME TABLE. commit; @@ -2141,7 +2209,8 @@ connection default; --echo # Wait until RENAME TABLE is blocked creating pending request for X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that another instance of SR lock is granted without waiting. select count(*) from t1; @@ -2176,7 +2245,8 @@ connection default; --echo # Wait until RENAME TABLE is blocked creating pending request for X lock. let $wait_condition= select count(*) = 1 from information_schema.processlist -where state = "Waiting for table" and info = "rename table t1 to t2"; +where state = "Waiting for table metadata lock" and + info = "rename table t1 to t2"; --source include/wait_condition.inc --echo # Check that both SR and SW locks are granted without waiting --echo # and errors. @@ -2236,7 +2306,8 @@ connection handler_con2; --echo # Wait until ALTER is blocked during upgrade. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column j int"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column j int"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -2279,7 +2350,8 @@ connection handler_con1; --echo # Wait until INSERT is blocked on table-level lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "insert into t2 values (1)"; + where state = "Waiting for table level lock" and + info = "insert into t2 values (1)"; --source include/wait_condition.inc --echo # Sending 'alter table t1 drop column j'. It should not cause --echo # deadlock. @@ -2289,7 +2361,8 @@ connection handler_con2; --echo # Wait until ALTER is blocked during upgrade. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 drop column j"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 drop column j"; --source include/wait_condition.inc --echo # --echo # Switching to connection 'default'. @@ -2328,7 +2401,8 @@ connection handler_con1; --echo # Wait until INSERT is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "insert into t1 values (1)"; + where state = "Waiting for table metadata lock" and + info = "insert into t1 values (1)"; --source include/wait_condition.inc --echo # The below ALTER TABLE will be blocked because of presence of HANDLER. --echo # Sending: @@ -2374,7 +2448,8 @@ connection handler_con1; --echo # Wait until INSERT is blocked because of SNRW lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "insert into t2 values (1)"; + where state = "Waiting for table metadata lock" and + info = "insert into t2 values (1)"; --source include/wait_condition.inc --echo # The below ALTER TABLE will be blocked because of presence of HANDLER. --echo # Sending: @@ -2451,7 +2526,8 @@ connection deadlock_con1; --echo # for 'deadlock_con2' which holds shared metadata lock on 't2'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t2 to t0, t3 to t2, t0 to t3"; + where state = "Waiting for table metadata lock" and + info = "rename table t2 to t0, t3 to t2, t0 to t3"; --source include/wait_condition.inc --echo # The below statement should wait for exclusive metadata lock --echo # on 't2' to go away and should not produce ER_LOCK_DEADLOCK @@ -2466,7 +2542,8 @@ connection deadlock_con2; --echo # for an exclusive metadata lock to go away. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "select * from t2"; + where state = "Waiting for table metadata lock" and + info = "select * from t2"; --source include/wait_condition.inc --echo # --echo # Unblock RENAME TABLE by releasing shared metadata lock on t2. @@ -2502,7 +2579,8 @@ connection deadlock_con1; --echo # table 't1'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t0, t3 to t1, t0 to t3"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t0, t3 to t1, t0 to t3"; --source include/wait_condition.inc --echo # Commit transaction to unblock RENAME TABLE. commit; @@ -2536,7 +2614,8 @@ connection deadlock_con1; --echo # for 'deadlock_con1' which holds shared metadata lock on 't2'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t2 to t0, t1 to t2, t0 to t1"; + where state = "Waiting for table metadata lock" and + info = "rename table t2 to t0, t1 to t2, t0 to t1"; --source include/wait_condition.inc --echo # --echo # The below statement should not wait as doing so will cause deadlock. @@ -2549,7 +2628,8 @@ select * from t1; --echo # metadata lock on table 't1', i.e. that RENAME TABLE is still blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t2 to t0, t1 to t2, t0 to t1"; + where state = "Waiting for table metadata lock" and + info = "rename table t2 to t0, t1 to t2, t0 to t1"; --source include/wait_condition.inc --echo # Commit transaction to unblock RENAME TABLE. commit; @@ -2590,7 +2670,7 @@ connection deadlock_con2; --echo # for an UNRW metadata lock to go away. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "select * from t1"; + where state = "Waiting for table metadata lock" and info = "select * from t1"; --source include/wait_condition.inc --echo # Send RENAME TABLE statement that will deadlock with the @@ -2604,7 +2684,8 @@ connection default; --echo # pending X lock on t1. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t0, t2 to t1, t0 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t0, t2 to t1, t0 to t2"; --source include/wait_condition.inc --echo # Allow the above RENAME TABLE to acquire lock on t1 and --echo # create pending lock on t2 thus creating deadlock. @@ -2626,7 +2707,8 @@ connection deadlock_con1; --echo # is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t0, t2 to t1, t0 to t2"; + where state = "Waiting for table metadata lock" and + info = "rename table t1 to t0, t2 to t1, t0 to t2"; --source include/wait_condition.inc --echo # Commit transaction to unblock this RENAME TABLE. commit; @@ -2674,7 +2756,8 @@ connection deadlock_con1; --echo # 'deadlock_con1' which holds shared lock on 't1'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column j int, rename to t2"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column j int, rename to t2"; --source include/wait_condition.inc --echo # The below statement should not wait as it will cause deadlock. @@ -2687,7 +2770,8 @@ select * from t2; --echo # so ALTER TABLE ... RENAME is still blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column j int, rename to t2"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column j int, rename to t2"; --source include/wait_condition.inc --echo # Commit transaction to unblock ALTER TABLE ... RENAME. @@ -2732,7 +2816,8 @@ connection deadlock_con2; --echo # while trying to acquire SNRW lock on 't1'. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "lock tables t1 write, t2 write"; + where state = "Waiting for table metadata lock" and + info = "lock tables t1 write, t2 write"; --source include/wait_condition.inc --echo # Resume SELECT execution, this should eventually unblock LOCK TABLES. set debug_sync= 'now SIGNAL finish'; @@ -2801,7 +2886,8 @@ connection deadlock_con2; --echo # Wait until ALTER is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 drop column j"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 drop column j"; --source include/wait_condition.inc --echo # Resume INSERT so it can start deadlock detection. --echo # @@ -2829,6 +2915,188 @@ connection default; drop table t1; +--echo # +--echo # Now, test for a situation in which deadlock involves waiting not +--echo # only in MDL subsystem but also for TDC. Such deadlocks should be +--echo # successfully detected. If possible, they should be resolved without +--echo # resorting to ER_LOCK_DEADLOCK error. +--echo # +create table t1(i int); +create table t2(j int); + +--echo # +--echo # First, let us check how we handle a simple scenario involving +--echo # waits in MDL and TDC. +--echo # +set debug_sync= 'RESET'; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Start a statement, which will acquire SR metadata lock on t1, open it +--echo # and then stop, before trying to acquire SW lock on t2 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +--echo # Sending: +--send select * from t1 where i in (select j from t2 for update) + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +--echo # Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +--echo # The below FLUSH TABLES WITH READ LOCK should acquire +--echo # SNW locks on t1 and t2 and wait till SELECT closes t1. +--echo # Sending: +send flush tables t1, t2 with read lock; + +--echo # Switching to connection 'deadlock_con3'. +connection deadlock_con3; +--echo # Wait until FLUSH TABLES WITH t1, t2 READ LOCK starts waiting +--echo # for SELECT to close t1. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" and + info = "flush tables t1, t2 with read lock"; +--source include/wait_condition.inc + +--echo # Resume SELECT, so it tries to acquire SW lock on t1 and blocks, +--echo # creating a deadlock. This deadlock should be detected and resolved +--echo # by backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +--echo # Reap FLUSH TABLES WITH READ LOCK. +reap; +unlock tables; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Reap SELECT. +reap; + +--echo # +--echo # The same scenario with a slightly different order of events +--echo # which emphasizes that setting correct deadlock detector weights +--echo # for flush waits is important. +--echo # +set debug_sync= 'RESET'; + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WAIT_FOR go'; + +--echo # The below FLUSH TABLES WITH READ LOCK should acquire +--echo # SNW locks on t1 and t2 and wait on debug sync point. +--echo # Sending: +send flush tables t1, t2 with read lock; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Wait till FLUSH TABLE WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; + +--echo # Start statement which will acquire SR metadata lock on t1, open +--echo # it and then will block while trying to acquire SW lock on t2. +--echo # Sending: +send select * from t1 where i in (select j from t2 for update); + +--echo # Switching to connection 'deadlock_con3'. +connection deadlock_con3; +--echo # Wait till the above SELECT blocks. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "select * from t1 where i in (select j from t2 for update)"; +--source include/wait_condition.inc + +--echo # Resume FLUSH TABLES, so it tries to flush t1, thus creating +--echo # a deadlock. This deadlock should be detected and resolved by +--echo # backing-off SELECT. As a result FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +--echo # Reap FLUSH TABLES WITH READ LOCK. +reap; +unlock tables; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Reap SELECT. +reap; + +--echo # +--echo # Now a more complex scenario involving two connections +--echo # waiting for MDL and one for TDC. +--echo # +set debug_sync= 'RESET'; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Start a statement which will acquire SR metadata lock on t2, open it +--echo # and then stop, before trying to acquire SR on t1 and opening it. +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; +--echo # Sending: +send select * from t2, t1; + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +--echo # Wait till the above SELECT stops. +set debug_sync='now WAIT_FOR parked'; +--echo # The below FLUSH TABLES WITH READ LOCK should acquire +--echo # SNW locks on t2 and wait till SELECT closes t2. +--echo # Sending: +send flush tables t2 with read lock; + +--echo # Switching to connection 'deadlock_con3'. +connection deadlock_con3; +--echo # Wait until FLUSH TABLES WITH READ LOCK starts waiting +--echo # for SELECT to close t2. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" and + info = "flush tables t2 with read lock"; +--source include/wait_condition.inc + +--echo # The below DROP TABLES should acquire X lock on t1 and start +--echo # waiting for X lock on t2. +--echo # Sending: +send drop tables t1, t2; + +--echo # Switching to connection 'default'. +connection default; +--echo # Wait until DROP TABLES starts waiting for X lock on t2. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "drop tables t1, t2"; +--source include/wait_condition.inc + +--echo # Resume SELECT, so it tries to acquire SR lock on t1 and blocks, +--echo # creating a deadlock. This deadlock should be detected and resolved +--echo # by backing-off SELECT. As a result, FTWRL should be able to finish. +set debug_sync='now SIGNAL go'; + +--echo # Switching to connection 'deadlock_con2'. +connection deadlock_con2; +--echo # Reap FLUSH TABLES WITH READ LOCK. +reap; +--echo # Unblock DROP TABLES. +unlock tables; + +--echo # Switching to connection 'deadlock_con3'. +connection deadlock_con3; +--echo # Reap DROP TABLES. +reap; + +--echo # Switching to connection 'deadlock_con1'. +connection deadlock_con1; +--echo # Reap SELECT. It should emit error about missing table. +--error ER_NO_SUCH_TABLE +reap; + +--echo # Switching to connection 'default'. +connection default; + set debug_sync= 'RESET'; disconnect deadlock_con1; @@ -2837,6 +3105,75 @@ disconnect deadlock_con3; --echo # +--echo # Test for a scenario in which FLUSH TABLES <list> WITH READ LOCK +--echo # used to erroneously release metadata locks. +--echo # +connect(con1,localhost,root,,); +connect(con2,localhost,root,,); +connection default; +--disable_warnings +drop tables if exists t1, t2; +--enable_warnings +set debug_sync= 'RESET'; +create table t1(i int); +create table t2(j int); + +--echo # Switching to connection 'con2'. +connection con2; +set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go'; + +--echo # The below FLUSH TABLES <list> WITH READ LOCK should acquire +--echo # SNW locks on t1 and t2, open table t1 and block on the debug +--echo # sync point. +--echo # Sending: +send flush tables t1, t2 with read lock; + +--echo # Switching to connection 'con1'. +connection con1; +--echo # Wait till FLUSH TABLES <list> WITH READ LOCK stops. +set debug_sync='now WAIT_FOR parked'; + +--echo # Start a statement which will flush all tables and thus +--echo # invalidate table t1 open by FLUSH TABLES <list> WITH READ LOCK. +--echo # Sending: +send flush tables; + +--echo # Switching to connection 'default'. +connection default; +--echo # Wait till the above FLUSH TABLES blocks. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table flush" and + info = "flush tables"; +--source include/wait_condition.inc + +--echo # Resume FLUSH TABLES <list> WITH READ LOCK, so it tries to open t2 +--echo # discovers that its t1 is obsolete and tries to reopen all tables. +--echo # Such reopen should not cause releasing of SNW metadata locks +--echo # which would result in assertion failures. +set debug_sync='now SIGNAL go'; + +--echo # Switching to connection 'con2'. +connection con2; +--echo # Reap FLUSH TABLES <list> WITH READ LOCK. +reap; +unlock tables; + +--echo # Switching to connection 'con1'. +connection con1; +--echo # Reap FLUSH TABLES. +reap; + +--echo # Clean-up. +--echo # Switching to connection 'default'. +connection default; +drop tables t1, t2; +set debug_sync= 'RESET'; +disconnect con1; +disconnect con2; + + +--echo # --echo # Test for bug #46748 "Assertion in MDL_context::wait_for_locks() --echo # on INSERT + CREATE TRIGGER". --echo # @@ -2873,7 +3210,7 @@ connection default; --echo # metadata lock on its tables and blocks due to 't4' being used by LOCK --echo # TABLES. let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Waiting for table' and + where state= 'Waiting for table metadata lock' and info='rename table t3 to t5, t4 to t3'; --source include/wait_condition.inc --echo # Send : @@ -2884,7 +3221,7 @@ connection con1root; --echo # Wait until INSERT statement waits due to encountering pending --echo # exclusive metadata lock on 't3'. let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Waiting for table' and + where state= 'Waiting for table metadata lock' and info='insert into t1 values (1)'; --source include/wait_condition.inc unlock tables; @@ -3026,7 +3363,8 @@ connection default; --echo # Waiting until CREATE TABLE ... SELECT ... is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "create table t2 select * from t1 for update"; + where state = "Waiting for table level lock" and + info = "create table t2 select * from t1 for update"; --source include/wait_condition.inc --echo # First let us check that SHOW FIELDS/DESCRIBE doesn't @@ -3079,7 +3417,8 @@ connection default; --echo # Waiting until CREATE TABLE ... SELECT ... is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "create table t2 select * from t1 for update"; + where state = "Waiting for table level lock" and + info = "create table t2 select * from t1 for update"; --source include/wait_condition.inc --echo # Let us check that SHOW FIELDS/DESCRIBE gets blocked. @@ -3091,7 +3430,8 @@ connection con46044_2; --echo # Wait until SHOW FIELDS gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "show fields from t2"; + where state = "Waiting for table metadata lock" and + info = "show fields from t2"; --source include/wait_condition.inc unlock tables; @@ -3121,7 +3461,8 @@ connection default; --echo # Waiting until CREATE TABLE ... SELECT ... is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "create table t2 select * from t1 for update"; + where state = "Waiting for table level lock" and + info = "create table t2 select * from t1 for update"; --source include/wait_condition.inc --echo # Check that I_S query which reads only .FRMs gets blocked. @@ -3133,7 +3474,7 @@ connection con46044_2; --echo # Wait until SELECT COLUMN_NAME FROM I_S.COLUMNS gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info like "select column_name from information_schema.columns%"; --source include/wait_condition.inc @@ -3164,7 +3505,8 @@ connection default; --echo # Waiting until CREATE TABLE ... SELECT ... is blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "create table t2 select * from t1 for update"; + where state = "Waiting for table level lock" and + info = "create table t2 select * from t1 for update"; --source include/wait_condition.inc --echo # Finally, check that I_S query which does full-blown table open @@ -3177,7 +3519,7 @@ connection con46044_2; --echo # Wait until SELECT ... FROM I_S.TABLES gets blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and + where state = "Waiting for table metadata lock" and info like "select table_name, table_type, auto_increment, table_comment from information_schema.tables%"; --source include/wait_condition.inc @@ -3240,7 +3582,8 @@ update t1 set c3=c3+1 where c2 = 3; --echo # metadata lock on table 't1', i.e. that ALTER TABLE is still blocked. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "alter table t1 add column e int, rename to t2"; + where state = "Waiting for table metadata lock" and + info = "alter table t1 add column e int, rename to t2"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE by commiting transaction and thus releasing @@ -3425,7 +3768,7 @@ connection con1; connection con3; let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist - WHERE state = "Table lock" and info = "SELECT 1"; + WHERE state = "Waiting for table level lock" and info = "SELECT 1"; --source include/wait_condition.inc # The ALTER below will try to abort the statement in connection con1, # since the latter waits on a table-level lock while having a HANDLER @@ -3495,7 +3838,8 @@ connection con50913_2; --echo # Wait until TRUNCATE TABLE is blocked on MDL lock. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "truncate table t1"; + where state = "Waiting for table metadata lock" and + info = "truncate table t1"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. set debug_sync= 'now SIGNAL go'; @@ -3568,7 +3912,8 @@ connection con3; --echo # SW lock on the table. let $wait_condition= select count(*) = 2 from information_schema.processlist - where state = "Waiting for table" and info = "insert into t1 values (1)"; + where state = "Waiting for table metadata lock" and + info = "insert into t1 values (1)"; --source include/wait_condition.inc --echo # Unblock ALTER TABLE. Since it will try to upgrade SNW to X lock --echo # deadlock with two loops in waiting graph will occur. Both loops @@ -3738,7 +4083,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='CREATE DATABASE db1'; + WHERE state='Waiting for schema metadata lock' AND info='CREATE DATABASE db1'; --source include/wait_condition.inc # This should not block. CREATE DATABASE db2; @@ -3778,7 +4123,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' + WHERE state='Waiting for schema metadata lock' AND info='ALTER DATABASE db1 DEFAULT CHARACTER SET utf8'; --source include/wait_condition.inc # This should not block. @@ -3813,7 +4158,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='DROP DATABASE db1'; + WHERE state='Waiting for schema metadata lock' AND info='DROP DATABASE db1'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; @@ -3857,7 +4202,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' + WHERE state='Waiting for schema metadata lock' AND info='ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME'; --source include/wait_condition.inc # This should not block. @@ -3898,7 +4243,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='DROP DATABASE db1'; + WHERE state='Waiting for schema metadata lock' AND info='DROP DATABASE db1'; --source include/wait_condition.inc # This should not block. CREATE DATABASE db2; @@ -3934,7 +4279,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' + WHERE state='Waiting for schema metadata lock' AND info='ALTER DATABASE db1 DEFAULT CHARACTER SET utf8'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; @@ -3947,7 +4292,9 @@ connection default; --echo # Connection con2 connection con2; --echo # Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8 ---error 1,1 # Wrong error pending followup patch for bug#54360 +# Error 1 is from ALTER DATABASE when the database does not exist. +# Listing the error twice to prevent result diffences based on filename. +--error 1,1 --reap @@ -3973,7 +4320,8 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='CREATE TABLE db1.t1 (a INT)'; + WHERE state='Waiting for schema metadata lock' AND + info='CREATE TABLE db1.t1 (a INT)'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; @@ -4011,7 +4359,8 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='RENAME TABLE db1.t1 TO test.t1'; + WHERE state='Waiting for schema metadata lock' AND + info='RENAME TABLE db1.t1 TO test.t1'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; @@ -4044,7 +4393,8 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='RENAME TABLE test.t2 TO db1.t2'; + WHERE state='Waiting for schema metadata lock' AND + info='RENAME TABLE test.t2 TO db1.t2'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; @@ -4056,7 +4406,9 @@ connection default; --echo # Connection con2 connection con2; --echo # Reaping: RENAME TABLE test.t2 TO db1.t2 ---error 7, 7 # Wrong error pending followup patch for bug#54360 +# Error 7 is from RENAME TABLE where the target database does not exist. +# Listing the error twice to prevent result diffences based on filename. +--error 7, 7 --reap DROP TABLE test.t2; @@ -4084,7 +4436,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='DROP TABLE db1.t1'; + WHERE state='Waiting for schema metadata lock' AND info='DROP TABLE db1.t1'; --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL blocked'; diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test index 509c7742dac..10d36bfe2a4 100644 --- a/mysql-test/t/merge-big.test +++ b/mysql-test/t/merge-big.test @@ -51,7 +51,7 @@ connection default; #--sleep 8 #SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'Waiting for table'; + WHERE ID = $con1_id AND STATE = 'Waiting for table metadata lock'; --source include/wait_condition.inc #SELECT NOW(); --echo # Kick INSERT out of thr_multi_lock(). @@ -61,7 +61,7 @@ FLUSH TABLES; #--sleep 8 #SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'Waiting for table'; + WHERE ID = $con1_id AND STATE = 'Waiting for table metadata lock'; --source include/wait_condition.inc #SELECT NOW(); --echo # Unlock and close table and wait for con1 to close too. diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 7a81ad496b4..166d36856a6 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -497,7 +497,7 @@ connection updater; # Wait till "alter table t1 ..." of session changer is in work. # = There is one session waiting. let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Waiting for table'; + 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; @@ -508,7 +508,7 @@ connection locker; # are in work. # = There are two session waiting. let $wait_condition= select count(*)= 2 from information_schema.processlist - where state= 'Waiting for table'; + where state= 'Waiting for table metadata lock'; --source include/wait_condition.inc unlock tables; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index ce49ca89eca..51e362d4916 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -498,12 +498,20 @@ drop table t1,t2,t3,t4; set query_cache_wlock_invalidate=1; create table t1 (a int not null); create table t2 (a int not null); +create view v1 as select * from t1; select * from t1; select * from t2; show status like "Qcache_queries_in_cache"; lock table t1 write, t2 read; show status like "Qcache_queries_in_cache"; unlock table; +select * from t1; +# Implicit locking of t1 does not invalidate QC +show status like "Qcache_queries_in_cache"; +lock table v1 write; +show status like "Qcache_queries_in_cache"; +unlock table; +drop view v1; drop table t1,t2; set query_cache_wlock_invalidate=default; diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test index c95d7553988..21768b27c2e 100644 --- a/mysql-test/t/query_cache_28249.test +++ b/mysql-test/t/query_cache_28249.test @@ -58,18 +58,18 @@ connection user3; # Typical information_schema.processlist content after sufficient sleep time # ID USER COMMAND TIME STATE INFO # .... -# 2 root Query 5 Table lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1 +# 2 root Query 5 Waiting for table level lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1 # .... # XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # The values marked with 'X' must be reached. --echo # Poll till the select of connection user1 is blocked by the write lock on t1. let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist -WHERE state = 'Table lock' +WHERE state = 'Waiting for table level lock' AND info = '$select_for_qc'; --source include/wait_condition.inc eval SELECT user,command,state,info FROM information_schema.processlist -WHERE state = 'Table lock' +WHERE state = 'Waiting for table level lock' AND info = '$select_for_qc'; INSERT INTO t1 VALUES (4); diff --git a/mysql-test/t/schema.test b/mysql-test/t/schema.test index ed3b98ec2f7..6af7ee20b02 100644 --- a/mysql-test/t/schema.test +++ b/mysql-test/t/schema.test @@ -23,7 +23,6 @@ drop schema foo; --disable_warnings DROP SCHEMA IF EXISTS schema1; -DROP SCHEMA IF EXISTS schema2; --enable_warnings connect(con2, localhost, root); @@ -32,7 +31,6 @@ connect(con2, localhost, root); connection default; CREATE SCHEMA schema1; -CREATE SCHEMA schema2; CREATE TABLE schema1.t1 (a INT); SET autocommit= FALSE; @@ -45,10 +43,13 @@ connection con2; --echo # Connection default connection default; let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table' + WHERE state= 'Waiting for table metadata lock' AND info='DROP SCHEMA schema1'; --source include/wait_condition.inc -ALTER SCHEMA schema2 DEFAULT CHARACTER SET utf8; +# Error 1 is from ALTER DATABASE when the database does not exist. +# Listing the error twice to prevent result diffences based on filename. +--error 1,1 +ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8; SET autocommit= TRUE; --echo # Connection 2 @@ -57,7 +58,6 @@ connection con2; --echo # Connection default connection default; -DROP SCHEMA schema2; disconnect con2; @@ -84,7 +84,7 @@ connection con2; --echo # Connection default connection default; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' and info='DROP SCHEMA schema1'; + WHERE state='Waiting for schema metadata lock' and info='DROP SCHEMA schema1'; --source include/wait_condition.inc --echo # CREATE SCHEMA used to give a deadlock. @@ -124,7 +124,7 @@ connection default; --echo # Connection con2 connect (con2, localhost, root); let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' AND info='DROP DATABASE db1'; + WHERE state='Waiting for table metadata lock' AND info='DROP DATABASE db1'; --source include/wait_condition.inc --echo # Connection con1 @@ -172,7 +172,7 @@ connection con2; --echo # Connection 3 connection con3; let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist - WHERE state='Waiting for table' and info='DROP DATABASE db1'; + WHERE state='Waiting for table metadata lock' and info='DROP DATABASE db1'; --source include/wait_condition.inc --echo # But it should still be possible to CREATE/ALTER/DROP other databases. CREATE DATABASE db2; diff --git a/mysql-test/t/sp-lock.test b/mysql-test/t/sp-lock.test index 7297790a886..be8369d6994 100644 --- a/mysql-test/t/sp-lock.test +++ b/mysql-test/t/sp-lock.test @@ -183,18 +183,19 @@ connection con1; send drop procedure p1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop procedure t1' to get blocked on MDL lock... +--echo # Waiting for 'drop procedure t1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop procedure p1'; +where state='Waiting for stored procedure metadata lock' and +info='drop procedure p1'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored procedure metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -222,18 +223,19 @@ connection con1; send create procedure p1() begin end; --echo # --> connection con2 connection con2; ---echo # Waitng for 'create procedure t1' to get blocked on MDL lock... +--echo # Waiting for 'create procedure t1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='create procedure p1() begin end'; +where state='Waiting for stored procedure metadata lock' and +info='create procedure p1() begin end'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored procedure metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -259,18 +261,19 @@ connection con1; send alter procedure p1 contains sql; --echo # --> connection con2 connection con2; ---echo # Waitng for 'alter procedure t1' to get blocked on MDL lock... +--echo # Waiting for 'alter procedure t1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='alter procedure p1 contains sql'; +where state='Waiting for stored procedure metadata lock' and +info='alter procedure p1 contains sql'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored procedure metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -296,18 +299,19 @@ connection con1; send drop function f1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop function f1' to get blocked on MDL lock... +--echo # Waiting for 'drop function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f1'; +where state='Waiting for stored function metadata lock' and +info='drop function f1'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored function metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -335,18 +339,19 @@ connection con1; send create function f1() returns int return 2; --echo # --> connection con2 connection con2; ---echo # Waitng for 'create function f1' to get blocked on MDL lock... +--echo # Waiting for 'create function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='create function f1() returns int return 2'; +where state='Waiting for stored function metadata lock' and +info='create function f1() returns int return 2'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored function metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -373,18 +378,19 @@ connection con1; send alter function f1 contains sql; --echo # --> connection con2 connection con2; ---echo # Waitng for 'alter function f1' to get blocked on MDL lock... +--echo # Waiting for 'alter function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='alter function f1 contains sql'; +where state='Waiting for stored function metadata lock' and +info='alter function f1 contains sql'; --source include/wait_condition.inc --echo # Demonstrate that there is a pending exclusive lock. --echo # Sending 'select f1()'... send select f1(); --echo # --> connection con3 connection con3; ---echo # Waitng for 'select f1()' to get blocked by a pending MDL lock... +--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1()'; +where state='Waiting for stored function metadata lock' and info='select f1()'; --echo # --> connection default connection default; commit; @@ -471,9 +477,10 @@ connection con1; send drop function f1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop function f1' to get blocked on MDL lock... +--echo # Waiting for 'drop function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f1'; +where state='Waiting for stored function metadata lock' and +info='drop function f1'; --source include/wait_condition.inc --echo # --> connnection default connection default; @@ -497,9 +504,10 @@ connection con1; send drop function f1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop function f1' to get blocked on MDL lock... +--echo # Waiting for 'drop function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f1'; +where state='Waiting for stored function metadata lock' and +info='drop function f1'; --source include/wait_condition.inc --echo # --> connnection default connection default; @@ -530,9 +538,10 @@ connection con1; send drop procedure p1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop procedure p1' to get blocked on MDL lock... +--echo # Waiting for 'drop procedure p1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop procedure p1'; +where state='Waiting for stored procedure metadata lock' and +info='drop procedure p1'; --source include/wait_condition.inc --echo # --> connnection default connection default; @@ -561,9 +570,10 @@ connection con1; send drop function f2; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop function f2' to get blocked on MDL lock... +--echo # Waiting for 'drop function f2' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f2'; +where state='Waiting for stored function metadata lock' and +info='drop function f2'; --source include/wait_condition.inc --echo # --> connnection default connection default; @@ -623,17 +633,19 @@ connection con1; send drop function f1; --echo # --> connection con2 connection con2; ---echo # Waitng for 'drop function f1' to get blocked on MDL lock... +--echo # Waiting for 'drop function f1' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f1'; +where state='Waiting for stored function metadata lock' and +info='drop function f1'; --source include/wait_condition.inc --echo # Sending 'drop function f2'... send drop function f2; --echo # --> connection default connection default; ---echo # Waitng for 'drop function f2' to get blocked on MDL lock... +--echo # Waiting for 'drop function f2' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='drop function f2'; +where state='Waiting for stored function metadata lock' and +info='drop function f2'; --source include/wait_condition.inc rollback to savepoint sv; --echo # --> connection con2 @@ -699,16 +711,18 @@ connection con1; send alter function f1 comment "comment"; --echo # --> connection con2 connection con2; ---echo # Waitng for 'alter function f1 ...' to get blocked on MDL lock... +--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info like 'alter function f1 comment%'; +where state='Waiting for stored function metadata lock' and +info like 'alter function f1 comment%'; --source include/wait_condition.inc --echo # Sending 'call p1()'... send call p1(); connection default; ---echo # Waitng for 'call p1()' to get blocked on MDL lock on f1... +--echo # Waiting for 'call p1()' to get blocked on MDL lock on f1... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1() into @var'; +where state='Waiting for stored function metadata lock' and +info='select f1() into @var'; --source include/wait_condition.inc --echo # Let 'alter function f1 ...' go through... commit; @@ -746,9 +760,10 @@ connection con1; send alter function f1 comment "comment"; --echo # --> connection con2 connection con2; ---echo # Waitng for 'alter function f1 ...' to get blocked on MDL lock... +--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info like 'alter function f1 comment%'; +where state='Waiting for stored function metadata lock' and +info like 'alter function f1 comment%'; --source include/wait_condition.inc delimiter |; --echo # @@ -774,9 +789,10 @@ delimiter ;| --echo # Sending 'call p1()'... send call p1(); connection default; ---echo # Waitng for 'call p1()' to get blocked on MDL lock on f1... +--echo # Waiting for 'call p1()' to get blocked on MDL lock on f1... let $wait_condition=select count(*)=1 from information_schema.processlist -where state='Waiting for table' and info='select f1() into @var'; +where state='Waiting for stored function metadata lock' and +info='select f1() into @var'; --source include/wait_condition.inc --echo # Let 'alter function f1 ...' go through... commit; @@ -825,7 +841,7 @@ connection default; send select f3(); --echo # --> connection con1 connection con1; ---echo # Waitng for 'select f3()' to get blocked on the user level lock... +--echo # Waiting for 'select f3()' to get blocked on the user level lock... let $wait_condition=select count(*)=1 from information_schema.processlist where state='User lock' and info='select f1() into @var'; --source include/wait_condition.inc diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 83accecabb5..b15f6351e59 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -322,7 +322,7 @@ set session low_priority_updates=on; connection rl_wait; let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and + where state = "Waiting for table level lock" and info = "update t1 set value='updated' where value='old'"; --source include/wait_condition.inc diff --git a/mysql-test/t/sp_sync.test b/mysql-test/t/sp_sync.test index 431db463b67..368a09eac8c 100644 --- a/mysql-test/t/sp_sync.test +++ b/mysql-test/t/sp_sync.test @@ -87,7 +87,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked'; --echo # Connection con3 connection con3; let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist - WHERE state= 'Waiting for table' + WHERE state= 'Waiting for stored function metadata lock' AND info='SHOW OPEN TABLES WHERE f1()=0'; --source include/wait_condition.inc --echo # Check that the IS query is blocked before releasing the x-lock diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index cca54f6c762..9965875af55 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -58,7 +58,8 @@ let $ID= `select connection_id()`; connection con2; --echo # Switched to connection: con2 # wait for the other query to start executing -let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = "Table lock"; +let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST + where ID = $ID and STATE = "Waiting for table level lock"; --source include/wait_condition.inc unlock tables; diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test index 8a570a7e87d..9728ae9a4ae 100644 --- a/mysql-test/t/trigger_notembedded.test +++ b/mysql-test/t/trigger_notembedded.test @@ -896,7 +896,7 @@ connection default; --echo connection: default let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table"; + where state = "Waiting for global metadata lock"; --source include/wait_condition.inc create trigger t1_bi before insert on t1 for each row begin end; unlock tables; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index c0564a82b23..236f2e84770 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4074,7 +4074,8 @@ connection default; connection con2; let $wait_condition= SELECT COUNT(*) = 1 from information_schema.processlist - WHERE state = "Table lock" AND info = "INSERT INTO t1 SELECT * FROM v1"; + WHERE state = "Waiting for table level lock" AND + info = "INSERT INTO t1 SELECT * FROM v1"; --source include/wait_condition.inc --echo # ... then try to drop the view. This should block. --echo # Sending: @@ -4084,7 +4085,7 @@ let $wait_condition= connection con3; let $wait_condition= SELECT COUNT(*) = 1 from information_schema.processlist - WHERE state = "Waiting for table" AND info = "DROP VIEW v1"; + WHERE state = "Waiting for table metadata lock" AND info = "DROP VIEW v1"; --source include/wait_condition.inc --echo # Now allow CALL p1() to complete UNLOCK TABLES; |