Re: [HACKERS] [sqlsmith] Crash in tsquery_rewrite/QTNBinary

Поиск
Список
Период
Сортировка
От Artur Zakirov
Тема Re: [HACKERS] [sqlsmith] Crash in tsquery_rewrite/QTNBinary
Дата
Msg-id CAKNkYnyD=u+wVreeg+5shFa==PstJFboZY3rUBbynZE5y8WpzA@mail.gmail.com
обсуждение исходный текст
Ответ на [sqlsmith] Crash in tsquery_rewrite/QTNBinary  (Andreas Seltenreich <seltenreich@gmx.de>)
Ответы Re: [HACKERS] [sqlsmith] Crash in tsquery_rewrite/QTNBinary
Список pgsql-hackers
Hi,

2016-12-07 9:06 GMT+03:00 Andreas Seltenreich <seltenreich@gmx.de>:
> Hi,
>
> the following query crashes master as of 4212cb7.
>
> select ts_rewrite(
>           tsquery_phrase(
>              tsquery $$'sanct' & 'peter'$$,
>              tsquery $$'5' <-> '6'$$,
>              42),
>           tsquery $$'5' <-> '6'$$,
>           plainto_tsquery('I') );
>

This happens also for queries:

select ts_rewrite(
          to_tsquery('5 & (6 | 5)'),
          to_tsquery('5'),
          to_tsquery('I'));

select ts_rewrite(
          to_tsquery('5 & 6 <-> 5'),
          to_tsquery('5'),
          to_tsquery('I'));

It happens because 'I' is stop word and substitute query becomes
empty. And for queries above we need recursive dropvoidsubtree()
function. Without this patch this function cleans only first level of
tree. And query above becomes: '6 | void'.

Firstly I made recursive dropvoidsubtree(). But attached patch cleans
query tree in dofindsubquery() to avoid extra tree scan.

-- 
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.
Следующее
От: Petr Jelinek
Дата:
Сообщение: [HACKERS] snapbuild woes