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

ORDER BY position in window function causes strange error code

Details

    Description

      create table t1 (i int);
      select rank() over (order by 1) from t1;
      ERROR 4007 (HY000): Window function is not allowed in window specification
      

      The error is very confusing.

      Attachments

        Issue Links

          Activity

            igor Igor Babaev added a comment -

            If we change the integer in order by for 2 we have another bogus error:

            MariaDB [test]> select rank() over (order by 2) from t1;
            ERROR 1054 (42S22): Unknown column '2' in 'order clause'
            

            igor Igor Babaev added a comment - If we change the integer in order by for 2 we have another bogus error: MariaDB [test]> select rank() over (order by 2) from t1; ERROR 1054 (42S22): Unknown column '2' in 'order clause'
            igor Igor Babaev added a comment -

            The fix for this bug was pushed into the 10.2 tree.

            igor Igor Babaev added a comment - The fix for this bug was pushed into the 10.2 tree.

            People

              igor Igor Babaev
              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.