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

Confusing error message upon attempt to create an indexed virtual column with partially supported functions

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Trivial
    • Resolution: Unresolved
    • 10.2
    • 10.2
    • Virtual Columns
    • None

    Description

      Note: I've seen from the tests that it's expected for now, but I think it could be improved.

      This works

      MariaDB [test]> create table t1 (a datetime as (now()) VIRTUAL);
      Query OK, 0 rows affected (0.40 sec)
      

      This does not work

      MariaDB [test]> create table t2 (a datetime as (now()) VIRTUAL, INDEX(a));
      ERROR 1901 (HY000): Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `a`
      

      The problem is not that it doesn't work, but that it pretends that NOW cannot be used at all, while it's only so for indexed columns. Maybe we need a different error message if there is no suitable one.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.