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

#1057, #1072 fix: use TableFilter.visit to set neverLazy

for subquery in joins/nested joins recursively
上级 00f3e4de
...@@ -724,8 +724,7 @@ public class Select extends Query { ...@@ -724,8 +724,7 @@ public class Select extends Query {
@Override @Override
protected ResultInterface queryWithoutCache(int maxRows, ResultTarget target) { protected ResultInterface queryWithoutCache(int maxRows, ResultTarget target) {
disableLazyForJoinSubqueries(topTableFilter.getJoin()); disableLazyForJoinSubqueries(topTableFilter);
disableLazyForJoinSubqueries(topTableFilter.getNestedJoin());
int limitRows = maxRows == 0 ? -1 : maxRows; int limitRows = maxRows == 0 ? -1 : maxRows;
if (limitExpr != null) { if (limitExpr != null) {
...@@ -870,17 +869,18 @@ public class Select extends Query { ...@@ -870,17 +869,18 @@ public class Select extends Query {
return null; return null;
} }
private void disableLazyForJoinSubqueries(TableFilter f) { private void disableLazyForJoinSubqueries(final TableFilter top) {
if (f == null) top.visit(new TableFilter.TableFilterVisitor() {
return; @Override
if (f.getTable().getTableType() == TableType.VIEW) { public void accept(TableFilter f) {
if (f != top && f.getTable().getTableType() == TableType.VIEW) {
ViewIndex idx = (ViewIndex) f.getIndex(); ViewIndex idx = (ViewIndex) f.getIndex();
if (idx != null && idx.getQuery() != null) { if (idx != null && idx.getQuery() != null) {
idx.getQuery().setNeverLazy(true); idx.getQuery().setNeverLazy(true);
} }
} }
disableLazyForJoinSubqueries(f.getJoin()); }
disableLazyForJoinSubqueries(f.getNestedJoin()); });
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论