summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/handler_innodb.result34
-rw-r--r--mysql-test/r/handler_myisam.result34
-rw-r--r--mysql-test/r/mdl_sync.result18
3 files changed, 40 insertions, 46 deletions
diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result
index 807e8becea8..a3e3e325e7d 100644
--- a/mysql-test/r/handler_innodb.result
+++ b/mysql-test/r/handler_innodb.result
@@ -560,36 +560,36 @@ c1
handler t1 close;
handler t2 close;
drop table t1,t2;
-drop table if exists t1,t2;
+drop table if exists t1, t0;
create table t1 (c1 int);
connection: default
handler t1 open;
handler t1 read first;
c1
connection: flush
-rename table t1 to t2;;
+rename table t1 to t0;;
connection: waiter
connection: default
#
# RENAME placed two pending locks and waits.
-# When HANDLER t2 OPEN does open_tables(), it calls
+# When HANDLER t0 OPEN does open_tables(), it calls
# mysql_ha_flush(), which in turn closes the open HANDLER for t1.
# RENAME TABLE gets unblocked. If it gets scheduled quickly
# and manages to complete before open_tables()
-# of HANDLER t2 OPEN, open_tables() and therefore the whole
-# HANDLER t2 OPEN succeeds. Otherwise open_tables()
+# of HANDLER t0 OPEN, open_tables() and therefore the whole
+# HANDLER t0 OPEN succeeds. Otherwise open_tables()
# notices a pending or active exclusive metadata lock on t2
-# and the whole HANDLER t2 OPEN fails with ER_LOCK_DEADLOCK
+# and the whole HANDLER t0 OPEN fails with ER_LOCK_DEADLOCK
# error.
#
-handler t2 open;
-handler t2 close;
+handler t0 open;
+handler t0 close;
connection: flush
handler t1 read next;
ERROR 42S02: Unknown table 't1' in HANDLER
handler t1 close;
ERROR 42S02: Unknown table 't1' in HANDLER
-drop table t2;
+drop table t0;
drop table if exists t1;
create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
@@ -989,8 +989,8 @@ handler t1 close;
#
create table t1 (a int, key a (a));
insert into t1 (a) values (1), (2), (3), (4), (5);
-create table t2 (a int, key a (a));
-insert into t2 (a) values (1), (2), (3), (4), (5);
+create table t0 (a int, key a (a));
+insert into t0 (a) values (1), (2), (3), (4), (5);
begin;
select * from t1;
a
@@ -999,23 +999,19 @@ a
3
4
5
-# --> connection con1
-lock table t2 read;
# --> connection con2
# Sending:
-rename table t2 to t3, t1 to t2, t3 to t1;
+rename table t0 to t3, t1 to t0, t3 to t1;
# --> connection con1
# Waiting for 'rename table ...' to get blocked...
# --> connection default
-handler t2 open;
+handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-select * from t2;
+select * from t0;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
handler t1 open;
commit;
handler t1 close;
-# --> connection con1
-unlock tables;
# --> connection con2
# Reaping 'rename table ...'...
# --> connection default
@@ -1024,7 +1020,7 @@ handler t1 read a prev;
a
5
handler t1 close;
-drop table t2;
+drop table t0;
#
# Originally there was a deadlock error in this test.
# With implementation of deadlock detector
diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result
index adcbf068b97..f5c5bfebd15 100644
--- a/mysql-test/r/handler_myisam.result
+++ b/mysql-test/r/handler_myisam.result
@@ -559,36 +559,36 @@ c1
handler t1 close;
handler t2 close;
drop table t1,t2;
-drop table if exists t1,t2;
+drop table if exists t1, t0;
create table t1 (c1 int);
connection: default
handler t1 open;
handler t1 read first;
c1
connection: flush
-rename table t1 to t2;;
+rename table t1 to t0;;
connection: waiter
connection: default
#
# RENAME placed two pending locks and waits.
-# When HANDLER t2 OPEN does open_tables(), it calls
+# When HANDLER t0 OPEN does open_tables(), it calls
# mysql_ha_flush(), which in turn closes the open HANDLER for t1.
# RENAME TABLE gets unblocked. If it gets scheduled quickly
# and manages to complete before open_tables()
-# of HANDLER t2 OPEN, open_tables() and therefore the whole
-# HANDLER t2 OPEN succeeds. Otherwise open_tables()
+# of HANDLER t0 OPEN, open_tables() and therefore the whole
+# HANDLER t0 OPEN succeeds. Otherwise open_tables()
# notices a pending or active exclusive metadata lock on t2
-# and the whole HANDLER t2 OPEN fails with ER_LOCK_DEADLOCK
+# and the whole HANDLER t0 OPEN fails with ER_LOCK_DEADLOCK
# error.
#
-handler t2 open;
-handler t2 close;
+handler t0 open;
+handler t0 close;
connection: flush
handler t1 read next;
ERROR 42S02: Unknown table 't1' in HANDLER
handler t1 close;
ERROR 42S02: Unknown table 't1' in HANDLER
-drop table t2;
+drop table t0;
drop table if exists t1;
create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
@@ -986,8 +986,8 @@ handler t1 close;
#
create table t1 (a int, key a (a));
insert into t1 (a) values (1), (2), (3), (4), (5);
-create table t2 (a int, key a (a));
-insert into t2 (a) values (1), (2), (3), (4), (5);
+create table t0 (a int, key a (a));
+insert into t0 (a) values (1), (2), (3), (4), (5);
begin;
select * from t1;
a
@@ -996,23 +996,19 @@ a
3
4
5
-# --> connection con1
-lock table t2 read;
# --> connection con2
# Sending:
-rename table t2 to t3, t1 to t2, t3 to t1;
+rename table t0 to t3, t1 to t0, t3 to t1;
# --> connection con1
# Waiting for 'rename table ...' to get blocked...
# --> connection default
-handler t2 open;
+handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-select * from t2;
+select * from t0;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
handler t1 open;
commit;
handler t1 close;
-# --> connection con1
-unlock tables;
# --> connection con2
# Reaping 'rename table ...'...
# --> connection default
@@ -1021,7 +1017,7 @@ handler t1 read a prev;
a
5
handler t1 close;
-drop table t2;
+drop table t0;
#
# Originally there was a deadlock error in this test.
# With implementation of deadlock detector
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result
index 0c9b6432e95..8c4d7272e29 100644
--- a/mysql-test/r/mdl_sync.result
+++ b/mysql-test/r/mdl_sync.result
@@ -23,7 +23,7 @@ SET DEBUG_SYNC= 'RESET';
# Test coverage for basic deadlock detection in metadata
# locking subsystem.
#
-drop tables if exists t1, t2, t3, t4;
+drop tables if exists t0, t1, t2, t3, t4, t5;
create table t1 (i int);
create table t2 (j int);
create table t3 (k int);
@@ -90,7 +90,7 @@ commit;
#
# Switching to connection 'deadlock_con1'.
begin;
-insert into t1 values (2);
+insert into t2 values (2);
#
# Switching to connection 'default'.
# Send:
@@ -98,11 +98,11 @@ rename table t2 to t0, t1 to t2, t0 to t1;;
#
# Switching to connection 'deadlock_con1'.
# Wait until the above RENAME TABLE is blocked because it has to wait
-# for 'deadlock_con1' which holds shared metadata lock on 't1'.
+# for 'deadlock_con1' which holds shared metadata lock on 't2'.
#
# The below statement should not wait as doing so will cause deadlock.
# Instead it should fail and emit ER_LOCK_DEADLOCK statement.
-select * from t2;
+select * from t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
# Let us check that failure of the above statement has not released
@@ -141,7 +141,7 @@ select * from t2;;
# for an exclusive metadata lock to go away.
# Send RENAME TABLE statement that will deadlock with the
# SELECT statement and thus should abort the latter.
-rename table t1 to t0, t2 to t1, t0 to t2;;
+rename table t1 to t5, t2 to t1, t5 to t2;;
#
# Switching to connection 'deadlock_con1'.
# Since the latest RENAME TABLE entered in deadlock with SELECT
@@ -156,15 +156,17 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Commit transaction to unblock this RENAME TABLE.
commit;
#
-# Switching to connection 'deadlock_con3'.
-# Reap RENAME TABLE t1 TO t0 ... .
-#
# Switching to connection 'deadlock_con2'.
# Commit transaction to unblock the first RENAME TABLE.
commit;
#
# Switching to connection 'default'.
# Reap RENAME TABLE t2 TO t0 ... .
+#
+# Switching to connection 'deadlock_con3'.
+# Reap RENAME TABLE t1 TO t5 ... .
+#
+# Switching to connection 'default'.
drop tables t1, t2, t3, t4;
#
# Now, test case which shows that deadlock detection empiric