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

LP:702345 - Empty query with SUM and HAVING, no GROUP BY returns NULL instead of empty result.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      The following test case (for LP BUG#609121) extracted from subselect_mat.test:

      create table t1 (c1 int);
      create table t2 (c2 int);
      insert into t1 values (1);
      insert into t2 values (2);

      SELECT SUM(c1) c1_sum FROM t1 WHERE c1 IN (SELECT c2 FROM t2) HAVING c1_sum;

      incorrectly produces a NULL instead of an empty result.

      Attachments

        Activity

          People

            timour Timour Katchaounov (Inactive)
            timour Timour Katchaounov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.