summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-security.test
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-06-15 15:42:28 +0200
committerunknown <pem@mysql.comhem.se>2004-06-15 15:42:28 +0200
commit44d2934f0bf11d86ab7491142a4e5ca9d16f3259 (patch)
treeca16586fc071c4e4017d3e2098ebdb4e56eefc5d /mysql-test/t/sp-security.test
parent05f9e4dd0ec743b352eb480ec8eab3af046b745d (diff)
downloadmariadb-git-44d2934f0bf11d86ab7491142a4e5ca9d16f3259.tar.gz
Fixed BUG#3339: Stored procedures in nonexistent schemas are uncallable.
Also added some related security tests and corrected related error messages. mysql-test/r/sp-error.result: New test case for BUG#3339, and updated results for other modified error messages. mysql-test/r/sp-security.result: Added tests for creating procedures in another database with and wihout access rights. mysql-test/t/sp-error.test: New test case for BUG#3339. mysql-test/t/sp-security.test: Added tests for creating procedures in another database with and wihout access rights. sql/sp.cc: Check existance (and access rights) for database when creating a stored routine. sql/sp.h: New error return value for sp_create_* functions, for non existing database. sql/sql_parse.cc: Check error return for create stored routine (non existing database), and corrected the error output for some other commands. (Use qualified name, not just name.)
Diffstat (limited to 'mysql-test/t/sp-security.test')
-rw-r--r--mysql-test/t/sp-security.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 8fc51357bc4..046a9018472 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -17,6 +17,10 @@ drop database if exists db1_secret;
# Create our secret database
create database db1_secret;
+# Can create a procedure in other db
+create procedure db1_secret.dummy() begin end;
+drop procedure db1_secret.dummy;
+
use db1_secret;
create table t1 ( u varchar(64), i int );
@@ -39,6 +43,7 @@ select db();
connect (con2user1,localhost,user1,,);
connect (con3anon,localhost,anon,,);
+
#
# User1 can
#
@@ -52,6 +57,13 @@ select db1_secret.db();
--error 1044
select * from db1_secret.t1;
+# ...and not this
+--error 1049
+create procedure db1_secret.dummy() begin end;
+--error 1298
+drop procedure db1_secret.dummy;
+
+
#
# Anonymous can
#
@@ -65,6 +77,13 @@ select db1_secret.db();
--error 1044
select * from db1_secret.t1;
+# ...and not this
+--error 1049
+create procedure db1_secret.dummy() begin end;
+--error 1298
+drop procedure db1_secret.dummy;
+
+
#
# Check it out
#