Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3343

Window Functions don't work with arithmetic operators or other functions

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.5, 1.2.3
    • 1.2.5
    • ExeMgr
    • None
    • 2019-05, 2019-06

    Description

      Discovered during QA:

      create table tb1 (d1 decimal(7,2), i1 int)engine=columnstore;
      insert into tb1 values (7.12, 1), (12.12, 1);

      select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from tb1 group by i1;

      This results in a random output in 1.2, and a 0 output in 1.1. The answer is 100 as can be seen when using innodb:
      MariaDB [dhall]> select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from inno_tb1 group by i1;
      ---------------------------------------------------------

      (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1)

      ---------------------------------------------------------

      100

      ---------------------------------------------------------
      1 row in set (0.008 sec)

      Using the divide operator '/' instead of the div function may result in a different set of random numbers.

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              David.Hall David Hall (Inactive)
              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.