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

Garbage result of a union between huge narrow DECIMAL and BIGINT

Details

    • 2021-7

    Description

      This ticket is for 5.6.1 only. Testing in 6.1.1 will need to wait until MCOL-4612 is MERGED into develop branch

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DECIMAL(17,1), b BIGINT) ENGINE=ColumnStore;
      INSERT INTO t1 VALUES (9999999999999999.9, 999999999999999999);
      SELECT * FROM (SELECT a FROM t1 UNION SELECT b FROM t1) tu;
      

      +-----------------------+
      | a                     |
      +-----------------------+
      |    9999999999999999.9 |
      | -844674407370955162.6 |
      +-----------------------+
      

      Looks wrong.

      Note, the problem cannot be repeated in 6.x because of MCOL-4612
      But perhaps it still exists. MCOL-4612 needs to be fixed first to verify it further in 6.x.

      Attachments

        Issue Links

          Activity

            For QA: Queries to confirm the issue and verify the fix works are in the issue description.

            tntnatbry Gagan Goel (Inactive) added a comment - For QA: Queries to confirm the issue and verify the fix works are in the issue description.

            The fix has some loss of precision for large values. This is because we set the union type for a BIGINT and a DECIMAL column as a DOUBLE. This limitation will be addressed in MCOL-4612 when we set the union type to a wide decimal.

            tntnatbry Gagan Goel (Inactive) added a comment - The fix has some loss of precision for large values. This is because we set the union type for a BIGINT and a DECIMAL column as a DOUBLE. This limitation will be addressed in MCOL-4612 when we set the union type to a wide decimal.

            Build verified: 5.6.1 ( Drone #2245)

            Precision issue will be tracked in mentioned tickets.

            MariaDB [mytest]> INSERT INTO t1 VALUES (9999999999999999.9, 999999999999999999);
            Query OK, 1 row affected (0.354 sec)
             
            MariaDB [mytest]> SELECT * FROM (SELECT a FROM t1 UNION SELECT b FROM t1) tu;
            +----------------------+
            | a                    |
            +----------------------+
            | 999999999999999999.0 |
            |   9999999999999999.0 |
            +----------------------+
            2 rows in set (0.070 sec)
            

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: 5.6.1 ( Drone #2245) Precision issue will be tracked in mentioned tickets. MariaDB [mytest]> INSERT INTO t1 VALUES (9999999999999999.9, 999999999999999999); Query OK, 1 row affected (0.354 sec)   MariaDB [mytest]> SELECT * FROM (SELECT a FROM t1 UNION SELECT b FROM t1) tu; +----------------------+ | a | +----------------------+ | 999999999999999999.0 | | 9999999999999999.0 | +----------------------+ 2 rows in set (0.070 sec)

            People

              dleeyh Daniel Lee (Inactive)
              bar Alexander Barkov
              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.