Bug #71266 DROP FUNCTION fails if UDF is not loaded completely
Submitted: 1 Jan 2014 11:42 Modified: 29 Jan 2014 17:34
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version:5.6.14 OS:Any
Assigned to: CPU Architecture:Any

[1 Jan 2014 11:42] Daniël van Eeden
Description:
If an UDF is not completly loaded it can't be removed.

How to repeat:
1. Install the JSON UDFs
2. Remove the symlink which is the work-around for Bug #71265
3. Restart the server (The errorlog will show that the UDFs were not loaded completely, but they are listed in mysql.func) 
4. Try to remove the UDFs with DROP FUNCTION

Suggested fix:
1. Add information about whether the plugin is fully loaded or not to information_schema (See Bug #71262)

2a. If a plugin can't be correctly loaded during startup then make sure it doesn't look to be installed at all (i.e. not visible in mysql.func)
2b. Or allow it to be removed if it is not completely loaded (this could be better as it will still reserve the UDF name on startup, which might be better for security.
[1 Jan 2014 11:44] Daniël van Eeden
This should also be documented on http://dev.mysql.com/doc/refman/5.6/en/drop-function-udf.html
[29 Jan 2014 17:34] Sveta Smirnova
Thank you for the report.

Verified as described:

mysql> drop function json_extract;
ERROR 1305 (42000): FUNCTION test.json_extract does not exist
mysql> CREATE FUNCTION json_extract RETURNS string SONAME 'libmy_json_udf.so';
ERROR 1125 (HY000): Function 'json_extract' already exists