Re: CASE control block broken by a single line comment

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CASE control block broken by a single line comment
Дата
Msg-id 2730343.1712464392@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CASE control block broken by a single line comment  (Erik Wienhold <ewie@ewie.name>)
Ответы Re: CASE control block broken by a single line comment
Список pgsql-hackers
Erik Wienhold <ewie@ewie.name> writes:
> On 2024-04-06 20:14 +0200, Michal Bartak wrote:
>> The issue described bellow exists in postgresql ver 16.2 (found in some
>> previous major versions)

> Can confirm also on master.

I'm sure it's been there a while :-(

> I'm surprised that the comment is not skipped by the scanner at this
> point.  Maybe because the parser just reads the raw expression between
> WHEN and THEN with plpgsql_append_source_text via read_sql_construct.

> How about the attached patch?  It's a workaround by simply adding a line
> feed character between the raw expression and the closing parenthesis.

I don't have time to look into this on this deadline weekend, but
what's bothering me about this report is the worry that we've made
the same mistake elsewhere, or will do so in future.  I suspect
it'd be much more robust if we could remove the comment from the
expr->query string.  No idea how hard that is.

            regards, tom lane



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

Предыдущее
От: jian he
Дата:
Сообщение: Re: remaining sql/json patches
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Improve heapgetpage() performance, overhead from serializable