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

NTILE must return an error when parameter is not stable

Details

    • 10.2.6-2, 10.2.6-3

    Description

      Ntile must only work for deterministic cases.

      If we have a query such as

      select ntile( n ) over (partition by c1 order by c2):
      

      n must provide a stable value for every individual partition, or we should return an error.

      Currently we compute

       ntile(<current_value_of_n>) 

      , given the current row number in the partition. This leads to erroneous results.

      Attachments

        Issue Links

          Activity

            cvicentiu Vicențiu Ciorbaru created issue -
            cvicentiu Vicențiu Ciorbaru made changes -
            Field Original Value New Value
            Description Ntile must only work for deterministic cases.

            If we have a query such as

            select ntile(n) over (partition by c1 order by c2):

            n must provide a stable value for every individual partition, or we should return an error.

            Currently we compute ntile(<current_value_of_n>), given the current row number in the partition. This leads to erroneous results.
            Ntile must only work for deterministic cases.

            If we have a query such as

            select ntile( n ) over (partition by c1 order by c2):

            n must provide a stable value for every individual partition, or we should return an error.

            Currently we compute ntile(<current_value_of_n>), given the current row number in the partition. This leads to erroneous results.
            psergei Sergei Petrunia made changes -
            cvicentiu Vicențiu Ciorbaru made changes -
            Description Ntile must only work for deterministic cases.

            If we have a query such as

            select ntile( n ) over (partition by c1 order by c2):

            n must provide a stable value for every individual partition, or we should return an error.

            Currently we compute ntile(<current_value_of_n>), given the current row number in the partition. This leads to erroneous results.
            Ntile must only work for deterministic cases.

            If we have a query such as
            {noformat}
            select ntile( n ) over (partition by c1 order by c2):
            {noformat}
            n must provide a stable value for every individual partition, or we should return an error.

            Currently we compute {noformat} ntile(<current_value_of_n>) {noformat}, given the current row number in the partition. This leads to erroneous results.
            elenst Elena Stepanova made changes -
            Component/s Optimizer - Window functions [ 13502 ]
            Component/s OTHER [ 10125 ]
            elenst Elena Stepanova made changes -
            Affects Version/s N/A [ 14700 ]
            elenst Elena Stepanova made changes -
            Labels 10.2-ga
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.6-2 [ 148 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked lower
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.6-2 [ 148 ] 10.2.6-2, 10.2.6-3 [ 148, 150 ]
            elenst Elena Stepanova made changes -
            Labels 10.2-ga
            cvicentiu Vicențiu Ciorbaru made changes -
            Labels beginner-friendly
            dansolo Dan Solodko added a comment -

            if it's possible to use an error ER_INVALID_NTILE_ARGUMENT for unstable argument I'm ready to create a Pull Reqest

            dansolo Dan Solodko added a comment - if it's possible to use an error ER_INVALID_NTILE_ARGUMENT for unstable argument I'm ready to create a Pull Reqest
            anel Anel Husakovic made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ] Anel Husakovic [ anel ]
            anel Anel Husakovic made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            anel Anel Husakovic made changes -
            Status Confirmed [ 10101 ] In Review [ 10002 ]

            Pushed to 10.2 with 459b87f6b4ae96.
            Thanks

            anel Anel Husakovic added a comment - Pushed to 10.2 with 459b87f6b4ae96 . Thanks
            anel Anel Husakovic made changes -
            Component/s Server [ 13907 ]
            Fix Version/s 10.2.33 [ 24307 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 74823 ] MariaDB v4 [ 150322 ]

            People

              anel Anel Husakovic
              cvicentiu Vicențiu Ciorbaru
              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.