@@ -2785,21 +2785,11 @@ let $wait_condition=
27852785--source include/wait_condition.inc
27862786--echo #
27872787--echo # The below statement should not wait as doing so will cause deadlock.
2788- --echo # Instead it should fail and emit ER_LOCK_DEADLOCK statement.
2788+ --echo # Instead it should fail and emit ER_LOCK_DEADLOCK statement and
2789+ --echo # transaction should be rolled back.
27892790--error ER_LOCK_DEADLOCK
27902791select * from t1;
27912792
2792- --echo #
2793- --echo # Let us check that failure of the above statement has not released
2794- --echo # metadata lock on table 't1', i.e. that RENAME TABLE is still blocked.
2795- let $wait_condition=
2796- select count(*) = 1 from information_schema.processlist
2797- where state = "Waiting for table metadata lock" and
2798- info = "rename table t2 to t0, t1 to t2, t0 to t1";
2799- --source include/wait_condition.inc
2800- --echo # Commit transaction to unblock RENAME TABLE.
2801- commit;
2802-
28032793--echo #
28042794--echo # Switching to connection 'default'.
28052795connection default;
@@ -2862,23 +2852,11 @@ unlock tables;
28622852connection deadlock_con1;
28632853--echo # Since the latest RENAME TABLE entered in deadlock with SELECT
28642854--echo # statement the latter should be aborted and emit ER_LOCK_DEADLOCK
2865- --echo # error.
2855+ --echo # error and transaction should be rolled back .
28662856--echo # Reap SELECT * FROM t1.
28672857--error ER_LOCK_DEADLOCK
28682858--reap
28692859
2870- --echo #
2871- --echo # Again let us check that failure of the SELECT statement has not
2872- --echo # released metadata lock on table 't2', i.e. that the latest RENAME
2873- --echo # is blocked.
2874- let $wait_condition=
2875- select count(*) = 1 from information_schema.processlist
2876- where state = "Waiting for table metadata lock" and
2877- info = "rename table t1 to t0, t2 to t1, t0 to t2";
2878- --source include/wait_condition.inc
2879- --echo # Commit transaction to unblock this RENAME TABLE.
2880- commit;
2881-
28822860--echo #
28832861--echo # Switching to connection 'deadlock_con2'.
28842862connection deadlock_con2;
@@ -2927,22 +2905,11 @@ let $wait_condition=
29272905--source include/wait_condition.inc
29282906
29292907--echo # The below statement should not wait as it will cause deadlock.
2930- --echo # An appropriate error should be reported instead.
2908+ --echo # An appropriate error should be reported instead and transaction
2909+ --echo # should be rolled back.
29312910--error ER_LOCK_DEADLOCK
29322911select * from t2;
29332912
2934- --echo # Again let us check that failure of the above statement has not
2935- --echo # released all metadata locks in connection 'deadlock_con1' and
2936- --echo # so ALTER TABLE ... RENAME is still blocked.
2937- let $wait_condition=
2938- select count(*) = 1 from information_schema.processlist
2939- where state = "Waiting for table metadata lock" and
2940- info = "alter table t1 add column j int, rename to t2";
2941- --source include/wait_condition.inc
2942-
2943- --echo # Commit transaction to unblock ALTER TABLE ... RENAME.
2944- commit;
2945-
29462913--echo #
29472914--echo # Switching to connection 'default'.
29482915connection default;
@@ -3814,19 +3781,6 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
38143781--error ER_LOCK_DEADLOCK
38153782update t1 set c3=c3+1 where c2 = 3;
38163783
3817- --echo #
3818- --echo # Let us check that failure of the above statement has not released
3819- --echo # metadata lock on table 't1', i.e. that ALTER TABLE is still blocked.
3820- let $wait_condition=
3821- select count(*) = 1 from information_schema.processlist
3822- where state = "Waiting for table metadata lock" and
3823- info = "alter table t1 add column e int, rename to t2";
3824- --source include/wait_condition.inc
3825-
3826- --echo # Unblock ALTER TABLE by commiting transaction and thus releasing
3827- --echo # metadata lock on 't1'.
3828- commit;
3829-
38303784--echo #
38313785--echo # Switching to connection 'con46273'.
38323786connection con46273;
0 commit comments