pgsql: Code review for spi_query/spi_fetchrow patch: handle errors

Started by Tom Laneover 20 years ago4 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Code review for spi_query/spi_fetchrow patch: handle errors sanely,
avoid leaking memory. I would add a regression test for error handling
except it seems eval{} can't be used in unprivileged plperl :-(

Modified Files:
--------------
pgsql/src/pl/plperl:
SPI.xs (r1.16 -> r1.17)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/SPI.xs.diff?r1=1.16&r2=1.17)
plperl.c (r1.93 -> r1.94)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plperl/plperl.c.diff?r1=1.93&r2=1.94)

#2David Fetter
david@fetter.org
In reply to: Tom Lane (#1)
Re: pgsql: Code review for spi_query/spi_fetchrow patch: handle errors

On Tue, Oct 18, 2005 at 02:13:14PM -0300, Tom Lane wrote:

Log Message:
-----------
Code review for spi_query/spi_fetchrow patch: handle errors sanely,
avoid leaking memory. I would add a regression test for error
handling except it seems eval{} can't be used in unprivileged plperl
:-(

What would you be using the eval{} to do?

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Fetter (#2)
Re: pgsql: Code review for spi_query/spi_fetchrow patch: handle errors

David Fetter <david@fetter.org> writes:

On Tue, Oct 18, 2005 at 02:13:14PM -0300, Tom Lane wrote:

Log Message:
-----------
Code review for spi_query/spi_fetchrow patch: handle errors sanely,
avoid leaking memory. I would add a regression test for error
handling except it seems eval{} can't be used in unprivileged plperl
:-(

What would you be using the eval{} to do?

Catch the error inside the Perl function.

regards, tom lane

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#3)
Re: pgsql: Code review for spi_query/spi_fetchrow patch:

Tom Lane wrote:

David Fetter <david@fetter.org> writes:

On Tue, Oct 18, 2005 at 02:13:14PM -0300, Tom Lane wrote:

Log Message:
-----------
Code review for spi_query/spi_fetchrow patch: handle errors sanely,
avoid leaking memory. I would add a regression test for error
handling except it seems eval{} can't be used in unprivileged plperl
:-(

What would you be using the eval{} to do?

Catch the error inside the Perl function.

We could load plperlu in addition to plperl for the regression tests -
IIRC you made me make provision for loading multiple languages :-)

cheers

andrew