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

GROUPBY IFNULL - column not accessible in HAVING

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.5.11, 10.6.4
    • N/A
    • Server
    • None
    • Cent OS 7, Windows

    Description

      When IFNULL is used in GROUPBY, Unknown column error is thrown when trying to use it in HAVING....

      To reproduce:
      CREATE TABLE aaaa (a INT, b INT, c int);

      SELECT 0 FROM aaaa GROUP BY IFNULL(a,b) HAVING IFNULL( aaaa.a, aaaa.b)<>SUM( IFNULL( aaaa.c, 0));

      Result: Error - Unknown column 'aaaa.a' in 'having clause'

      Strange is that when SELECT * is used works ok...

      Attachments

        Activity

          People

            serg Sergei Golubchik
            marek.srom Marek Šrom
            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.