Details
-
New Feature
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
UDFs currently must be created using the syntax `CREATE FUNCTION my_udf RETURNS integer SONAME 'libudf_test.so';`. Requiring the user to specify the `RETURNS` type is a source of user unfriendliness, it is easy to type the wrong thing and cause unexpected results or crashes.
This could be improved by allowing UDF plugins to provide a static `enum Item_result` at the symbol `my_udf_returns`; if present, the DB user would then omit the `RETURNS` clause from the `CREATE FUNCTION` expression.
Alternatively, UDFs could provide a static array with a descriptor for each UDFs in the file, which would also allow enumerating and loading all functions available in the SO without manually specifying in SQL. This would probably be something similar to a `udf_func[]`