diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index c979ee34df0..ff7d71b3384 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -503,4 +503,14 @@ ERROR 0A000: LOCK is not allowed in stored procedures create procedure bug6600() unlock table t1| ERROR 0A000: UNLOCK is not allowed in stored procedures +drop procedure if exists bug9566| +create procedure bug9566() +begin +select * from t1; +end| +lock table t1 read| +call bug9566()| +ERROR HY000: Table 'proc' was not locked with LOCK TABLES +unlock tables| +drop procedure bug9566| drop table t1| diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index cb0ae310ceb..daad032b854 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2779,14 +2779,4 @@ a 3.2000 drop procedure bug8937| delete from t1| -drop procedure if exists bug9566| -create procedure bug9566() -begin -select * from t1; -end| -lock table t1 read| -call bug9566()| -ERROR HY000: Table 'proc' was not locked with LOCK TABLES -unlock tables| -drop procedure bug9566| drop table t1,t2; diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 621700b732a..51776453730 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -696,6 +696,29 @@ create procedure bug6600() create procedure bug6600() unlock table t1| +# +# BUG#9566: explicit LOCK TABLE and store procedures result in illegal state +# +# We should not think that mysql.proc table does not exist if we are unable +# to open it under LOCK TABLE or in prelocked mode. Probably this test +# should be removed when Monty will allow access to mysql.proc without +# locking it. +# +--disable_warnings +drop procedure if exists bug9566| +--enable_warnings +create procedure bug9566() +begin + select * from t1; +end| +lock table t1 read| +# This should fail because we forgot to lock mysql.proc table explicitly +--error 1100 +call bug9566()| +unlock tables| +# This should succeed +drop procedure bug9566| + # # BUG#NNNN: New bug synopsis diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 799e88a6615..a741a4af7d8 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3397,29 +3397,6 @@ call bug8937()| drop procedure bug8937| delete from t1| -# -# BUG#9566: explicit LOCK TABLE and store procedures result in illegal state -# -# We should not think that mysql.proc table does not exist if we are unable -# to open it under LOCK TABLE or in prelocked mode. Probably this test -# should be removed when Monty will allow access to mysql.proc without -# locking it. -# ---disable_warnings -drop procedure if exists bug9566| ---enable_warnings -create procedure bug9566() -begin - select * from t1; -end| -lock table t1 read| -# This should fail because we forgot to lock mysql.proc table explicitly ---error 1100 -call bug9566()| -unlock tables| -# This should succeed -drop procedure bug9566| - # # BUG#NNNN: New bug synopsis