Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/577#discussion_r71010941
  
    --- Diff: core/sql/parser/sqlparser.y ---
    @@ -7000,6 +7024,46 @@ rel_subquery_and_as_clause : rel_subquery as_clause
                                    CheckModeSpecial1();
                                    $$ = $2;
                                  }
    +with_clause : 
    +              TOK_WITH with_clause_elements
    +              {
    +                 $$ = NULL;
    +              }
    +              | TOK_WITH TOK_RECURSIVE with_clause_elements
    +              {
    +                        *SqlParser_Diags << DgSqlCode(-3022) << 
DgString0("WITH RECURSIVE");
    +                        YYERROR;
    +              }
    +
    +with_clause_elements : with_clause_element
    +              {
    +                 $$ = NULL;
    +              }
    +              | with_clause_elements ',' with_clause_element
    +              {
    +                 $$ = NULL;
    +              }
    +
    +with_clause_element : correlation_name TOK_AS '(' query_expression ')'
    +                      {
    +                         RelRoot *root = new (PARSERHEAP())
    +                                            RelRoot($4, REL_ROOT);
    +                         $$= new (PARSERHEAP()) RenameTable(root, *$1); 
    +
    +                         //Duplicated definition of WITH
    +                         if(SqlParser_CurrentParser->hasWithDefinition($1) 
)
    +                          {
    +                            *SqlParser_Diags << DgSqlCode(-3288)
    +                                             << 
DgString0((*$1).toCharStar());
    +                             delete $1;
    +                             delete $4;
    +                             YYERROR;
    +                          }
    +
    +                          SqlParser_CurrentParser->insertWithDefinition($1 
, $$);
    +                          delete $1;
    +                          delete $4;
    --- End diff --
    
    I don't think we want to delete $1 and $4 here, since the RelRoot node 
points to $4 and the RenameTable node points to $1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to