提交 9e5af9dc authored 作者: Vakhurin Sergey's avatar Vakhurin Sergey

add support for "with"-subqueries into "in"-predicate statement

上级 f3473776
......@@ -2765,6 +2765,9 @@ public class Parser {
if (isToken("SELECT") || isToken("FROM")) {
Query query = parseSelect();
r = new Subquery(query);
} else if (readIf("WITH")) {
Query query = parseWith();
r = new Subquery(query);
} else {
throw getSyntaxError();
}
......
......@@ -147,6 +147,10 @@ public class TestRecursiveQueries extends TestBase {
new int[]{ Types.INTEGER, Types.VARCHAR, Types.TIMESTAMP },
null, null);
rs = stat.executeQuery("select x from system_range(1,5) "
+ "where x not in (with w(x) as (select 1 union all select x+1 from w where x<3) select x from w)");
assertResultSetOrdered(rs, new String[][]{{"4"}, {"5"}});
conn.close();
deleteDb("recursiveQueries");
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论