MCPcopy Create free account
hub / github.com/apache/cloudberry / transformBoolExpr

Function transformBoolExpr

src/backend/parser/parse_expr.c:1349–1383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1347}
1348
1349static Node *
1350transformBoolExpr(ParseState *pstate, BoolExpr *a)
1351{
1352 List *args = NIL;
1353 const char *opname;
1354 ListCell *lc;
1355
1356 switch (a->boolop)
1357 {
1358 case AND_EXPR:
1359 opname = "AND";
1360 break;
1361 case OR_EXPR:
1362 opname = "OR";
1363 break;
1364 case NOT_EXPR:
1365 opname = "NOT";
1366 break;
1367 default:
1368 elog(ERROR, "unrecognized boolop: %d", (int) a->boolop);
1369 opname = NULL; /* keep compiler quiet */
1370 break;
1371 }
1372
1373 foreach(lc, a->args)
1374 {
1375 Node *arg = (Node *) lfirst(lc);
1376
1377 arg = transformExprRecurse(pstate, arg);
1378 arg = coerce_to_boolean(pstate, arg, opname);
1379 args = lappend(args, arg);
1380 }
1381
1382 return (Node *) makeBoolExpr(a->boolop, args, a->location);
1383}
1384
1385static Node *
1386transformFuncCall(ParseState *pstate, FuncCall *fn)

Callers 1

transformExprRecurseFunction · 0.85

Calls 5

transformExprRecurseFunction · 0.85
coerce_to_booleanFunction · 0.85
lappendFunction · 0.85
makeBoolExprFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected