---------- * exec_stmt_exit Implements EXIT and CONTINUE * * This begins the process of exiting / restarting a loop. * ---------- */
| 3101 | * ---------- |
| 3102 | */ |
| 3103 | static int |
| 3104 | exec_stmt_exit(PLpgSQL_execstate *estate, PLpgSQL_stmt_exit *stmt) |
| 3105 | { |
| 3106 | /* |
| 3107 | * If the exit / continue has a condition, evaluate it |
| 3108 | */ |
| 3109 | if (stmt->cond != NULL) |
| 3110 | { |
| 3111 | bool value; |
| 3112 | bool isnull; |
| 3113 | |
| 3114 | value = exec_eval_boolean(estate, stmt->cond, &isnull); |
| 3115 | exec_eval_cleanup(estate); |
| 3116 | if (isnull || value == false) |
| 3117 | return PLPGSQL_RC_OK; |
| 3118 | } |
| 3119 | |
| 3120 | estate->exitlabel = stmt->label; |
| 3121 | if (stmt->is_exit) |
| 3122 | return PLPGSQL_RC_EXIT; |
| 3123 | else |
| 3124 | return PLPGSQL_RC_CONTINUE; |
| 3125 | } |
| 3126 | |
| 3127 | |
| 3128 | /* ---------- |
no test coverage detected