Re: Cleaning up array_in()

Поиск
Список
Период
Сортировка
От Alexander Lakhin
Тема Re: Cleaning up array_in()
Дата
Msg-id 548a24fa-3229-8192-c4e9-01d2cc4c612c@gmail.com
обсуждение исходный текст
Ответ на Re: Cleaning up array_in()  (jian he <jian.universality@gmail.com>)
Ответы Re: Cleaning up array_in()  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
11.09.2023 08:26, jian he wrote:
> hi.
> Thanks for reviewing it.
>
>> DETAIL:  Unexpected end of input.
> In many cases, ending errors will happen, so I consolidate it.
>
> SELECT '{{},}'::text[];
> solved by tracking current token type and previous token type.
>
> select '{\{}'::text[];
> solved by update dstendptr.
>
> attached.

Thank you!
I can confirm that all those anomalies are fixed now.
But new version brings a warning when compiled with gcc:
arrayfuncs.c:659:9: warning: variable 'prev_tok' is uninitialized when used here [-Wuninitialized]
                                 if (prev_tok == ATOK_DELIM || nest_level == 0)
                                     ^~~~~~~~
arrayfuncs.c:628:3: note: variable 'prev_tok' is declared here
                 ArrayToken      prev_tok;
                 ^
1 warning generated.

Also it looks like an updated comment needs fixing/improving:
  /* No array dimensions, so first literal character should be oepn curl-braces */
(should be an opening brace?)

(I haven't look at the code closely.)

Best regards,
Alexander



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

Предыдущее
От: Jelte Fennema
Дата:
Сообщение: Re: proposal: psql: show current user in prompt
Следующее
От: David Rowley
Дата:
Сообщение: Re: Speed up transaction completion faster after many relations are accessed in a transaction