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

Wrong results with window functions and implicit grouping

    XMLWordPrintable

Details

    Description

      MariaDB [test]> create table t1(a int) engine=MYISAM;
      Query OK, 0 rows affected (0.01 sec)
       
      MariaDB [test]> SELECT sum(1) as x, row_number() OVER() FROM t1;
      +------+---------------------+
      | x    | row_number() OVER() |
      +------+---------------------+
      | NULL |                NULL |
      +------+---------------------+
      

      1 row in set (0.00 sec)

      The above query return NULL for the window function row_number, which is incorrect.
      When we have implicit grouping window function would be executed once and the result should be 1

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              varun Varun Gupta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.