summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
authorgkodinov/kgeorge@macbook.gmz <>2006-12-15 11:38:30 +0200
committergkodinov/kgeorge@macbook.gmz <>2006-12-15 11:38:30 +0200
commitd56d3a697136fc4e80abb2da9d18aadffa201d7e (patch)
treedf2f64395252ec20e031ba60b245723dca2b6671 /sql/sql_udf.cc
parent026196c4ef3217491d22959bafde1cea40f9667b (diff)
downloadmariadb-git-d56d3a697136fc4e80abb2da9d18aadffa201d7e.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.
Diffstat (limited to 'sql/sql_udf.cc')
-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,