Skip to content

Commit

Permalink
Fix esqctxt value in AnySubquery transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
mos65o2 committed Dec 3, 2024
1 parent c69f669 commit 539791b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/backend/gporca/libgpopt/src/xforms/CSubqueryHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,15 @@ CSubqueryHandler::FRemoveAnySubquery(CExpression *pexprOuter,
CScalarSubqueryAny::PopConvert(pexprSubquery->Pop())->Pcr();
COperator::EOperatorId eopidSubq = pexprSubquery->Pop()->Eopid();

// if child has subquery use Value context
CExpression *pexprScalarChild = (*pexprSubquery)[1];
if (CUtils::FQuantifiedSubquery(pexprScalarChild->Pop()) ||
CUtils::FExistentialSubquery(pexprScalarChild->Pop()) ||
CPredicateUtils::FAnd(pexprScalarChild))
{
esqctxt = EsqctxtValue;
}

// build subquery quantified comparison
CExpression *pexprResult = NULL;
CExpression *pexprPredicate =
Expand Down

0 comments on commit 539791b

Please sign in to comment.