diff options
| author | Noah Misch <noah@leadboat.com> | 2015-02-25 23:48:28 -0500 |
|---|---|---|
| committer | Noah Misch <noah@leadboat.com> | 2015-02-25 23:48:28 -0500 |
| commit | f5ef00aed4c39645716cabb2e4cf1ef3598fcde7 (patch) | |
| tree | 508d8bfd472cb06772338395101758745a3a5993 /src/test/regress/expected/plpgsql.out | |
| parent | 62a4a1af5d1d84f0023bc3816c204191b0f4f49f (diff) | |
| download | postgresql-f5ef00aed4c39645716cabb2e4cf1ef3598fcde7.tar.gz | |
Free SQLSTATE and SQLERRM no earlier than other PL/pgSQL variables.
"RETURN SQLERRM" prompted plpgsql_exec_function() to read from freed
memory. Back-patch to 9.0 (all supported versions). Little code ran
between the premature free and the read, so non-assert builds are
unlikely to witness user-visible consequences.
Diffstat (limited to 'src/test/regress/expected/plpgsql.out')
| -rw-r--r-- | src/test/regress/expected/plpgsql.out | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out index daf3447915..2c0b2e5e2b 100644 --- a/src/test/regress/expected/plpgsql.out +++ b/src/test/regress/expected/plpgsql.out @@ -2655,9 +2655,21 @@ NOTICE: P0001 user exception (1 row) +create function excpt_test4() returns text as $$ +begin + begin perform 1/0; + exception when others then return sqlerrm; end; +end; $$ language plpgsql; +select excpt_test4(); + excpt_test4 +------------------ + division by zero +(1 row) + drop function excpt_test1(); drop function excpt_test2(); drop function excpt_test3(); +drop function excpt_test4(); -- parameters of raise stmt can be expressions create function raise_exprs() returns void as $$ declare |
