summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-error.test
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2005-07-13 15:08:13 +0400
committerunknown <dlenev@mysql.com>2005-07-13 15:08:13 +0400
commit9aa15040628a45cbb269a4187931e82023df1e89 (patch)
tree27047290ecb242a0a2f69b3875b188156034bba9 /mysql-test/t/sp-error.test
parent9ea8a51178e5315957d862de2eed38df2afe9161 (diff)
parent11f9e513d7080c9965e13211d88840960d5ffebb (diff)
downloadmariadb-git-9aa15040628a45cbb269a4187931e82023df1e89.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc mysql-test/r/sp-error.result: Auto merged mysql-test/t/sp-error.test: Auto merged sql/mysql_priv.h: Auto merged sql/sp.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/share/errmsg.txt: Manual merge. sql/sp.cc: Manual merge.
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r--mysql-test/t/sp-error.test33
1 files changed, 28 insertions, 5 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 7750071c715..7f567449311 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -387,6 +387,29 @@ drop procedure p|
#
+# Let us test that we can access mysql.proc table for routines
+# definitions lookup without locking it explicitly.
+#
+create procedure p() begin end|
+lock table t1 read|
+# This should succeed
+call p()|
+unlock tables|
+drop procedure p|
+# Let us check restrictions which this ability puts on mysql.proc locking.
+--error ER_WRONG_LOCK_OF_SYSTEM_TABLE
+lock tables t1 read, mysql.proc write|
+--error ER_WRONG_LOCK_OF_SYSTEM_TABLE
+lock tables mysql.proc write, mysql.user write|
+# Locking for read should be OK
+lock tables t1 read, mysql.proc read|
+unlock tables|
+# You also should be able lock only mysql.proc for write
+lock tables mysql.proc write|
+unlock tables|
+
+
+#
# BUG#1965
#
create procedure bug1965()
@@ -676,9 +699,7 @@ create procedure bug6600()
# 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.
+# to open it under LOCK TABLE or in prelocked mode.
#
--disable_warnings
drop procedure if exists bug9566|
@@ -688,9 +709,11 @@ begin
select * from t1;
end|
lock table t1 read|
-# This should fail because we forgot to lock mysql.proc table explicitly
+# This should fail since we forgot to lock mysql.proc for writing
+# explicitly, and we can't open mysql.proc for _writing_ if there
+# are locked tables.
--error 1100
-call bug9566()|
+alter procedure bug9566 comment 'Some comment'|
unlock tables|
# This should succeed
drop procedure bug9566|