summaryrefslogtreecommitdiff
path: root/mysql-test/t/skip_grants.test
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-11-09 13:29:43 +0300
committerunknown <kaa@polly.(none)>2007-11-09 13:29:43 +0300
commit737cdfeaeb4efc8f0ddd366d77860334bec40df3 (patch)
tree9a34bd787cb00e8a65e163cb3d759277c023b56f /mysql-test/t/skip_grants.test
parent04311fabaa11105743ce124de283cd504c978cc4 (diff)
downloadmariadb-git-737cdfeaeb4efc8f0ddd366d77860334bec40df3.tar.gz
Fix for bug #32020: loading udfs while --skip-grant-tables is enabled
causes out of memory errors The code in mysql_create_function() and mysql_drop_function() assumed that the only reason for UDFs being uninitialized at that point is an out-of-memory error during initialization. However, another possible reason for that is the --skip-grant-tables option in which case UDF initialization is skipped and UDFs are unavailable. The solution is to check whether mysqld is running with --skip-grant-tables and issue a proper error in such a case. mysql-test/r/skip_grants.result: Added a test case for bug #32020. mysql-test/t/skip_grants.test: Added a test case for bug #32020. sql/sql_udf.cc: Issue a proper error when a user tries to CREATE/DROP a UDF on a server running with the --skip-grant-tables option.
Diffstat (limited to 'mysql-test/t/skip_grants.test')
-rw-r--r--mysql-test/t/skip_grants.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 75694672a17..02a381063ee 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -116,3 +116,15 @@ select count(*) from information_schema.COLUMN_PRIVILEGES;
select count(*) from information_schema.SCHEMA_PRIVILEGES;
select count(*) from information_schema.TABLE_PRIVILEGES;
select count(*) from information_schema.USER_PRIVILEGES;
+
+#
+# Bug #32020: loading udfs while --skip-grant-tables is enabled causes out of
+# memory errors
+#
+
+--error ER_CANT_INITIALIZE_UDF
+CREATE FUNCTION a RETURNS STRING SONAME '';
+--error ER_SP_DOES_NOT_EXIST
+DROP FUNCTION a;
+
+--echo End of 5.0 tests