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

A subquery with a union for DECIMAL and BIGINT returns zeros

    XMLWordPrintable

Details

    • 2021-8

    Description

      The problem does not seem to be repeatable in 5.x.

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

      +------+
      | a    |
      +------+
      |  0.0 |
      |  0.0 |
      |  0.0 |
      +------+
      

      SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT b FROM t1) tu;
      

      +------+
      | a    |
      +------+
      |  0.0 |
      |  0.0 |
      |  0.0 |
      |  0.0 |
      +------+
      

      Note, without the subquery it works as expected:

      SELECT a FROM t1 UNION SELECT b FROM t1;
      

      +---------------------+
      | a                   |
      +---------------------+
      |                 1.0 |
      |  9999999999999999.0 |
      | 99999999999999999.0 |
      +---------------------+
      

      SELECT a FROM t1 UNION ALL SELECT b FROM t1;
      

      +---------------------+
      | a                   |
      +---------------------+
      |                 1.0 |
      |  9999999999999999.0 |
      |                 1.0 |
      | 99999999999999999.0 |
      +---------------------+
      

      Attachments

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            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.