]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assertion failure with PL/Python exceptions
authorMichael Paquier <michael@paquier.xyz>
Mon, 18 Sep 2023 23:31:22 +0000 (08:31 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 18 Sep 2023 23:31:22 +0000 (08:31 +0900)
commitf171430f089a349cb5694fb43a64579d6a9c2a2b
treebc15260c65c8ddccac0350b887a7835ca28aa701
parentec693a3f304cf91c717c0fe07abcd4185952fde5
Fix assertion failure with PL/Python exceptions

PLy_elog() was not able to handle correctly cases where a SPI called
failed, which would fill in a DETAIL string able to trigger an
assertion.  We may want to improve this infrastructure so as it is able
to provide any extra detail information provided by an error stack, but
this is left as a future improvement as it could impact existing error
stacks and any applications that depend on them.  For now, the assertion
is removed and a regression test is added to cover the case of a failure
with a detail string.

This problem exists since 2bd78eb8d51c, so backpatch all the way down
with tweaks to the regression tests output added where required.

Author: Alexander Lakhin
Discussion: https://postgr.es/m/18070-ab9c171cbf4ebb0f@postgresql.org
Backpatch-through: 11
src/pl/plpython/expected/plpython_error.out
src/pl/plpython/expected/plpython_error_5.out
src/pl/plpython/plpy_elog.c
src/pl/plpython/sql/plpython_error.sql