Re: regexp_split_to_array hangs backend

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: regexp_split_to_array hangs backend
Дата
Msg-id 15028.1186786356@sss.pgh.pa.us
обсуждение исходный текст
Ответ на regexp_split_to_array hangs backend  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-hackers
"Pavel Stehule" <pavel.stehule@gmail.com> writes:
> I found small bug

> regexp_split_to_array('123456','1');
> regexp_split_to_array('123456','6');
> regexp_split_to_array('123456','.');

> these parameters hangs backend.

This code's got more problems than that :-(

The one that's bothering me right now is that regexp_match() and
regexp_split() cache a compiled regex on first entry to the function,
and then blithely assume it will still be there on repeated calls.

I think probably the best thing to do is do all the matching on the
first call, and have the saved state include an array of character
positions of matches; then repeat calls to the SRF just iterate through
the array.

It seems a bit short of comments too.  Working on it now.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: change name of redirect_stderr?
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Unexpected VACUUM FULL failure