Re: websearch_to_tsquery() returns queries that don't match to_tsvector()

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: websearch_to_tsquery() returns queries that don't match to_tsvector()
Дата
Msg-id CAPpHfduYuJPf8oJ-SMqK8FOsFcMtK+nBxe=NTPRamUK9DNqP=Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: websearch_to_tsquery() returns queries that don't match to_tsvector()  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: websearch_to_tsquery() returns queries that don't match to_tsvector()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, May 2, 2021 at 9:04 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alexander Korotkov <aekorotkov@gmail.com> writes:
> > Ooops, I've included this by oversight.  The next revision is attached.
> > Anything besides that?
>
> Some quick eyeball review:
>
> +                    /* Everything is quotes is processed as a single token */
>
> Should read "Everything in quotes ..."
>
> -                    /* or else gettoken_tsvector() will raise an error */
> +                    /* or else ƒtsvector() will raise an error */
>
> Looks like an unintentional change?

Thank you for catching this!

> @@ -846,7 +812,6 @@ parse_tsquery(char *buf,
>         state.buffer = buf;
>         state.buf = buf;
>         state.count = 0;
> -       state.in_quotes = false;
>         state.state = WAITFIRSTOPERAND;
>         state.polstr = NIL;
>
> This change seems wrong/unsafe too.

It seems OK, because this patch removes in_quotes field altogether.
We don't have to know whether we in quotes in the state, since we
process everything in quotes as a single token.

------
Regards,
Alexander Korotkov

Вложения

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

Предыдущее
От: Zhihong Yu
Дата:
Сообщение: Re: websearch_to_tsquery() returns queries that don't match to_tsvector()
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: websearch_to_tsquery() returns queries that don't match to_tsvector()