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

row_number used as an alias is not working in 10.11.13

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.11.13
    • N/A
    • Parser
    • None
    • Not for Release Notes

    Description

      Hello Team,
      Good day,

      problem:
      When we use row_number string as an alias name, the query returns syntax error.
      It seems wired since only the row_number string is causing problem while using it as an alias.

      Analysis:
      When we use some other functions like (rank,min,max etc) as an alias, it is working fine as expected.

      Ask:
      Can you please check and confirm this?

      Tests:
      We tested it on 10.6.21 and 10.6.22 and row_number alias is working fine.
      We can see this issue on 10.11.13.

      logs:
      10.11.13

      MariaDB [(none)]> select @@version;
      +----------------------+
      | @@version            |
      +----------------------+
      | 10.11.13-MariaDB-log |
      +----------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as row_number;
      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 'row_number' at line 1
      MariaDB [(none)]> 
      MariaDB [(none)]> 
      MariaDB [(none)]> select 1 as rank;
      +------+
      | rank |
      +------+
      |    1 |
      +------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as min;
      +-----+
      | min |
      +-----+
      |   1 |
      +-----+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as CUME_DIST;
      +-----------+
      | CUME_DIST |
      +-----------+
      |         1 |
      +-----------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as NTILE;
      +-------+
      | NTILE |
      +-------+
      |     1 |
      +-------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as LAG;
      +-----+
      | LAG |
      +-----+
      |   1 |
      +-----+
      1 row in set (0.000 sec)
      MariaDB [(none)]> 
      

      10.6.21:

      MariaDB [(none)]> select @@version;
      +---------------------+
      | @@version           |
      +---------------------+
      | 10.6.21-MariaDB-log |
      +---------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as row_number;
      +------------+
      | row_number |
      +------------+
      |          1 |
      +------------+
      1 row in set (0.000 sec)
      

      10.6.22:

      MariaDB [(none)]> select @@version;
      +---------------------+
      | @@version           |
      +---------------------+
      | 10.6.22-MariaDB-log |
      +---------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select 1 as row_number;
      +------------+
      | row_number |
      +------------+
      |          1 |
      +------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> 
      

      Kindly let me know in case of any further dependencies.

      Thanks,
      Akilan RM.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Akilan Rajmahendran Akilan
            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.