summaryrefslogtreecommitdiff
path: root/mysql-test/r/drop.result
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2008-03-05 09:33:32 -0500
committerunknown <cmiller@zippy.cornsilk.net>2008-03-05 09:33:32 -0500
commit2b7dda9e9d06f2ab6036da39250a765926c9c437 (patch)
tree67a859a3e544f564207c248ced593901dcb13c79 /mysql-test/r/drop.result
parent6262c056fa8cff69073d3f9f58692d64ec4d2b60 (diff)
downloadmariadb-git-2b7dda9e9d06f2ab6036da39250a765926c9c437.tar.gz
Bug#33464: DROP FUNCTION caused a crash
The cause of the crash is an assertion failure that we do not emit an error message (grant not found) and then return "ok". The assertion is valid, and we were ignoring the buggy behavior prior to the "Diagnostics" result-verification. Use an error handler to mutate innocuous missing-grant errors, when removing routines, into warnings. mysql-test/r/drop.result: Show that the crash disappears. Also prepare for the larger bug to be fixed with only minor changes to this test. mysql-test/t/drop.test: Show that the crash disappears. Also prepare for the larger bug to be fixed with only minor changes to this test. sql/sql_acl.cc: Disable a segment of code that makes a faulty assumption about the existence of a routine's defining user, until that assumption becomes true. Push a new handler onto the error-handler stack, so that when removing a routine, a missing ACL grant is now a warning instead of an error. If any unexpected error is raised then tell the caller.
Diffstat (limited to 'mysql-test/r/drop.result')
-rw-r--r--mysql-test/r/drop.result39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 71d6fcc7cd0..b4f6395819f 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -91,4 +91,43 @@ create table mysql_test.`#sql-347f_7` (f1 int);
create table mysql_test.`#sql-347f_8` (f1 int);
drop table mysql_test.`#sql-347f_8`;
drop database mysql_test;
+CREATE DATABASE dbbug33464;
+CREATE USER 'userbug33464'@'localhost';
+GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+
+userbug33464@localhost dbbug33464
+DROP PROCEDURE IF EXISTS sp3;
+DROP FUNCTION IF EXISTS fn1;
+CREATE PROCEDURE sp3(v1 char(20))
+BEGIN
+SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
+END//
+CREATE FUNCTION fn1() returns char(50) SQL SECURITY INVOKER
+BEGIN
+return 1;
+END//
+CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
+BEGIN
+return 2;
+END//
+USE dbbug33464;
+
+root@localhost dbbug33464
+SELECT fn1();
+fn1()
+1
+SELECT fn2();
+fn2()
+2
+DROP USER 'userbug33464'@'localhost';
+DROP FUNCTION fn1;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
+DROP FUNCTION fn2;
+Warnings:
+Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
+DROP PROCEDURE sp3;
+DROP USER 'userbug33464'@'localhost';
+use test;
+DROP DATABASE dbbug33464;
End of 5.1 tests