[ 
https://issues.apache.org/jira/browse/DERBY-681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479436
 ] 

A B commented on DERBY-681:
---------------------------

Thank you for the second patch, Manish.  I looked it over and it does indeed 
address most of my comments, so I think we're getting closer.  The reason I say 
"closer" is because I noticed the following problems with the second patch, and 
I think these should be addressed before the patch can be committed:

  - Looks like the formatting for the first couple of lines in the license
    text for views.sql has changed.  I assume this was just an accident?

  - This patch adds an explicit connection to views.sql, which I do not
    think is right:

        @@ -17,6 +14,7 @@
         -- tests for views
 
         -- set autocommit off
        +connect 'jdbc:derby:wombat';
         autocommit off;

    Notice that the result (in views.out) is a security access violation:

        @@ -17,7 +14,9 @@
         -- tests for views
 
         -- set autocommit off
        -autocommit off;
        +connect 'jdbc:derby:wombat';
        +JAVA ERROR: java.security.AccessControlException: access denied 
(java.util.PropertyPermission ij.URLCheck read)
        +ij> autocommit off;

    This looks wrong to me.  Is the additional connect statement an intentional 
change,
    or is that just a remnant from some testing you were doing? If possible I 
think the
    extra call to "connect" should be removed and the master file updated 
accordingly.
    If you made the change intentionally then can you explain why it is 
necessary?

  - There is also the following diff in the RunTest and RunSuite classes:

-               classpath = sp.getProperty("classpath");
+               classpath = sp.getProperty("java.class.path");

    Again, can you explain why this particular change is necessary?  Were you
    experiencing problems while running the tests?  If so, what were those 
problems?

Other than these test issues I think the patch is ready for commit...

> Eliminate the parser's rewriting of the abstract syntax tree for queries with 
> GROUP BY and/or HAVING clauses
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-681
>                 URL: https://issues.apache.org/jira/browse/DERBY-681
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Rick Hillegas
>         Assigned To: Manish Khettry
>         Attachments: 681.patch.txt, 681.patch2.txt, notes.txt
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to