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

fix

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