diff options
author | unknown <SergeyV@selena.> | 2006-02-27 16:27:34 +0300 |
---|---|---|
committer | unknown <SergeyV@selena.> | 2006-02-27 16:27:34 +0300 |
commit | 51316b017aebb9879d519c27f10742bdd718d01e (patch) | |
tree | 47b89079e617880b2af2982d2217491d1dd8368d /sql/sql_udf.cc | |
parent | b97082c5836a48ff792183c555dcc3f41f0d5453 (diff) | |
download | mariadb-git-51316b017aebb9879d519c27f10742bdd718d01e.tar.gz |
Fixes bug #17595. UDFs are not initialized when running mysqld with
--skip-grant-tables. However when deleting functions UDFs list was checked
regardless of whther UDFs are initialized or not. Additional check is added
into free_udf() and find_udf() functions to prevent possible runtime errors.
mysql-test/r/skip_grants.result:
Test result for #17595 patch.
mysql-test/t/skip_grants.test:
Test for #17595 patch.
Diffstat (limited to 'sql/sql_udf.cc')
-rw-r--r-- | sql/sql_udf.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 40e5a9a00cf..3f8a4e346f9 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -308,6 +308,10 @@ static void del_udf(udf_func *udf) void free_udf(udf_func *udf) { DBUG_ENTER("free_udf"); + + if (!initialized) + DBUG_VOID_RETURN; + rw_wrlock(&THR_LOCK_udf); if (!--udf->usage_count) { @@ -332,6 +336,9 @@ udf_func *find_udf(const char *name,uint length,bool mark_used) udf_func *udf=0; DBUG_ENTER("find_udf"); + if (!initialized) + DBUG_RETURN(NULL); + /* TODO: This should be changed to reader locks someday! */ if (mark_used) rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ |