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

wrong decimal sum when using FLOAT type

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 1.0.2
    • 1.0.0
    • MariaDB Server
    • None
    • OpenSUSE 42.1 (act as a server)

    Description

      To reproduce the error, build this table as example:

      {{CREATE TABLE `test` (
      `FACTURA` CHAR(20) NULL DEFAULT NULL,
      `FECHA` DATE NULL DEFAULT NULL,
      `IMPORTE` FLOAT NULL DEFAULT NULL
      );}}

      It only need a 1 record, but you must use any. Use this for example:

      {{INSERT INTO `test` (`FACTURA`, `FECHA`, `IMPORTE`) VALUES
      ('BE6141', '2016-06-14', 877.8);
      }}

      Finally, run this query:

      {{select factura, CONCAT_WS(',',FECHA) as FECHA, SUM(importe) AS IMPORTE
      from test
      group by factura;
      }}

      The result is:
      ------------------------------------
      | factura | FECHA | IMPORTE |
      ------------------------------------
      | BE6141 | 2016-06-14 | 877.7999877929688 |
      ------------------------------------
      1 row in set (0.00 sec)

      As you can see = 877.7999877929688 <> 877.8

      Attachments

        Activity

          People

            LinuxJedi Andrew Hutchings (Inactive)
            xriz Xrizoo
            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.