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

Possible parser mistake - VERSIONING is allowed as identifier

    XMLWordPrintable

Details

    Description

      The following erroneous statement

      MariaDB [test]> create or replace table t1 (i int) with versioning partition by system_time interval 1 day (partition p0 versioning, partition pn as of current_timestamp);
      

      naturally ends with a syntax error, however the hint about the error location is not helpful:

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition by system_time interval 1 day (partition p0 versioning, partition pn a' at line 1
      

      WITH <something> clause is accepted here because we can have a CTE in the CREATE statement

      MariaDB [test]> create table t1 (i int) with foo as (select 1) select * from foo;
      Query OK, 1 row affected (0.16 sec)
      

      and versioning is accepted as a CTE name (or as any other identifier, for that matter):

      MariaDB [test]> with versioning as (select 1) select * from versioning;
      +---+
      | 1 |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
       
      MariaDB [test]> create table versioning (i int);
      Query OK, 0 rows affected (0.19 sec)
      

      The standard says VERSIONING is a reserved word, so I'm not sure it should be allowed as an identifier.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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