diff options
author | unknown <mhansson/martin@linux-st28.site> | 2007-12-13 11:19:05 +0100 |
---|---|---|
committer | unknown <mhansson/martin@linux-st28.site> | 2007-12-13 11:19:05 +0100 |
commit | 93e3057ba574672c2f0bb1b0958221c0d7efc553 (patch) | |
tree | caf3c9929e1fdb44793e28bfacf2fa1ea9dc22a6 /sql/sql_class.cc | |
parent | 62a7e160bc0e960ec1374a546dde4a7f26120ceb (diff) | |
download | mariadb-git-93e3057ba574672c2f0bb1b0958221c0d7efc553.tar.gz |
Bug #32858: Erro: "Incorrect usage of UNION and INTO" does not take
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.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b67f63778dc..87553837641 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -931,6 +931,7 @@ void THD::rollback_item_tree_changes() select_result::select_result() { thd=current_thd; + nest_level= -1; } void select_result::send_error(uint errcode,const char *err) |