• Tom Lane's avatar
    Fix error handling in PLy_spi_execute_fetch_result(). · b3b10c39
    Tom Lane authored
    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.
    b3b10c39
plpy_spi.c 13.5 KB