summaryrefslogtreecommitdiff
path: root/sql/sql_udf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r--sql/sql_udf.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 3b362bf3e3f..4cecebfa90c 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -147,7 +147,7 @@ void udf_init()
tables.lock_type = TL_READ;
tables.db=new_thd->db;
- if (open_tables(new_thd, &tables))
+ if (open_and_lock_tables(new_thd, &tables))
{
DBUG_PRINT("error",("Can't open udf table"));
sql_print_error("Can't open mysql/func table");
@@ -233,6 +233,11 @@ void udf_free()
}
hash_free(&udf_hash);
free_root(&mem,MYF(0));
+ if (initialized)
+ {
+ initialized= 0;
+ pthread_mutex_destroy(&THR_LOCK_udf);
+ }
DBUG_VOID_RETURN;
}