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

A few Reserved Words are allowed to use as Column/Table name

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.5.11
    • N/A
    • Parser
    • None

    Description

      One of our customer noted that from the list of Reserved words - https://mariadb.com/kb/en/reserved-words/ a few of them, they can able to use it as a table name/column name.

      Following Reserved words - can be specified as a table/column name
      GENERAL
      IGNORE_SERVER_IDS
      MASTER_HEARTBEAT_PERIOD
      OFFSET
      OPTION
      POSITION
      SLOW
      WINDOW

      I found an existing bug - MDEV-10312, noted about this and marked as "not a bug", mentioning only keywords that are required by the grammar to be reserved are reserved.

      But, the customer pointed one case, that with the Reserved word - POSITION

      • without space in the CREATE TABLE statement getting syntax error -expected behavior
      • with space able to create the table with name POSITION

      ## without space:
      MariaDB [test]> create table POSITION(i int);
      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 'POSITION(i int)' at line 1
      ## with space:
      MariaDB [test]> create table POSITION (i int);
      Query OK, 0 rows affected (0.005 sec) 
      MariaDB [test]> select @@version;
      +-----------------+
      | @@version       |
      +-----------------+
      | 10.5.11-MariaDB |
      +-----------------+
      1 row in set (0.000 sec)
      

      If I checked with other reserved word, for both cases getting syntax error, expected behavior:

      MariaDB [test]> create table FALSE (i int);
      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 'FALSE (i int)' at line 1
      MariaDB [test]> create table FALSE(i int);
      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 'FALSE(i int)' at line 1
      MariaDB [test]>
      

      Can this be fixed.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            suresh.ramagiri@mariadb.com suresh ramagiri
            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.