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

sum() and avg() return incorrect result for float when calculation overflows float range

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 1.0.1
    • 1.2.3
    • ExeMgr
    • None

    Description

      Build tested:

      getsoftwareinfo Fri Jun 17 17:03:28 2016

      Name : mariadb-columnstore-platform Relocations: (not relocatable)
      Version : 1.0 Vendor: MariaDB Corporation Ab
      Release : 1 Build Date: Mon 13 Jun 2016 06:50:26 PM CDT
      Install Date: Fri 17 Jun 2016 10:53:22 AM CDT Build Host: srvbuilder
      Group : Applications Source RPM: mariadb-columnstore-1.0-1.src.rpm

      MariaDB [mytest]> select cfloat from datatypetestm;
      -------------

      cfloat

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

      -3.40287e18
      -3.40287e18
      -3.40286e18
      -3.40286e18
      -3.40286e18
      3.40286e18
      3.40286e18
      3.40286e18
      3.40287e18
      3.40287e18
      0

      -------------
      11 rows in set (0.02 sec)

      MariaDB [mytest]> select SUM(CFLOAT) from datatypetestm;
      --------------

      SUM(CFLOAT)

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

      274877906944

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

      MariaDB [mytest]> select AVG(CFLOAT) from datatypetestm;
      -------------

      AVG(CFLOAT)

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

      24988901376

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

      Both MariaDB and InfiniDB return 0.

      Attachments

        Issue Links

          Activity

            People

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