提交 8df6a20e authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 f4927b6f
......@@ -839,7 +839,7 @@ public class Parser {
int paramIndex = parameters.size();
Query query = parseSelectUnion();
read(")");
query = parseSelectUnionExtension(query, start);
query = parseSelectUnionExtension(query, start, true);
ObjectArray params = new ObjectArray();
for (int i = paramIndex; i < parameters.size(); i++) {
params.add(parameters.get(i));
......@@ -1248,10 +1248,10 @@ public class Parser {
private Query parseSelectUnion() throws SQLException {
int start = lastParseIndex;
Query command = parseSelectSub();
return parseSelectUnionExtension(command, start);
return parseSelectUnionExtension(command, start, false);
}
private Query parseSelectUnionExtension(Query command, int start) throws SQLException {
private Query parseSelectUnionExtension(Query command, int start, boolean unionOnly) throws SQLException {
while (true) {
if (readIf("UNION")) {
SelectUnion union = new SelectUnion(session, command);
......@@ -1277,7 +1277,7 @@ public class Parser {
break;
}
}
if (readIf("ORDER")) {
if (!unionOnly && readIf("ORDER")) {
read("BY");
Select oldSelect = currentSelect;
if (command instanceof Select) {
......@@ -1317,7 +1317,7 @@ public class Parser {
command.setOrder(orderList);
currentSelect = oldSelect;
}
if (readIf("LIMIT")) {
if (!unionOnly && readIf("LIMIT")) {
Select temp = currentSelect;
// make sure aggregate functions will not work here
currentSelect = null;
......@@ -1338,7 +1338,7 @@ public class Parser {
}
currentSelect = temp;
}
if (readIf("FOR")) {
if (!unionOnly && readIf("FOR")) {
if (readIf("UPDATE")) {
if (readIf("OF")) {
do {
......
......@@ -155,10 +155,7 @@ java org.h2.test.TestAll timer
/*
Test space re-use
REUSE_SPACE_AFTER=20 or so
delete old ipowerb content (first filter, then remove)
delete old ipowerb content
link to new changelog and roadmap, remove pages from google groups
Can sometimes not delete log file? need test case
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create table test as select * from table(id int=(1, 2, 3));
> ok
SELECT * FROM (SELECT * FROM TEST) ORDER BY id;
> ID
> --
> 1
> 2
> 3
> rows (ordered): 3
SELECT * FROM (SELECT * FROM TEST) x ORDER BY id;
> ID
> --
> 1
> 2
> 3
> rows (ordered): 3
drop table test;
> ok
select top sum(1) 0 from dual;
> exception
......
......@@ -32,6 +32,7 @@ public class SelfDestructor extends Thread {
// ignore
}
}
System.out.println("Killing the process after " + minutes + " minutes");
Runtime.getRuntime().halt(1);
}
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论