summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-security.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-11 17:04:16 -0700
committerunknown <jimw@mysql.com>2005-08-11 17:04:16 -0700
commite0607f0a8366a8a87b87b8eab81926130d0fb322 (patch)
treecdafc43f17feb3e2c94df11c7bcc6df37c52eae3 /mysql-test/t/sp-security.test
parent04e2ca68fff278d20774780db0773112229efcda (diff)
downloadmariadb-git-e0607f0a8366a8a87b87b8eab81926130d0fb322.tar.gz
Avoid spurious error when restoring INFORMATION_SCHEMA as the current
database after failing to execute a stored procedure in an inaccessible database. (Bug #12318) mysql-test/r/sp-security.result: Update results mysql-test/t/sp-security.test: Add regression test sql/mysql_priv.h: Add additional argument to mysql_change_db() sql/sp.cc: Use mysql_change_db(), get rid of sp_change_db(). sql/sp.h: Get rid of sp_change_db(). sql/sql_db.cc: Handle no_access_check flag to mysql_change_db, and remove the send_ok() call. sql/sql_parse.cc: Add extra argument to mysql_change_db(), and call send_ok() after successful calls to same (since it no longer does it for us).
Diffstat (limited to 'mysql-test/t/sp-security.test')
-rw-r--r--mysql-test/t/sp-security.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 15fcba5ebe9..c7c7ef20a5b 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -371,3 +371,39 @@ drop procedure bug7291_0;
disconnect user1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
drop user user1@localhost;
+
+#
+# Bug #12318: Wrong error message when accessing an inaccessible stored
+# procedure in another database when the current database is
+# information_schema.
+#
+
+--disable_warnings
+drop database if exists mysqltest_1;
+--enable_warnings
+
+create database mysqltest_1;
+delimiter //;
+create procedure mysqltest_1.p1()
+begin
+ select 1 from dual;
+end//
+delimiter ;//
+
+grant usage on *.* to mysqltest_1@localhost;
+
+connect (n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection n1;
+--error 1370
+call mysqltest_1.p1();
+disconnect n1;
+
+connection default;
+
+drop procedure mysqltest_1.p1;
+drop database mysqltest_1;
+
+revoke usage on *.* from mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
+
+# End of 5.0 bugs.