]> granicus.if.org Git - postgresql/commit
Fix error handling in PLy_spi_execute_fetch_result().
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Jul 2013 16:44:37 +0000 (12:44 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Jul 2013 16:45:02 +0000 (12:45 -0400)
commitc0977b465ad26857910cb0a37a2382e2429a7b9a
tree9d7c352a5516fcc25b46d42f9ad3ea50c3c8f1f8
parente8ceb47bd3b86fea9fcf0c30bc3e0ec33ad6616b
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.
src/pl/plpython/plpy_spi.c