Re: Bogus attribute-number range checks in spi.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Bogus attribute-number range checks in spi.c
Date: 2008-10-15 15:13:24
Message-ID: 19627.1224083604@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> [ pokes around ... ] The difference between correct and incorrect
>> behavior here is that it is correct for SPI_getvalue and SPI_getbinval
>> to return NULL for added columns, but they are incorrect to also set
>> SPI_result to SPI_ERROR_NOATTRIBUTE. However, so far as I can see
>> none of the callers in our CVS bother to check SPI_result :-(.

> I do see several checks against SPI_ERROR_NOATTRIBUTE. I'm not sure what
> context they're in though. pl_exec.c:3606 and pl_exec.c:3940

Those all seem to be checking SPI_fnumber calls. The calls of
SPI_getvalue and SPI_getbinval just assume they cannot get a failure...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-15 15:29:15 Re: Is autovacuum too noisy about orphan temp tables?
Previous Message Decibel! 2008-10-15 15:09:54 Re: Column level triggers