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

Function exec_eval_integer

src/pl/plpgsql/src/pl_exec.c:5568–5582  ·  view source on GitHub ↗

---------- * exec_eval_integer Evaluate an expression, coerce result to int4 * * Note we do not do exec_eval_cleanup here; the caller must do it at * some later point. (We do this because the caller may be holding the * results of other, pass-by-reference, expression evaluations, such as * an array value to be subscripted.) * ---------- */

Source from the content-addressed store, hash-verified

5566 * ----------
5567 */
5568static int
5569exec_eval_integer(PLpgSQL_execstate *estate,
5570 PLpgSQL_expr *expr,
5571 bool *isNull)
5572{
5573 Datum exprdatum;
5574 Oid exprtypeid;
5575 int32 exprtypmod;
5576
5577 exprdatum = exec_eval_expr(estate, expr, isNull, &exprtypeid, &exprtypmod);
5578 exprdatum = exec_cast_value(estate, exprdatum, isNull,
5579 exprtypeid, exprtypmod,
5580 INT4OID, -1);
5581 return DatumGetInt32(exprdatum);
5582}
5583
5584/* ----------
5585 * exec_eval_boolean Evaluate an expression, coerce result to bool

Callers 1

exec_stmt_fetchFunction · 0.85

Calls 3

exec_eval_exprFunction · 0.85
exec_cast_valueFunction · 0.85
DatumGetInt32Function · 0.85

Tested by

no test coverage detected