提交 4232718e authored 作者: S.Vladykin's avatar S.Vladykin

fix

上级 58425db8
...@@ -132,7 +132,7 @@ public class Delete extends Prepared { ...@@ -132,7 +132,7 @@ public class Delete extends Prepared {
} }
PlanItem item = tableFilter.getBestPlanItem(session, new TableFilter[]{tableFilter}, 0); PlanItem item = tableFilter.getBestPlanItem(session, new TableFilter[]{tableFilter}, 0);
tableFilter.setPlanItem(item); tableFilter.setPlanItem(item);
tableFilter.prepare(false); tableFilter.prepare();
} }
@Override @Override
......
...@@ -1010,7 +1010,9 @@ public class Select extends Query { ...@@ -1010,7 +1010,9 @@ public class Select extends Query {
setEvaluatableRecursive(topTableFilter); setEvaluatableRecursive(topTableFilter);
topTableFilter.prepare(parse); if (!parse) {
topTableFilter.prepare();
}
return planCost; return planCost;
} }
......
...@@ -189,7 +189,7 @@ public class Update extends Prepared { ...@@ -189,7 +189,7 @@ public class Update extends Prepared {
} }
PlanItem item = tableFilter.getBestPlanItem(session, new TableFilter[] {tableFilter}, 0); PlanItem item = tableFilter.getBestPlanItem(session, new TableFilter[] {tableFilter}, 0);
tableFilter.setPlanItem(item); tableFilter.setPlanItem(item);
tableFilter.prepare(false); tableFilter.prepare();
} }
@Override @Override
......
...@@ -269,10 +269,8 @@ public class TableFilter implements ColumnResolver { ...@@ -269,10 +269,8 @@ public class TableFilter implements ColumnResolver {
/** /**
* Prepare reading rows. This method will remove all index conditions that * Prepare reading rows. This method will remove all index conditions that
* can not be used, and optimize the conditions. * can not be used, and optimize the conditions.
*
* @param parse if we are parsing sub-query
*/ */
public void prepare(boolean parse) { public void prepare() {
// forget all unused index conditions // forget all unused index conditions
// the indexConditions list may be modified here // the indexConditions list may be modified here
for (int i = 0; i < indexConditions.size(); i++) { for (int i = 0; i < indexConditions.size(); i++) {
...@@ -291,15 +289,14 @@ public class TableFilter implements ColumnResolver { ...@@ -291,15 +289,14 @@ public class TableFilter implements ColumnResolver {
if (SysProperties.CHECK && nestedJoin == this) { if (SysProperties.CHECK && nestedJoin == this) {
DbException.throwInternalError("self join"); DbException.throwInternalError("self join");
} }
nestedJoin.prepare(parse); nestedJoin.prepare();
} }
if (join != null) { if (join != null) {
if (SysProperties.CHECK && join == this) { if (SysProperties.CHECK && join == this) {
DbException.throwInternalError("self join"); DbException.throwInternalError("self join");
} }
join.prepare(parse); join.prepare();
} }
if (!parse) {
if (filterCondition != null) { if (filterCondition != null) {
filterCondition = filterCondition.optimize(session); filterCondition = filterCondition.optimize(session);
} }
...@@ -307,7 +304,6 @@ public class TableFilter implements ColumnResolver { ...@@ -307,7 +304,6 @@ public class TableFilter implements ColumnResolver {
joinCondition = joinCondition.optimize(session); joinCondition = joinCondition.optimize(session);
} }
} }
}
/** /**
* Start the query. This will reset the scan counts. * Start the query. This will reset the scan counts.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论