summaryrefslogtreecommitdiff
path: root/sql
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 /sql
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 'sql')
-rw-r--r--sql/sql_udf.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 163801e2f1e..5bbfa522d58 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -536,7 +536,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
tables.table_name= tables.alias= (char*) "func";
if (!(table = open_ltable(thd,&tables,TL_WRITE)))
goto err;
- table->field[0]->store(udf_name->str, udf_name->length, system_charset_info);
+ table->field[0]->store(udf->name.str, udf->name.length, &my_charset_bin);
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
if (!table->file->index_read_idx(table->record[0], 0,
(byte*) table->field[0]->ptr,