summaryrefslogtreecommitdiff
path: root/mysql-test/t/udf.test
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-12-15 11:38:30 +0200
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-12-15 11:38:30 +0200
commitacf0636e2e127106e1101a7e0f217b12fb2ceeff (patch)
treedf2f64395252ec20e031ba60b245723dca2b6671 /mysql-test/t/udf.test
parent2f78d5ca81e39c55aa918758a1f9b4e46ce76d74 (diff)
downloadmariadb-git-acf0636e2e127106e1101a7e0f217b12fb2ceeff.tar.gz
Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
the UDF When deleting a user defined function MySQL must remove it from both the in-memory hash table and the mysql.proc system table. Finding (and removal therefore) from the internal hash table is case insensitive (or whatever the default charset is), whereas finding and removal from the system table is case sensitive. As a result if you supply a function name that is not in the same character case to DROP FUNCTION the server will remove the function only from the in-memory hash table and will keep the row in mysql.proc system table. This will cause inconsistency between the two structures (that is fixed only by restarting the server). Fixed by using the name in the precise case (from the in-memory hash table) to delete the row in the mysql.proc system table. mysql-test/r/udf.result: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - test case mysql-test/t/udf.test: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - test case sql/sql_udf.cc: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - use the exact function name in deleting from mysql.proc.
Diffstat (limited to 'mysql-test/t/udf.test')
-rw-r--r--mysql-test/t/udf.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test
index 52ae424e423..65cbc7ae3ae 100644
--- a/mysql-test/t/udf.test
+++ b/mysql-test/t/udf.test
@@ -188,6 +188,23 @@ DROP FUNCTION reverse_lookup;
DROP FUNCTION avgcost;
#
+# Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
+# the UDF
+#
+select * from mysql.func;
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
+
+select IS_const(3);
+
+drop function IS_const;
+
+select * from mysql.func;
+
+--error 1305
+select is_const(3);
+
+#
# Bug#18761: constant expression as UDF parameters not passed in as constant
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB