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

HAVING comparing ABS() result returns incorrect values

    XMLWordPrintable

    Details

      Description

      The legacy regression test working_tpch1_compareLogOnly/having/having2.sql has a failure running the query:

      MariaDB [tpch1]> select cinteger, abs(avg(cinteger)) from DataTypeTestm group by cinteger having abs(avg(cinteger)) > 7483645;
      +----------+--------------------+
      | cinteger | abs(avg(cinteger)) |
      +----------+--------------------+
      |  7483646 |       7483646.0000 |
      |  7483647 |       7483647.0000 |
      +----------+--------------------+
      2 rows in set (0.011 sec)
      

      The correct result is however:

      MariaDB [tpch1]> select cinteger, abs(avg(cinteger)) from test42 group by cinteger having abs(avg(cinteger)) > 7483645;
      +----------+--------------------+
      | cinteger | abs(avg(cinteger)) |
      +----------+--------------------+
      | -7483646 |       7483646.0000 |
      |  7483646 |       7483646.0000 |
      |  7483647 |       7483647.0000 |
      +----------+--------------------+
      3 rows in set (0.001 sec)
      

      As you can see the 3d record with a negative cinteger value isn't returned.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            drrtuy Roman
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.