mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Backport fix for MDEV-29352 to 10.3-10.5
The fix for MDEV-29352 was pushed to 10.6+ but the code causing the bug is old and the bug is unlikely to be a recent regression in 10.6. So, we apply the fix also to older versions, 10.3-10.5. The original commit message: MDEV-29352 SIGSEGV's in strlen and unknown location on optimized builds at SHUTDOWN When the UDF creation frails to write the newly created UDF into the related system table, the UDF is still created in memory. However, as it is now, the related DLL is unloaded in this case right in the mysql_create_function. And failure happens when the UDF handle is freed and tries to unload the respective DLL which is still unloaded.
This commit is contained in:
committed by
Nayuta Yanagisawa
parent
b9c1c07f83
commit
f5e4e15403
@ -606,7 +606,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
|
||||
|
||||
/* Allow creation of functions even if we can't open func table */
|
||||
if (unlikely(!table))
|
||||
goto err;
|
||||
goto err_open_func_table;
|
||||
table->use_all_columns();
|
||||
restore_record(table, s->default_values); // Default values for fields
|
||||
table->field[0]->store(u_d->name.str, u_d->name.length, system_charset_info);
|
||||
@ -620,7 +620,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
|
||||
{
|
||||
my_error(ER_ERROR_ON_WRITE, MYF(0), "mysql.func", error);
|
||||
del_udf(u_d);
|
||||
goto err;
|
||||
goto err_open_func_table;
|
||||
}
|
||||
|
||||
done:
|
||||
@ -635,6 +635,7 @@ done:
|
||||
err:
|
||||
if (new_dl)
|
||||
dlclose(dl);
|
||||
err_open_func_table:
|
||||
mysql_rwlock_unlock(&THR_LOCK_udf);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user