summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2004-03-19 14:35:00 +0400
committerunknown <gluh@gluh.mysql.r18.ru>2004-03-19 14:35:00 +0400
commit433c2bf535ff190933d7a7463c56bfef878b3cd2 (patch)
treea81846faa22cac23aaa92ef3aa21497e3f9eb2ff /sql/sql_udf.cc
parent44452dfa77cb209fe58af3cc2f9c2198006b9ca7 (diff)
downloadmariadb-git-433c2bf535ff190933d7a7463c56bfef878b3cd2.tar.gz
Fix for bug#1439 UDF Corruption
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index a4461beed29..561f79f9de1 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -298,7 +298,11 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
DBUG_ENTER("find_udf");
/* TODO: This should be changed to reader locks someday! */
- rw_rdlock(&THR_LOCK_udf);
+ if (mark_used)
+ rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */
+ else
+ rw_rdlock(&THR_LOCK_udf); /* Called during parsing */
+
if ((udf=(udf_func*) hash_search(&udf_hash,(byte*) name,
length ? length : (uint) strlen(name))))
{
@@ -474,7 +478,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str,
(uint) udf_name->length)))
{
- net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name);
+ net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name->str);
goto err;
}
del_udf(udf);