21.11_origin_diff2.diff.txt
text/plain
Filename: 21.11_origin_diff2.diff.txt
Type: text/plain
Part: 1
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 290422005a3..7b76c9f29a1 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -162,6 +162,10 @@ transformBoolExprOr(ParseState *pstate, BoolExpr *expr_orig)
HTAB *or_group_htab = NULL;
int len_ors = list_length(expr_orig->args);
+ /* If this is not an 'OR' expression, skip the transformation */
+ if (expr_orig->boolop != OR_EXPR || !enable_or_transformation || len_ors == 1 || !or_group_htab)
+ return transformBoolExpr(pstate, (BoolExpr *) expr_orig);
+
MemSet(&info, 0, sizeof(info));
info.keysize = sizeof(int);
info.entrysize = sizeof(OrClauseGroupEntry);
@@ -170,10 +174,6 @@ transformBoolExprOr(ParseState *pstate, BoolExpr *expr_orig)
&info,
HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
- /* If this is not an 'OR' expression, skip the transformation */
- if (expr_orig->boolop != OR_EXPR || !enable_or_transformation || len_ors == 1 || !or_group_htab)
- return transformBoolExpr(pstate, (BoolExpr *) expr_orig);
-
foreach(lc, expr_orig->args)
{
Node *arg = lfirst(lc);