Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-26467

LETTING or HAVING clause should only reference aggregates/group or constant

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 5.5.0
    • query
    • None

    Description

      LETTING, HAVING clauses are processed after GROUP BY.
      These clauses can't reference any field that are not part of GROUP BY. (part of aggregate argument is okay).
      Otherwise it is consider as MISSING

      The follwing statements should raise error.

      CREATE PRIMARY INDEX ON default;
      EXPLAIN SELECT p, SUM FROM default GROUP BY p LETTING l1 = a ;
      EXPLAIN SELECT p, SUM FROM default GROUP BY p LETTING l1 = a HAVING b > 2;

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Sitaram.Vemulapalli Sitaram Vemulapalli
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty