Resolve issue that the inner expr doesn't have var from inner rel
@@ -308,7 +308,7 @@ IsCorrelatedOpExpr(OpExpr *opexp, Expr **innerExpr)
* It is correlated only if we found an outer var and inner expr
*/
- if (tOuterExpr)
+ if (tOuterExpr && contain_vars_of_level((Node *) tInnerExpr, 0))
{
*innerExpr = tInnerExpr;
return true;
