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

GROUPBY IFNULL - column not accessible in HAVING

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.5.11, 10.6.4
    • Fix Version/s: N/A
    • Component/s: Server
    • Labels:
      None
    • Environment:
      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

            Assignee:
            serg Sergei Golubchik
            Reporter:
            marek.srom Marek Šrom
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration