Detect mismatched CONTINUE and EXIT statements at plpgsql compile time.
Tom Lane <tgl@sss.pgh.pa.us>
Detect mismatched CONTINUE and EXIT statements at plpgsql compile time. With a bit of tweaking of the compile namestack data structure, we can verify at compile time whether a CONTINUE or EXIT is legal. This is surely better than leaving it to runtime, both because earlier is better and because we can issue a proper error pointer. Also, we can get rid of the ad-hoc old way of detecting the problem, which only took care of CONTINUE not EXIT. Jim Nasby, adjusted a bit by me
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpgsql/src/pl_comp.c | modified | +2 −2 |
| src/pl/plpgsql/src/pl_exec.c | modified | +9 −39 |
| src/pl/plpgsql/src/pl_funcs.c | modified | +21 −2 |
| src/pl/plpgsql/src/pl_gram.y | modified | +59 −11 |
| src/pl/plpgsql/src/plpgsql.h | modified | +16 −1 |
| src/test/regress/expected/plpgsql.out | modified | +68 −17 |
| src/test/regress/sql/plpgsql.sql | modified | +51 −13 |