提交 f03f4781 authored 作者: tledkov's avatar tledkov

#1057, #1072 fix NPE on CTE

上级 32cc2c52
......@@ -873,8 +873,9 @@ public class Select extends Query {
for (; f != null; f = f.getJoin()) {
if (f.getTable().getTableType() == TableType.VIEW) {
ViewIndex idx = (ViewIndex) f.getIndex();
idx.getQuery().setNeverLazy(true);
if (idx != null && idx.getQuery() != null) {
idx.getQuery().setNeverLazy(true);
}
}
}
}
......
......@@ -58,13 +58,13 @@ public class TestSubqueryPerformanceOnLazyExecutionMode extends TestDb {
}
}
public void testSubqueryInCondition(Statement stmt) throws Exception {
private void testSubqueryInCondition(Statement stmt) throws Exception {
String sql = "SELECT COUNT (*) FROM one WHERE x IN (SELECT y FROM one WHERE y < 50)";
checkExecutionTime(stmt, sql);
}
public void testSubqueryInJoin(Statement stmt) throws Exception {
private void testSubqueryInJoin(Statement stmt) throws Exception {
String sql =
"SELECT COUNT (one.x) FROM one " +
"JOIN (SELECT y AS val FROM one WHERE y < 50) AS subq ON subq.val=one.x";
......@@ -72,7 +72,7 @@ public class TestSubqueryPerformanceOnLazyExecutionMode extends TestDb {
checkExecutionTime(stmt, sql);
}
public void testSubqueryInJoinFirst(Statement stmt) throws Exception {
private void testSubqueryInJoinFirst(Statement stmt) throws Exception {
String sql =
"SELECT COUNT (one.x) FROM " +
"(SELECT y AS val FROM one WHERE y < 50) AS subq " +
......@@ -81,7 +81,7 @@ public class TestSubqueryPerformanceOnLazyExecutionMode extends TestDb {
checkExecutionTime(stmt, sql);
}
public void testJoinTwoSubqueries(Statement stmt) throws Exception {
private void testJoinTwoSubqueries(Statement stmt) throws Exception {
String sql =
"SELECT COUNT (one_sub.x) FROM " +
"(SELECT y AS val FROM one WHERE y < 50) AS subq " +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论