diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-04-01 14:07:02 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-04-01 14:07:02 +0400 |
commit | 334e7c9bccbc6892efbb35f5930f80ccf1d770a8 (patch) | |
tree | 7ddc38e5c776a4f82c9a9731f8d6d3a79103eef0 /mysql-test/suite/handler/heap.result | |
parent | cbc5157feb9801310e458f7ed10983ad478c881e (diff) | |
download | mariadb-git-bb-mdev7895.tar.gz |
MDEV-7895 - HANDLER READ doesn't upgrade metadata lock from S to SRbb-mdev7895
Change code for HANDLER READ statements to upgrade S metadata lock to
SR metadata lock for the duration of read. This allows us properly
isolate HANDLER READ from LOCK TABLES WRITE and makes metadata locking
for these statements consistent with locking for other DML.
HANDLER-related tests had to be adjusted to take into account that
HANDLER READ will wait for and acquire SR lock.
Diffstat (limited to 'mysql-test/suite/handler/heap.result')
-rw-r--r-- | mysql-test/suite/handler/heap.result | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result index 527986edb5c..15522c5a71e 100644 --- a/mysql-test/suite/handler/heap.result +++ b/mysql-test/suite/handler/heap.result @@ -977,12 +977,10 @@ drop table t1 ; # --> connection con2 # Waitng for 'drop table t1' to get blocked... # --> connection default +# Attempt to upgrade metadata locks to SR from S will lead to +# deadlock which will result in table being automatically closed. handler t1 read a prev; -a b -5 NULL -handler t1 read a prev; -a b -4 NULL +ERROR 42S02: Table 'test.t1' doesn't exist handler t1 close; # --> connection con1 # Reaping 'drop table t1'... @@ -1026,20 +1024,16 @@ a # thus we can reopen it in the handler handler t1 open; # We can commit the transaction, it doesn't close the handler -# and doesn't let DROP to proceed. +# and doesn't let DROP to proceed immediately. commit; +# Waiting for 'drop table t1' to get blocked... +# --> connection default +# OTOH the first attempt to read from HANDLER will lead to metadata +# locks deadlock and thus to HANDLER being automatically closed. handler t1 read a prev; -a -5 -handler t1 read a prev; -a -4 -handler t1 read a prev; -a -3 +ERROR 42S02: Table 'test.t1' doesn't exist handler t1 close; # --> connection con1 -# Now drop can proceed # Reaping 'drop table t1'... # --> connection default # @@ -1156,15 +1150,13 @@ rollback to savepoint sv; # Reaping 'drop table t2'... # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler # lock. +# --> connection con3 +# Check if 'drop table t1' still blocked... # --> connection default +# Demonstrate that the drop will go through as soon as we close +# or will try to access HANDLER handler t1 read a next; -a -3 -handler t1 read a next; -a -4 -# Demonstrate that the drop will go through as soon as we close the -# HANDLER +ERROR 42S02: Table 'test.t1' doesn't exist handler t1 close; # connection con1 # Reaping 'drop table t1'... @@ -1215,15 +1207,13 @@ rollback to savepoint sv; # Reaping 'drop table t2'... # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler # lock. +# --> connection con3 +# Check if 'drop table t1' is still blocked... # --> connection default +# Demonstrate that the drop will go through as soon as we access or +# close the HANDLER handler t1 read a next; -a -3 -handler t1 read a next; -a -4 -# Demonstrate that the drop will go through as soon as we close the -# HANDLER +ERROR 42S02: Table 'test.t1' doesn't exist handler t1 close; # connection con1 # Reaping 'drop table t1'... @@ -1261,14 +1251,12 @@ drop table t3; # Let DROP TABLE statement sync in. # --> connection con2 # Waiting for 'drop table t3' to get blocked... -# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler -# lock. +# The fact that DROP TABLE is blocked means that ROLLBACK TO SAVEPOINT +# didn't release the handler lock. # --> connection default +# Drop will go through as soon as we access or close the HANDLER handler t3 read a next; -a -2 -# Demonstrate that the drop will go through as soon as we close the -# HANDLER +ERROR 42S02: Table 'test.t3' doesn't exist handler t3 close; # connection con1 # Reaping 'drop table t3'... |