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 */
| 481 | - table is already opened and locked |
| 482 | */ |
| 483 | static 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 | |
| 505 | static TABLE *open_udf_func_table(THD *thd) |
no test coverage detected