• unknown's avatar
    Bug #32858: Erro: "Incorrect usage of UNION and INTO" does not take · 2cc7999b
    unknown authored
    subselects into account
      
    It is forbidden to use the SELECT INTO construction inside UNION statements
    unless on the last SELECT of the union. The parser records whether it 
    has seen INTO or not when parsing a UNION statement. But if the INTO was
    legally used in an outer query, an error is thrown if UNION is seen in a
    subquery. Fixed in 5.0 by remembering the nesting level of INTO tokens and 
    mitigate the error unless it collides with the UNION.
    
    
    mysql-test/r/union.result:
      Bug#32858: Test result
    mysql-test/t/union.test:
      Bug#32858: Test case
    sql/sql_class.cc:
      Bug#32858: Initializing new member
    sql/sql_class.h:
      Bug#32858: Added property nest_level to select_result class.
    sql/sql_yacc.yy:
      Bug#32858: The fix.
    2cc7999b
sql_yacc.yy 376 KB