Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-681

LP:1002326 - Wrong result with empty table, implicit grouping and non-aggregated column in select

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 5.3.12
    • None
    • None

    Description

      The following test case produces wrong result:

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (7),(0);
      CREATE TABLE t2 (b INT);
       
      SELECT SUM(a), a FROM (t1, t2) WHERE t1.a >= 4;
      +--------+------+
      | SUM(a) | a    |
      +--------+------+
      |   NULL | NULL |
      +--------+------+
      1 row in set (0.00 sec)
       
      SELECT SUM(a), a FROM t1, t2 WHERE t1.a >= 4;
      +--------+------+
      | SUM(a) | a    |
      +--------+------+
      |      7 |    7 |
      +--------+------+

      The only difference between the queries are the braces in the FROM clause.

      This test case was extracted from bug lp:1002079.

      Attachments

        Activity

          People

            timour Timour Katchaounov (Inactive)
            timour Timour Katchaounov (Inactive)
            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.