Fix bug in CONTINUE statement for PL/pgSQL: when we continue a loop,
Neil Conway <neilc@samurai.com>
Fix bug in CONTINUE statement for PL/pgSQL: when we continue a loop, we need to be careful to reset rc to PLPGSQL_RC_OK, depending on how the loop's logic is structured. If we continue a loop but it then exits without executing the loop's body again, we want to return PLPGSQL_RC_OK to our caller. Enhance the regression tests to catch this problem. Per report from Michael Fuhr.
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpgsql/src/pl_exec.c | modified | +26 −21 |
| src/test/regress/expected/plpgsql.out | modified | +39 −1 |
| src/test/regress/sql/plpgsql.sql | modified | +27 −1 |