提交 7ec44b57 authored 作者: Owner's avatar Owner

Turnng off lazy if recursive filter found.

上级 d1ca8df3
...@@ -569,7 +569,8 @@ public class Select extends Query { ...@@ -569,7 +569,8 @@ public class Select extends Query {
} }
boolean lazy = session.isLazyQueryExecution() && boolean lazy = session.isLazyQueryExecution() &&
target == null && !isForUpdate && !isQuickAggregateQuery && target == null && !isForUpdate && !isQuickAggregateQuery &&
limitRows != 0 && offsetExpr == null && isReadOnly(); limitRows != 0 && offsetExpr == null && isReadOnly() &&
!hasRecursiveTableView();
int columnCount = expressions.size(); int columnCount = expressions.size();
LocalResult result = null; LocalResult result = null;
if (!lazy && (target == null || if (!lazy && (target == null ||
...@@ -663,6 +664,19 @@ public class Select extends Query { ...@@ -663,6 +664,19 @@ public class Select extends Query {
return null; return null;
} }
private boolean hasRecursiveTableView() {
// go through the table filters to see if we have a recursive table query
for (TableFilter f : filters) {
if(f.getTable().isTableExpression()){
TableView v = (TableView)f.getTable();
if(v.isRecursive()){
return true;
}
}
}
return false;
}
private void resetJoinBatchAfterQuery() { private void resetJoinBatchAfterQuery() {
JoinBatch jb = getJoinBatch(); JoinBatch jb = getJoinBatch();
if (jb != null) { if (jb != null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论