mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user