summaryrefslogtreecommitdiff
path: root/mysql-test/t/grant.test
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2008-03-05 14:18:35 -0500
committerunknown <cmiller@zippy.cornsilk.net>2008-03-05 14:18:35 -0500
commit2eb67908704727d276cae0d63e5d116511a5fc7d (patch)
treebcc5c17b5d1675183037a745251a0a5abf8bf967 /mysql-test/t/grant.test
parent2b7dda9e9d06f2ab6036da39250a765926c9c437 (diff)
downloadmariadb-git-2eb67908704727d276cae0d63e5d116511a5fc7d.tar.gz
Move test that has more to do with grants than DROP. We shouldn't have
grant warnings on embedded server. mysql-test/r/drop.result: Move test that has more to do with grants than DROP. mysql-test/r/grant.result: Move test that has more to do with grants than DROP. mysql-test/t/drop.test: Move test that has more to do with grants than DROP. mysql-test/t/grant.test: Move test that has more to do with grants than DROP.
Diffstat (limited to 'mysql-test/t/grant.test')
-rw-r--r--mysql-test/t/grant.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 16cccd1a1f4..eb02433c71e 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1377,4 +1377,66 @@ RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
FLUSH PRIVILEGES;
+#
+# Bug#33464: DROP FUNCTION caused a crash.
+#
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (connbug33464, localhost, userbug33464, , dbbug33464);
+--source suite/funcs_1/include/show_connection.inc
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+--enable_warnings
+
+delimiter //;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+ SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+ return 1;
+END//
+delimiter ;//
+
+delimiter //;
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+ return 2;
+END//
+delimiter ;//
+
+disconnect connbug33464;
+
+# cleanup
+connection default;
+USE dbbug33464;
+--source suite/funcs_1/include/show_connection.inc
+
+SELECT fn1();
+SELECT fn2();
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+DROP FUNCTION fn1;
+DROP FUNCTION fn2;
+DROP PROCEDURE sp3;
+
+--error 0, ER_CANNOT_USER
+DROP USER 'userbug33464'@'localhost';
+
+use test;
+DROP DATABASE dbbug33464;
+
+
--echo End of 5.1 tests