db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6263) Make acceptChildren() overloads visit all clauses in QueryTreeNodes
Date Mon, 17 Jun 2013 12:57:19 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rick Hillegas updated DERBY-6263:
---------------------------------

         Description: 
The acceptChildren() overloads don't visit all of the clauses in an AST node. This is probably
a mistake. However, fixing it will require a systematic analysis of the AST nodes and probably
some changes to the Visitors. Some queries rely on the fact that certain Visitors will not
be called on some AST nodes even though the Visitors are called on sister nodes in the same
parent AST node.

An example of this defect is the CursorNode. If you call treePrint() on a CursorNode, you
will see information on ORDER BY, FETCH, and OFFSET clauses. However, these clauses are not
visited by CursorNode.acceptChildren(). This looks like an omission. This defect was brought
to our attention by this email thread: http://apache-database.10148.n7.nabble.com/Using-ASTParser-and-TreeWalker-for-parsing-SQL-query-td131219.html.
You can see the difference in treePrint() and acceptChildren() behavior by running the following
query through the ASTParser and TreePrinter tools attached to DERBY-3946:

    select tablename from sys.systables where 1=2 order by tablename;

  was:
If you call treePrint() on a CursorNode, you will see information on ORDER BY, FETCH, and
OFFSET clauses. However, these clauses are not visited by CursorNode.acceptChildren(). This
looks like an omission. This defect was brought to our attention by this email thread: http://apache-database.10148.n7.nabble.com/Using-ASTParser-and-TreeWalker-for-parsing-SQL-query-td131219.html.
You can see the difference in treePrint() and acceptChildren() behavior by running the following
query through the ASTParser and TreePrinter tools attached to DERBY-3946:

    select tablename from sys.systables where 1=2 order by tablename;

    Issue & fix info:   (was: Repro attached)
             Summary: Make acceptChildren() overloads visit all clauses in QueryTreeNodes
 (was: Make the Visitor support in CursorNodes support ORDER BY lists, FETCH, and OFFSET clauses)
    
> Make acceptChildren() overloads visit all clauses in QueryTreeNodes
> -------------------------------------------------------------------
>
>                 Key: DERBY-6263
>                 URL: https://issues.apache.org/jira/browse/DERBY-6263
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-6263-01-aa-visit-ignored-clauses.diff
>
>
> The acceptChildren() overloads don't visit all of the clauses in an AST node. This is
probably a mistake. However, fixing it will require a systematic analysis of the AST nodes
and probably some changes to the Visitors. Some queries rely on the fact that certain Visitors
will not be called on some AST nodes even though the Visitors are called on sister nodes in
the same parent AST node.
> An example of this defect is the CursorNode. If you call treePrint() on a CursorNode,
you will see information on ORDER BY, FETCH, and OFFSET clauses. However, these clauses are
not visited by CursorNode.acceptChildren(). This looks like an omission. This defect was brought
to our attention by this email thread: http://apache-database.10148.n7.nabble.com/Using-ASTParser-and-TreeWalker-for-parsing-SQL-query-td131219.html.
You can see the difference in treePrint() and acceptChildren() behavior by running the following
query through the ASTParser and TreePrinter tools attached to DERBY-3946:
>     select tablename from sys.systables where 1=2 order by tablename;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message