postgresql/src/pl/plpython
Tom Lane 6b3b15e534 Fix refcounting bug in PLy_modify_tuple().
We must increment the refcount on "plntup" as soon as we have the
reference, not sometime later.  Otherwise, if an error is thrown in
between, the Py_XDECREF(plntup) call in the PG_CATCH block removes a
refcount we didn't add, allowing the object to be freed even though
it's still part of the plpython function's parsetree.

This appears to be the cause of crashes seen on buildfarm member
prairiedog.  It's a bit surprising that we've not seen it fail repeatably
before, considering that the regression tests have been exercising the
faulty code path since 2009.

The real-world impact is probably minimal, since it's unlikely anyone would
be provoking the "TD["new"] is not a dictionary" error in production, and
that's the only case that is actually wrong.  Still, it's a bug affecting
the regression tests, so patch all supported branches.

In passing, remove dead variable "plstr", and demote "platt" to a local
variable inside the PG_TRY block, since we don't need to clean it up
in the PG_CATCH path.
2014-03-26 16:41:38 -04:00
..
expected Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:00 -05:00
po Translation updates 2014-02-17 16:56:04 -05:00
sql Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:00 -05:00
.gitignore PL/Python custom SPI exceptions 2011-02-28 18:41:10 +02:00
generate-spiexceptions.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:48 -04:00
Makefile Run "make all" as a prerequisite of "make check" 2011-12-27 20:27:24 +02:00
nls.mk Translation updates 2013-02-04 00:01:19 -05:00
plpy_cursorobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_cursorobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_elog.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_elog.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_exec.c Fix refcounting bug in PLy_modify_tuple(). 2014-03-26 16:41:38 -04:00
plpy_exec.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_main.c Prevent privilege escalation in explicit calls to PL validators. 2014-02-17 09:33:33 -05:00
plpy_main.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_planobject.c PL/Python: Add argument names to function declarations 2011-12-29 22:55:49 +02:00
plpy_planobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_plpymodule.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_procedure.c Silence compiler warning in assertion-enabled builds. 2013-07-02 17:51:50 +03:00
plpy_procedure.h Fix plpython's handling of functions used as triggers on multiple tables. 2013-01-25 16:59:00 -05:00
plpy_resultobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_resultobject.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_spi.c Fix error handling in PLy_spi_execute_fetch_result(). 2013-07-20 12:45:02 -04:00
plpy_spi.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_subxactobject.h add #includes to plpy_subxactobject.h to make it compile standalone 2012-08-28 16:14:31 -04:00
plpy_typeio.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_typeio.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpy_util.c Perform conversion from Python unicode to string/bytes object via UTF-8. 2012-08-06 14:14:44 +03:00
plpy_util.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpython.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
plpython2u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython2u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython2u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpython3u--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython3u.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plpythonu--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpythonu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00