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

Lead Window Function Returns Incorrect Results

Details

    Description

      Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

      +------+---------+
      | id   | next_id |
      +------+---------+
      |    1 |       2 |
      |    2 |       3 |
      |    3 |       4 |
      |    4 |       5 |
      |    5 |       6 |
      |    6 |       7 |
      |    7 |       8 |
      |    8 |       9 |
      |    9 |      10 |
      |   10 |      11 |
      +------+---------+
      

      Attachments

        Activity

          absolutesantaja Shawn Weeks created issue -
          absolutesantaja Shawn Weeks made changes -
          Field Original Value New Value
          Environment Windows 10 Pro 1607 x64, 128GB RAM, i7 6800k MariaDB 10.2.2 Beta Windows 10 Pro 1607 x64, 128GB RAM, i7 6800k MariaDB 10.2.3 Beta
          absolutesantaja Shawn Weeks made changes -
          Description Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          +------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+
          Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          {{+------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+}}
          absolutesantaja Shawn Weeks made changes -
          Description Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          {{+------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+}}
          Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          {{+------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 1 |
          | 2 | 4097 |
          | 3 | 4097 |
          | 4 | 4097 |
          | 5 | 4097 |
          | 6 | 4097 |
          | 7 | 4097 |
          | 8 | 4097 |
          | 9 | 4097 |
          | 10 | 4097 |
          +------+---------+}}
          absolutesantaja Shawn Weeks made changes -
          Description Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          {{+------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 1 |
          | 2 | 4097 |
          | 3 | 4097 |
          | 4 | 4097 |
          | 5 | 4097 |
          | 6 | 4097 |
          | 7 | 4097 |
          | 8 | 4097 |
          | 9 | 4097 |
          | 10 | 4097 |
          +------+---------+}}
          Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          +------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+
          elenst Elena Stepanova made changes -
          Description Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.

          +------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+
          Lead Function is returning incorrect results for larger test table. Logs and example are attached. Expected results are as follows.
          {noformat}
          +------+---------+
          | id | next_id |
          +------+---------+
          | 1 | 2 |
          | 2 | 3 |
          | 3 | 4 |
          | 4 | 5 |
          | 5 | 6 |
          | 6 | 7 |
          | 7 | 8 |
          | 8 | 9 |
          | 9 | 10 |
          | 10 | 11 |
          +------+---------+
          {noformat}
          absolutesantaja Shawn Weeks added a comment -

          Thank you I couldn't get the formatting to work.

          absolutesantaja Shawn Weeks added a comment - Thank you I couldn't get the formatting to work.
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]

          Thanks for the report and test case.

          elenst Elena Stepanova added a comment - Thanks for the report and test case.
          elenst Elena Stepanova made changes -
          Component/s Optimizer - Window functions [ 13502 ]
          Fix Version/s 10.2 [ 14601 ]
          Assignee Vicentiu Ciorbaru [ cvicentiu ]
          Priority Minor [ 4 ] Major [ 3 ]
          elenst Elena Stepanova made changes -
          Labels 10.2-rc

          Sergey, please check that this reproduces again as it seems to be a big table issue.

          cvicentiu Vicențiu Ciorbaru added a comment - Sergey, please check that this reproduces again as it seems to be a big table issue.
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Vicentiu Ciorbaru [ cvicentiu ] Sergei Petrunia [ psergey ]
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Sergei Petrunia [ psergey ] Vicentiu Ciorbaru [ cvicentiu ]

          This is fixed by the fix for MDEV-10092.

          cvicentiu Vicențiu Ciorbaru added a comment - This is fixed by the fix for MDEV-10092 .
          cvicentiu Vicențiu Ciorbaru made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          cvicentiu Vicențiu Ciorbaru added a comment - Test case added for the bug to catch regressions. https://github.com/mariadb/server/commit/88ddb1ea4e4c7ce4816026d9a64b3f8b1cc59072
          cvicentiu Vicențiu Ciorbaru made changes -
          Fix Version/s 10.2.4 [ 22116 ]
          Fix Version/s 10.2 [ 14601 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          absolutesantaja Shawn Weeks added a comment -

          Checked it in the most recent 10.2.5 build it looks fine. Thanks

          absolutesantaja Shawn Weeks added a comment - Checked it in the most recent 10.2.5 build it looks fine. Thanks
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 79037 ] MariaDB v4 [ 151465 ]

          People

            cvicentiu Vicențiu Ciorbaru
            absolutesantaja Shawn Weeks
            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.