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

Column name starting with digit fails without backticks in 11.4.11 (regression from 11.4.10)

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      A regression has been identified in MariaDB 11.4.11 where column names starting with a digit can no longer be referenced without backtick escaping in SELECT statements. This worked correctly in 11.4.10.

      Steps to reproduce:

      MariaDB [(none)]> SELECT version();
      +---------------------------+
      | version()                 |
      +---------------------------+
      | 11.4.11-MariaDB-deb12-log |
      +---------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> CREATE DATABASE DBTEST;
      Query OK, 1 row affected (0.002 sec)
       
      MariaDB [(none)]> USE DBTEST;
      Database changed
       
      MariaDB [DBTEST]> CREATE TABLE test (`123col` INT);
      Query OK, 0 rows affected (0.004 sec)
       
      MariaDB [DBTEST]> SELECT 123col FROM test;
      Empty set (0.000 sec)
       
      MariaDB [DBTEST]> SELECT test.123col FROM test;
      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 '.123col FROM test' at line 1
       
      MariaDB [DBTEST]> SELECT test.`123col` FROM test;
      Empty set (0.000 sec)
      

      Worked in 11.4.10, fails in 11.4.11)

      MariaDB [(none)]> SELECT version();
      +---------------------------+
      | version()                 |
      +---------------------------+
      | 11.4.10-MariaDB-deb12-log |
      +---------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> CREATE DATABASE DBTEST;
      Query OK, 1 row affected (0.002 sec)
       
      MariaDB [(none)]> USE DBTEST;
      Database changed
       
      MariaDB [DBTEST]> CREATE TABLE test (`123col` INT);
      Query OK, 0 rows affected (0.004 sec)
       
      Database changed
      MariaDB [DBTEST]> SELECT 123col FROM test;
      Empty set (0.000 sec)
       
      MariaDB [DBTEST]> SELECT test.123col FROM test;
      Empty set (0.000 sec)
       
      MariaDB [DBTEST]> SELECT test.`123col` FROM test;
      Empty set (0.000 sec)
      

      Expected behavior:
      Both queries should return the same result (or at least not throw a syntax error), consistent with 11.4.10 behavior.

      Actual behavior (11.4.11):
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual...

      Additional context:
      The column name 123col is admittedly unconventional, but it exists in a legacy production schema and was handled correctly by the parser in previous versions. The regression was discovered after a routine package upgrade from 11.4.10 to 11.4.11.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Wassil Wassil
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.