Skip to content

Commit

Permalink
fix: corrected regression in case of let subquery and index detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Jun 17, 2024
1 parent a6303f1 commit 0baedd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,8 @@ private static void splitLet(QueryPlanningInfo info, OCommandContext ctx) {
while (iterator.hasNext()) {
OLetItem item = iterator.next();
if (item.getExpression() != null
&& item.getExpression().getMathExpression() != null
&& !item.getExpression().getMathExpression().isParentesis()
&& (item.getExpression().isEarlyCalculated(ctx)
|| isUnionAllOfQueries(info, item.getVarName(), item.getExpression()))) {
iterator.remove();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public boolean isIndexChain(OCommandContext ctx, OClass clazz) {
return false;
}

public boolean isParentesis() {
return false;
}

public enum Operator {
STAR(10) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public OParenthesisExpression(OExpression exp) {
this.expression = exp;
}

public boolean isParentesis() {
return true;
}

@Override
public Object execute(OIdentifiable iCurrentRecord, OCommandContext ctx) {
if (expression != null) {
Expand Down

0 comments on commit 0baedd4

Please sign in to comment.