[MDEV-23980] UDF error, no function found error (where?) but function exists Created: 2020-10-19  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Minor
Reporter: Anel Husakovic Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Looking into an example:
1. Install .so in plugin_dir, create UDF and hooray, visible result.
2. Remove .so from plugin_dir and start server again

MariaDB [(none)]> CREATE FUNCTION udf_intexample RETURNS INTEGER SONAME 'udf_staticexample.so';
ERROR 1125 (HY000): Function 'udf_intexample' already exists
MariaDB [(none)]> select udf_intexample();
ERROR 1305 (42000): FUNCTION udf_intexample does not exist
MariaDB [(none)]> select * from mysql.func;
+-------------------+-----+----------------------+----------+
| name              | ret | dl                   | type     |
+-------------------+-----+----------------------+----------+
| udf_staticexample |   2 | udf_staticexample.so | function |
| udf_intexample    |   2 | udf_staticexample.so | function |
+-------------------+-----+----------------------+----------+
2 rows in set (0.000 sec)

So here is some paradox (schrodinger cat) when invoking two statements (supposing we are the user that doesn't know what happened). Function is already installed and visible from mysql.func but no .so exist so nothing can be done. However IMHO it should be closer to the user where to inspect for the problem.
Inspecting the error:

$ ./extra/perror 1305
MySQL error code 1305 (ER_SP_DOES_NOT_EXIST): %s %s does not exist

I think condition should be checked for the file in plugin_dir and create the new message?!


Generated at Thu Feb 08 09:26:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.