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

Function exec_stmt_while

src/pl/plpgsql/src/pl_exec.c:2608–2630  ·  view source on GitHub ↗

---------- * exec_stmt_while Loop over statements as long * as an expression evaluates to * true or an exit occurs. * ---------- */

Source from the content-addressed store, hash-verified

2606 * ----------
2607 */
2608static int
2609exec_stmt_while(PLpgSQL_execstate *estate, PLpgSQL_stmt_while *stmt)
2610{
2611 int rc = PLPGSQL_RC_OK;
2612
2613 for (;;)
2614 {
2615 bool value;
2616 bool isnull;
2617
2618 value = exec_eval_boolean(estate, stmt->cond, &isnull);
2619 exec_eval_cleanup(estate);
2620
2621 if (isnull || !value)
2622 break;
2623
2624 rc = exec_stmts(estate, stmt->body);
2625
2626 LOOP_RC_PROCESSING(stmt->label, break);
2627 }
2628
2629 return rc;
2630}
2631
2632
2633/* ----------

Callers 1

exec_stmtsFunction · 0.85

Calls 3

exec_eval_booleanFunction · 0.85
exec_eval_cleanupFunction · 0.85
exec_stmtsFunction · 0.85

Tested by

no test coverage detected