postgresql/src/pl/plpython/expected
Tom Lane f469f634ad Fix plpython crash when returning string representation of a RECORD result.
PLyString_ToComposite() blithely overwrote proc->result.out.d, even though
for a composite result type the other union variant proc->result.out.r is
the one that should be valid.  This could result in a crash if out.r had
in fact been filled in (proc->result.is_rowtype == 1) and then somebody
later attempted to use that data; as per bug #13579 from Paweł Michalak.

Just to add insult to injury, it didn't work for RECORD results anyway,
because record_in() would refuse the case.

Fix by doing the I/O function lookup in a local PLyTypeInfo variable,
as we were doing already in PLyObject_ToComposite().  This is not a great
technique because any fn_extra data allocated by the input function will
be leaked permanently (thanks to using TopMemoryContext as fn_mcxt).
But that's a pre-existing issue that is much less serious than a crash,
so leave it to be fixed separately.

This bug would be a potential security issue, except that plpython is
only available to superusers and the crash requires coding the function
in a way that didn't work before today's patches.

Add regression test cases covering all the supported methods of converting
composite results.

Back-patch to 9.1 where the faulty coding was introduced.
2015-08-21 12:21:37 -04:00
..
plpython_composite.out Fix plpython crash when returning string representation of a RECORD result. 2015-08-21 12:21:37 -04:00
plpython_do.out PL/Python: Adjust the regression tests for Python 3.4 2014-04-29 22:16:16 -04:00
plpython_drop.out
plpython_error.out
plpython_error_0.out
plpython_error_5.out PL/Python: Make tests pass with Python 3.5 2015-08-13 23:55:20 -04:00
plpython_global.out
plpython_import.out
plpython_newline.out
plpython_params.out
plpython_populate.out
plpython_quote.out
plpython_record.out
plpython_schema.out
plpython_setof.out Add a regression test case for plpython function returning setof RECORD. 2013-12-11 17:22:55 -05:00
plpython_spi.out Improve support for composite types in PL/Python. 2014-07-03 16:10:50 -04:00
plpython_subtransaction.out PL/Python: Make tests pass with Python 3.5 2015-08-13 23:55:20 -04:00
plpython_subtransaction_0.out PL/Python: Make tests pass with Python 3.5 2015-08-13 23:55:20 -04:00
plpython_subtransaction_5.out PL/Python: Make tests pass with Python 3.5 2015-08-13 23:55:20 -04:00
plpython_test.out
plpython_trigger.out
plpython_types.out PL/Python: Avoid lossiness in float conversion 2015-03-11 15:46:06 -04:00
plpython_types_3.out PL/Python: Fix regression tests for Python 3 2015-03-11 18:30:56 -04:00
plpython_unicode.out Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:01:54 -04:00
plpython_void.out
README PL/Python: Make tests pass with Python 3.5 2015-08-13 23:55:20 -04:00

Guide to alternative expected files:

plpython_error_0.out			Python 2.4 and older
plpython_error_5.out			Python 3.5 and newer

plpython_unicode.out			server encoding != SQL_ASCII
plpython_unicode_3.out			server encoding == SQL_ASCII

plpython_subtransaction_0.out	Python 2.4 and older (without with statement)
plpython_subtransaction_5.out	Python 2.5 (without with statement)

plpython_types_3.out			Python 3.x