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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bogus attribute-number range checks in spi.c
Дата
Msg-id 8244.1224039579@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bogus attribute-number range checks in spi.c  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: Bogus attribute-number range checks in spi.c  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> * tupdesc has more columns than the tuple does.  This is possible after
>> ALTER TABLE ADD COLUMN, for example.  The correct interpretation in
>> this situation is that the extra columns exist but are NULL.  Throwing
>> an error is not correct.

> Shouldn't this be failing then? If something like this does fail then
> definitely back-patchable++.

[ 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 :-(.  So there
is no visible failure in any test case using our code.  You'd need a
third-party module that was actually paying attention to the documented
error-reporting convention.

Maybe that means it's not worth back-patching, but it still looks like
a bug to me.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Bogus attribute-number range checks in spi.c
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bogus attribute-number range checks in spi.c