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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 5.4.1
    • Component/s: ExeMgr
    • Labels:
      None
    • Sprint:
      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

            Assignee:
            susil.behera susil.behera
            Reporter:
            susil.behera susil.behera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration