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

Sub-query with GROUP BY and ORDER BY allows non-aggregates in projection.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.6, 1.2.2
    • 1.4.4
    • ExeMgr
    • None
    • 2019-02, 2019-03, 2019-04, 2019-05, 2019-06, 2020-1, 2020-2, 2020-3

    Description

      Consider this query that must fail b/c i2 is in projection.

      MariaDB [test]> select * from ( select count(1), i, i2 from cs1 group by i order by i2 ) a;
      +----------+------+------+
      | count(1) | i    | i2   |
      +----------+------+------+
      |        1 |    1 |   36 |
      |        1 |  100 |    5 |
      |        1 |   26 |    1 |
      |        1 |   25 |  103 |
      |        1 |    1 |   41 |
      |        1 |    2 |   42 |
      +----------+------+------+
      6 rows in set (0.028 sec)
      

      Despite the fact that MDB allows to sort over non-aggregated column CS doesn't support this functionality so here is the expected behavior.

      MariaDB [test]> select * from ( select count(1), i, i2 from cs1 group by i order by i2 )a ;
      ERROR 1815 (HY000): Internal error: IDB-2021: 'i2' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              drrtuy Roman
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.