summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2006-02-01 14:46:30 +0100
committerunknown <pem@mysql.com>2006-02-01 14:46:30 +0100
commit8a7bbefc2fbd99d21a9fda19e8667bc23eec7d72 (patch)
treebfb6744f494b1b4d0c49852fc2994b91b116cea3 /mysql-test
parent94d4b0017b9201569568e3a2e07d71383cb8c541 (diff)
downloadmariadb-git-8a7bbefc2fbd99d21a9fda19e8667bc23eec7d72.tar.gz
Added new test case for BUG#14533: 'desc tbl' in stored procedure causes error 1142
which is no longer repeatable. (Unclear when this was fixed.) mysql-test/r/sp-security.result: Updated results for new test case (BUG#14533) mysql-test/t/sp-security.test: New test case for BUG#14533.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp-security.result23
-rw-r--r--mysql-test/t/sp-security.test38
2 files changed, 61 insertions, 0 deletions
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index b223c0cd487..ff729e87f97 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -291,3 +291,26 @@ drop user user1_bug14834@localhost;
drop user user2_bug14834@localhost;
drop user user3_bug14834@localhost;
drop database db_bug14834;
+create database db_bug14533;
+use db_bug14533;
+create table t1 (id int);
+create user user_bug14533@localhost identified by '';
+create procedure bug14533_1()
+sql security definer
+desc db_bug14533.t1;
+create procedure bug14533_2()
+sql security definer
+select * from db_bug14533.t1;
+grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
+grant execute on procedure db_bug14533.bug14533_2 to user_bug14533@localhost;
+call db_bug14533.bug14533_1();
+Field Type Null Key Default Extra
+id int(11) YES NULL
+call db_bug14533.bug14533_2();
+id
+desc db_bug14533.t1;
+ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
+select * from db_bug14533.t1;
+ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
+drop user user_bug14533@localhost;
+drop database db_bug14533;
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 223bc09b9fc..90160780618 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -487,4 +487,42 @@ drop user user2_bug14834@localhost;
drop user user3_bug14834@localhost;
drop database db_bug14834;
+
+#
+# BUG#14533: 'desc tbl' in stored procedure causes error 1142
+#
+create database db_bug14533;
+use db_bug14533;
+create table t1 (id int);
+create user user_bug14533@localhost identified by '';
+
+create procedure bug14533_1()
+ sql security definer
+ desc db_bug14533.t1;
+
+create procedure bug14533_2()
+ sql security definer
+ select * from db_bug14533.t1;
+
+grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
+grant execute on procedure db_bug14533.bug14533_2 to user_bug14533@localhost;
+
+connect (user_bug14533,localhost,user_bug14533,,test);
+
+# These should work
+call db_bug14533.bug14533_1();
+call db_bug14533.bug14533_2();
+
+# For reference, these should not work
+--error ER_TABLEACCESS_DENIED_ERROR
+desc db_bug14533.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from db_bug14533.t1;
+
+# Cleanup
+connection default;
+disconnect user_bug14533;
+drop user user_bug14533@localhost;
+drop database db_bug14533;
+
# End of 5.0 bugs.