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

Function is_true_boolean_expression

src/bin/psql/command.c:2893–2902  ·  view source on GitHub ↗

* Read a boolean expression, return true if the expression * was a valid boolean expression that evaluated to true. * Otherwise return false. * * Note: conditional stack's top state must be active, else lexer will * fail to expand variables and backticks. */

Source from the content-addressed store, hash-verified

2891 * fail to expand variables and backticks.
2892 */
2893static bool
2894is_true_boolean_expression(PsqlScanState scan_state, const char *name)
2895{
2896 PQExpBuffer buf = gather_boolean_expression(scan_state);
2897 bool value = false;
2898 bool success = ParseVariableBool(buf->data, name, &value);
2899
2900 destroyPQExpBuffer(buf);
2901 return success && value;
2902}
2903
2904/*
2905 * Read a boolean expression, but do nothing with it.

Callers 2

exec_command_ifFunction · 0.85
exec_command_elifFunction · 0.85

Calls 3

ParseVariableBoolFunction · 0.85
destroyPQExpBufferFunction · 0.85

Tested by

no test coverage detected