Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-681

Eliminate the parser's rewriting of the abstract syntax tree for queries with GROUP BY and/or HAVING clauses

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 10.3.1.4
    • SQL
    • None

    Description

      If a query contains a GROUP BY or HAVING clause, the parser rewrites the abstract syntax tree, putting aggregates into a subselect and treating the HAVING clause as the WHERE clause of a fabricated outer select from the subquery. This allows the compiler to re-use some machinery since the HAVING clause operates on the grouped result the way that the WHERE clause operates on the from list. Unfortunately, this rewriting creates an explosion of special cases in the compiler after parsing is done. The rewriting is not systematically handled later on in the compiler. This gives rise to defects like bug 280. We need to eliminate this special rewriting and handle the HAVING clause in a straightforward way. This is not a small bugfix but is a medium sized project.

      Attachments

        1. notes.txt
          8 kB
          Manish Khettry
        2. followup.patch.txt
          2 kB
          Manish Khettry
        3. 681.patch3.txt
          81 kB
          Manish Khettry
        4. 681.patch2.txt
          84 kB
          Manish Khettry
        5. 681.patch.txt
          68 kB
          Manish Khettry

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mkhettry Manish Khettry
            rhillegas Richard N. Hillegas
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment