MCPcopy Create free account
hub / github.com/MariaDB/server / mysql_drop_function_internal

Function mysql_drop_function_internal

sql/sql_udf.cc:483–502  ·  view source on GitHub ↗

Drop user defined function. @param thd Thread handler. @param udf Existing udf_func pointer which is to be deleted. @param table mysql.func table reference (opened and locked) Assumption - udf is not null. - table is already opened and locked */

Source from the content-addressed store, hash-verified

481 - table is already opened and locked
482*/
483static int mysql_drop_function_internal(THD *thd, udf_func *udf, TABLE *table)
484{
485 DBUG_ENTER("mysql_drop_function_internal");
486
487 const LEX_CSTRING exact_name= udf->name;
488
489 del_udf(udf);
490 /*
491 Close the handle if this was function that was found during boot or
492 CREATE FUNCTION and it's not in use by any other udf function
493 */
494 if (udf->dlhandle && !find_udf_dl(udf->dl))
495 dlclose(udf->dlhandle);
496
497 if (!table)
498 DBUG_RETURN(1);
499
500 bool ret= remove_udf_in_table(exact_name, table);
501 DBUG_RETURN(ret);
502}
503
504
505static TABLE *open_udf_func_table(THD *thd)

Callers 2

mysql_create_functionFunction · 0.85
mysql_drop_functionFunction · 0.85

Calls 3

del_udfFunction · 0.85
find_udf_dlFunction · 0.85
remove_udf_in_tableFunction · 0.85

Tested by

no test coverage detected