diff options
Diffstat (limited to 'mysql-test/suite/handler/innodb.result')
-rw-r--r-- | mysql-test/suite/handler/innodb.result | 185 |
1 files changed, 99 insertions, 86 deletions
diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index 78660b0ef9c..fc1089ee445 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -538,18 +538,20 @@ handler t1 open; handler t1 read first; c1 1 +connect con2,localhost,root,,; +connection con2; send the below to another connection, do not wait for the result optimize table t1; -proceed with the normal connection +connection default; handler t1 read next; c1 1 handler t1 close; -read the result from the other connection +connection con2; Table Op Msg_type Msg_text test.t1 optimize note Table does not support optimize, doing recreate + analyze instead test.t1 optimize status OK -proceed with the normal connection +connection default; drop table t1; CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY using btree (no1,no2)); INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2); @@ -570,26 +572,28 @@ insert into t1 values (14397); flush tables with read lock; drop table t1; ERROR HY000: Can't execute the query because you have a conflicting read lock -send the below to another connection, do not wait for the result +connection con2; drop table t1; -proceed with the normal connection +connection default; select * from t1; c1 14397 unlock tables; +connection con2; read the result from the other connection -proceed with the normal connection +connection default; select * from t1; ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1; Warnings: Note 1051 Unknown table 'test.t1' create table t1 (a int not null) ENGINE=csv; ---> client 2 +connection con2; handler t1 open; ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option ---> client 1 +connection default; drop table t1; +disconnect con2; create table t1 (a int); handler t1 open as t1_alias; handler t1_alias read a next; @@ -972,15 +976,17 @@ handler t1 close; # Explore the effect of HANDLER locks on concurrent DDL # handler t1 open; -# Establishing auxiliary connections con1, con2, con3 -# --> connection con1; +connect con1, localhost, root,,; +connect con2, localhost, root,,; +connect con3, localhost, root,,; +connection con1; # Sending: drop table t1 ; # We can't use connection 'default' as wait_condition will # autoclose handlers. -# --> connection con2 +connection con2; # Waitng for 'drop table t1' to get blocked... -# --> connection default +connection default; handler t1 read a prev; a b 5 NULL @@ -988,9 +994,9 @@ handler t1 read a prev; a b 4 NULL handler t1 close; -# --> connection con1 +connection con1; # Reaping 'drop table t1'... -# --> connection default +connection default; # # Explore the effect of HANDLER locks in parallel with SELECT # @@ -1012,12 +1018,12 @@ handler t1 read a prev; a 4 handler t1 close; -# --> connection con1; +connection con1; # Sending: drop table t1 ; -# --> connection con2 +connection con2; # Waiting for 'drop table t1' to get blocked... -# --> connection default +connection default; # We can still use the table, it's part of the transaction select * from t1; a @@ -1042,10 +1048,10 @@ handler t1 read a prev; a 3 handler t1 close; -# --> connection con1 +connection con1; # Now drop can proceed # Reaping 'drop table t1'... -# --> connection default +connection default; # # Demonstrate that HANDLER locks and transaction locks # reside in the same context. @@ -1062,12 +1068,12 @@ a 3 4 5 -# --> connection con2 +connection con2; # Sending: rename table t0 to t3, t1 to t0, t3 to t1; -# --> connection con1 +connection con1; # Waiting for 'rename table ...' to get blocked... -# --> connection default +connection default; # We back-off on hitting deadlock condition. handler t0 open; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction @@ -1081,9 +1087,9 @@ a handler t1 open; commit; handler t1 close; -# --> connection con2 +connection con2; # Reaping 'rename table ...'... -# --> connection default +connection default; handler t1 open; handler t1 read a prev; a @@ -1099,22 +1105,22 @@ drop table t0; # create table t2 (a int, key a (a)); handler t1 open; -# --> connection con1 +connection con1; lock tables t2 read; -# --> connection con2 +connection con2; # Sending 'drop table t2'... drop table t2; -# --> connection con1 +connection con1; # Waiting for 'drop table t2' to get blocked... -# --> connection default +connection default; # Sending 'select * from t2' select * from t2; -# --> connection con1 +connection con1; # Waiting for 'select * from t2' to get blocked... unlock tables; -# --> connection con2 +connection con2; # Reaping 'drop table t2'... -# --> connection default +connection default; # Reaping 'select * from t2' ERROR 42S02: Table 'test.t2' doesn't exist handler t1 close; @@ -1138,29 +1144,29 @@ a 2 select * from t2; a -# --> connection con1 +connection con1; # Sending: drop table t1; -# --> connection con2 +connection con2; # Sending: drop table t2; -# --> connection default +connection default; # Let DROP TABLE statements sync in. We must use # a separate connection for that, because otherwise SELECT # will auto-close the HANDLERs, becaues there are pending # exclusive locks against them. -# --> connection con3 +connection con3; # Waiting for 'drop table t1' to get blocked... # Waiting for 'drop table t2' to get blocked... # Demonstrate that t2 lock was released and t2 was dropped # after ROLLBACK TO SAVEPOINT -# --> connection default +connection default; rollback to savepoint sv; -# --> connection con2 +connection con2; # Reaping 'drop table t2'... # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler # lock. -# --> connection default +connection default; handler t1 read a next; a 3 @@ -1170,9 +1176,9 @@ a # Demonstrate that the drop will go through as soon as we close the # HANDLER handler t1 close; -# connection con1 +connection con1; # Reaping 'drop table t1'... -# --> connection default +connection default; commit; drop table t3; # @@ -1197,29 +1203,29 @@ a 2 select * from t2; a -# --> connection con1 +connection con1; # Sending: drop table t1; -# --> connection con2 +connection con2; # Sending: drop table t2; -# --> connection default +connection default; # Let DROP TABLE statements sync in. We must use # a separate connection for that, because otherwise SELECT # will auto-close the HANDLERs, becaues there are pending # exclusive locks against them. -# --> connection con3 +connection con3; # Waiting for 'drop table t1' to get blocked... # Waiting for 'drop table t2' to get blocked... # Demonstrate that t2 lock was released and t2 was dropped # after ROLLBACK TO SAVEPOINT -# --> connection default +connection default; rollback to savepoint sv; -# --> connection con2 +connection con2; # Reaping 'drop table t2'... # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler # lock. -# --> connection default +connection default; handler t1 read a next; a 3 @@ -1229,9 +1235,9 @@ a # Demonstrate that the drop will go through as soon as we close the # HANDLER handler t1 close; -# connection con1 +connection con1; # Reaping 'drop table t1'... -# --> connection default +connection default; commit; # # Show that rollback to the savepoint taken in the beginning @@ -1258,25 +1264,25 @@ handler t3 read a first; a 1 rollback to savepoint sv; -# --> connection con1 +connection con1; drop table t1, t2; # Sending: drop table t3; # Let DROP TABLE statement sync in. -# --> connection con2 +connection con2; # Waiting for 'drop table t3' to get blocked... # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler # lock. -# --> connection default +connection default; handler t3 read a next; a 2 # Demonstrate that the drop will go through as soon as we close the # HANDLER handler t3 close; -# connection con1 +connection con1; # Reaping 'drop table t3'... -# --> connection default +connection default; commit; # # If we have to wait on an exclusive locks while having @@ -1285,27 +1291,27 @@ commit; create table t1 (a int, key a(a)); create table t2 like t1; handler t1 open; -# --> connection con1 +connection con1; lock table t1 write, t2 write; -# --> connection default +connection default; drop table t2; -# --> connection con2 +connection con2; # Waiting for 'drop table t2' to get blocked... -# --> connection con1 +connection con1; drop table t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction unlock tables; -# --> connection default +connection default; # Demonstrate that there is no deadlock with FLUSH TABLE, # even though it is waiting for the other table to go away create table t2 like t1; # Sending: flush table t2; -# --> connection con2 +connection con2; drop table t1; -# --> connection con1 +connection con1; unlock tables; -# --> connection default +connection default; # Reaping 'flush table t2'... drop table t2; # @@ -1314,20 +1320,20 @@ drop table t2; # create table t1 (a int, key using btree (a)); insert into t1 values (1), (2); -# --> connection default +connection default; begin; select * from t1; a 1 2 handler t1 open; -# --> connection con1 +connection con1; # Sending: lock tables t1 write; -# --> connection con2 +connection con2; # Check that 'lock tables t1 write' waits until transaction which # has read from the table commits. -# --> connection default +connection default; # The below 'handler t1 read ...' should not be blocked as # 'lock tables t1 write' has not succeeded yet. handler t1 read a next; @@ -1335,24 +1341,28 @@ a 1 # Unblock 'lock tables t1 write'. commit; -# --> connection con1 +connection con1; # Reap 'lock tables t1 write'. -# --> connection default +connection default; # Sending: handler t1 read a next; -# --> connection con1 +connection con1; # Waiting for 'handler t1 read a next' to get blocked... # The below 'drop table t1' should be able to proceed without # waiting as it will force HANDLER to be closed. drop table t1; unlock tables; -# --> connection default +connection default; # Reaping 'handler t1 read a next'... ERROR 42S02: Table 'test.t1' doesn't exist handler t1 close; -# --> connection con1 -# --> connection con2 -# --> connection con3 +connection con1; +disconnect con1; +connection con2; +disconnect con2; +connection con3; +disconnect con3; +connection default; # # A temporary table test. # Check that we don't loose positions of HANDLER opened @@ -1479,8 +1489,8 @@ drop table t2, t3; # Check that when we clone a ticket for HANDLER we downrade # the lock. # -# Establish an auxiliary connection con1. -# -> connection default +connect con1,localhost,root,,; +connection default; create table t1 (a int, b int, key using btree (a)); insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5); begin; @@ -1494,19 +1504,20 @@ handler t1 read a last; a b 7 7 commit; -# -> connection con1 +connection con1; # Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. lock table t1 write; unlock tables; -# -> connection default +connection default; handler t1 read a prev; a b 6 6 handler t1 close; # Cleanup. drop table t1; -# -> connection con1 -# -> connection default +connection con1; +disconnect con1; +connection default; # # A test for Bug#50555 "handler commands crash server in # my_hash_first()". @@ -1635,26 +1646,28 @@ drop tables t1, t2; # bool MDL_context::try_acquire_lock(MDL_request*) # DROP TABLE IF EXISTS t1; -# Connection default +connect con51355, localhost, root; +connection default; CREATE TABLE t1(id INT, KEY id(id)); HANDLER t1 OPEN; -# Connection con51355 +connection con51355; # Sending: DROP TABLE t1; -# Connection default +connection default; # This I_S query will cause the handler table to be closed and # the metadata lock to be released. This will allow DROP TABLE # to proceed. Waiting for the table to be removed. -# Connection con51355 +connection con51355; # Reaping: DROP TABLE t1 -# Connection default +connection default; HANDLER t1 READ id NEXT; ERROR 42S02: Table 'test.t1' doesn't exist HANDLER t1 READ id NEXT; ERROR 42S02: Table 'test.t1' doesn't exist HANDLER t1 CLOSE; -# Connection con51355 -# Connection default +connection con51355; +disconnect con51355; +connection default; # # Bug#54401 assert in Diagnostics_area::set_eof_status , HANDLER # |