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

Add support for deterministic functions in virtual columns

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Virtual Columns
    • None

    Description

      A current limitation of virtual columns is that they do not allow stored functions in their definitions, even if the function is deterministic.

      The current workaround is to use a view that uses the stored functions to define its columns. However, this adds complexity to DB architecture by introducing a new table.

      Since ensuring that virtual column definitions are deterministic is important, only stored functions marked as DETERMINISTIC should be allowed in virtual column definitions. One implementation question is whether Maria should check to enforce that the functions marked as deterministic really are as deterministic as they claim or if we leave it as the DBA's responsibility to ensure the functions they mark as deterministic really will return the same result every time they have the same inputs.

      Attachments

        Activity

          bradlanier Brad Lanier added a comment -

          Please just leave the deterministic question to the DBA's for now so that we can get this implemented. You can add the deeper analysis later if the demand is there.

          bradlanier Brad Lanier added a comment - Please just leave the deterministic question to the DBA's for now so that we can get this implemented. You can add the deeper analysis later if the demand is there.

          I agree with Brad - if there is a stored function marked as deterministic, then it should be allowed to be used in a virtual column. If the function is marked as deterministic but isn't, then the output can be stale or undefined.

          dbristow Duncan Bristow added a comment - I agree with Brad - if there is a stored function marked as deterministic, then it should be allowed to be used in a virtual column. If the function is marked as deterministic but isn't, then the output can be stale or undefined.
          jkavalik Jiri Kavalik added a comment -

          Any plan for this?
          I agree with what has been written already - if the function is defined as deterministic then that should be enough.
          If a (non)deterministic function could be identified automatically, there would be no need for the keyword in the create statement and even now the documentation specifically states that "If you declare a non-deterministic function as DETERMINISTIC, you may get incorrect results.".

          jkavalik Jiri Kavalik added a comment - Any plan for this? I agree with what has been written already - if the function is defined as deterministic then that should be enough. If a (non)deterministic function could be identified automatically, there would be no need for the keyword in the create statement and even now the documentation specifically states that "If you declare a non-deterministic function as DETERMINISTIC, you may get incorrect results." .

          People

            Unassigned Unassigned
            cjm Chris J.M.
            Votes:
            7 Vote for this issue
            Watchers:
            12 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.