提交 60033163 authored 作者: Thomas Mueller's avatar Thomas Mueller

UNION queries where the first query contains a nested query were parsed incorrectly.

上级 e4b3f4e5
......@@ -951,10 +951,8 @@ public class Parser {
String alias = null;
if (readIf("(")) {
if (isSelect()) {
int start = lastParseIndex;
Query query = parseSelectUnion();
read(")");
query = parseSelectUnionExtension(query, start, true);
ArrayList<Parameter> params = New.arrayList();
for (int i = 0; i < parameters.size(); i++) {
params.add(parameters.get(i));
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select 1, 2 from (select * from dual) union all select 3, 4 from dual;
> 1 2
> - -
> 1 2
> 3 4
> rows: 2
select 3 from (select * from dual) union all select 2 from dual;
> 3
> -
> 2
> 3
> rows: 2
create table a(x int, y int);
> ok
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论