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