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

SUM() and AVG() in subquery return zero.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 5.4.1
    • ExeMgr
    • None
    • 2020-8

    Description

      Build tested: 1.5.4-1 (Drone build #417)

      CREATE TABLE t2(c INT)ENGINE=Columnstore;
      INSERT INTO t2 VALUES (1), (2);
      SELECT SUM(c) FROM t2;
      --------

      SUM(c)

      --------

      3

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

      SELECT (SELECT SUM(c) FROM t2) FROM t2;
      -------------------------

      (SELECT SUM(c) FROM t2)

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

      0
      0

      -------------------------
      2 rows in set, 2 warnings (0.044 sec)

      SELECT (SELECT AVG(c) FROM t2) FROM t2;
      -------------------------

      (SELECT AVG(c) FROM t2)

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

      0
      0

      -------------------------
      2 rows in set, 2 warnings (0.023 sec)

      SHOW WARNINGS;
      --------------------------------------------------------------------

      Level Code Message

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

      Warning 1918 Encountered illegal value '' when converting to DECIMAL
      Warning 1918 Encountered illegal value '' when converting to DECIMAL

      --------------------------------------------------------------------
      2 rows in set (0.000 sec)

      Expected result:
      SELECT (SELECT SUM(c) FROM t2) FROM t2;
      -------------------------

      (SELECT SUM(c) FROM t2)

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

      3
      3

      -------------------------
      2 rows in set (0.026 sec)

      SELECT (SELECT AVG(c) FROM t2) FROM t2;
      -------------------------

      (SELECT AVG(c) FROM t2)

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

      1.5000
      1.5000

      -------------------------
      2 rows in set (0.026 sec)

      This is a regression as it used to return the correct result in Drone build #411 and before.

      Attachments

        Activity

          People

            susil.behera Susil Behera
            susil.behera Susil Behera
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.