pgsql: Fix error handling in PLy_spi_execute_fetch_result(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix error handling in PLy_spi_execute_fetch_result().
Date
Msg-id E1V0aHS-0005EC-N2@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix error handling in PLy_spi_execute_fetch_result().

If an error is thrown out of the datatype I/O functions called by this
function, we need to do subtransaction cleanup, which the previous coding
entirely failed to do.  Fortunately, both existing callers of this function
already have proper cleanup logic, so re-throwing the exception is enough.

Also, postpone creation of the resultset tupdesc until after the I/O
conversions are complete, so that we won't leak memory in TopMemoryContext
when such an error happens.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c0977b465ad26857910cb0a37a2382e2429a7b9a

Modified Files
--------------
src/pl/plpython/plpy_spi.c |   30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix error handling in PLy_spi_execute_fetch_result().
Next
From: Robert Haas
Date:
Subject: pgsql: Add infrastructure for mapping relfilenodes to relation OIDs.