Re: fix for PL/PgSQL segfault
| От | Tom Lane |
|---|---|
| Тема | Re: fix for PL/PgSQL segfault |
| Дата | |
| Msg-id | 26229.1042742868@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: fix for PL/PgSQL segfault (Neil Conway <neilc@samurai.com>) |
| Список | pgsql-patches |
Neil Conway <neilc@samurai.com> writes:
>> Then, if rec->tup is found to be NULL in RETURN NEXT, that means no
>> attempt has ever been made to assign to the variable. I'm undecided
>> about whether that case should return nulls as per your patch, or should
>> raise an error.
> It seems a little inconsistent to treat a "never-assigned-to" variable
> differently than one which has been the target of a SELECT INTO that
> returns zero rows, doesn't it?
Not entirely; the SELECT INTO is sufficient to determine the rowtype of
the variable, even if it can't stuff any data into the columns. Thus,
for example, we can allow assignment to a field of the record variable
after such a select, whereas we really can't support it when the record
variable is completely without-form-and-void. In the case of RETURN
NEXT, we are able to check that the record's rowtype matches what was
expected.
regards, tom lane
В списке pgsql-patches по дате отправления: