Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34115

Allow UDFs to specify their return type from the binary

    XMLWordPrintable

Details

    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[]`

      Attachments

        Activity

          People

            Unassigned Unassigned
            tgross35 Trevor Gross
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.