• unknown's avatar
    Bug#14654 : Cannot select from the same table twice within a UNION statement · e28c0331
    unknown authored
     Made the parser to support parenthesis around UNION branches.
     This is done by amending the rules of the parser so it generates the correct
     structure.
     Currently it supports arbitrary subquery/join/parenthesis operations in the 
     EXISTS clause. 
     In the IN/scalar subquery case it will allow adding nested parenthesis only 
     if there is an UNION clause after the parenthesis. Otherwise it will just  
     treat the multiple nested parenthesis as a scalar expression.
     It adds extra lex level for ((SELECT ...) UNION ...) to accommodate for the
     UNION clause.
    
    
    mysql-test/r/subselect.result:
      Bug#14654 : Cannot select from the same table twice within a UNION statement
       - test cases
    mysql-test/t/subselect.test:
      Bug#14654 : Cannot select from the same table twice within a UNION statement
       - test cases
    sql/sql_yacc.yy:
      Bug#14654 : Cannot select from the same table twice within a UNION statement
       - shuffle around the rules for the parenthesis in subselect
    e28c0331
subselect.test 89.7 KB