Re: BUG #17477: A crash bug in transformValuesClause()

Поиск
Список
Период
Сортировка
От Jonathan S. Katz
Тема Re: BUG #17477: A crash bug in transformValuesClause()
Дата
Msg-id 6f7f0d34-0f58-41a9-98b5-bf86e1960165@postgresql.org
обсуждение исходный текст
Ответ на Re: BUG #17477: A crash bug in transformValuesClause()  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #17477: A crash bug in transformValuesClause()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #17477: A crash bug in transformValuesClause()  (Masahiko Sawada <sawada.mshk@gmail.com>)
Список pgsql-bugs
On 5/9/22 11:25 AM, Tom Lane wrote:
> Masahiko Sawada <sawada.mshk@gmail.com> writes:
>> It seems like transformValuesClause() cannot handle properly the value
>> clause having a relation that has an empty column. Should we raise an
>> error in this case?
> 
> Given that we try to support zero-column relations, I'm not sure why
> we'd insist on disallowing zero-column VALUES.  I think the problem
> is that the code in transformValuesClause needs to be tweaked to
> make that work.  The attached quick hack seems to do the trick.

Agree with the reasoning.

Confirmed reproducing the crash and that this fixes it. I did a short 
double-take on the error message:

    ERROR:  subquery must return only one column

but it is accurate, given this is what the subquery must do, and zero != 
one.

I don't see anything glaring in the code (though I'm not that familiar 
with this part of the codebase), but given this seems like an extreme 
edge case and protects against a crash, I'm satisfied with this.

Jonathan

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17478: Missing documents in the index after CREATE INDEX CONCURRENTLY (but existing in the table)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17477: A crash bug in transformValuesClause()