diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-15 14:27:12 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-15 14:27:12 -0500 |
commit | 0c6c5b8a2d94c3ee74e7bba5eedcaae64471e463 (patch) | |
tree | 5602d2456a36ef08a9234f87ee0a1e9e455bc536 /src/pl/plpython/sql/plpython_test.sql | |
parent | e642ca767c72f1c71aabb1ca08c838df3a6cff51 (diff) |
Fix aboriginal mistake in plpython's set-returning-function support.
We must stay in the function's SPI context until done calling the iterator
that returns the set result. Otherwise, any attempt to invoke SPI features
in the python code called by the iterator will malfunction. Diagnosis and
patch by Jan Urbanski, per bug report from Jean-Baptiste Quenot.
Back-patch to 8.2; there was no support for SRFs in previous versions of
plpython.
Diffstat (limited to 'src/pl/plpython/sql/plpython_test.sql')
-rw-r--r-- | src/pl/plpython/sql/plpython_test.sql | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pl/plpython/sql/plpython_test.sql b/src/pl/plpython/sql/plpython_test.sql index dafcae089e9..75d2f06ffc5 100644 --- a/src/pl/plpython/sql/plpython_test.sql +++ b/src/pl/plpython/sql/plpython_test.sql @@ -95,6 +95,8 @@ SELECT test_setof_as_iterator(1, 'list'); SELECT test_setof_as_iterator(2, 'list'); SELECT test_setof_as_iterator(2, null); +SELECT test_setof_spi_in_iterator(); + -- Test tuple returning functions SELECT * FROM test_table_record_as('dict', null, null, false); SELECT * FROM test_table_record_as('dict', 'one', null, false); |