regexp_split_to_array hangs backend

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема regexp_split_to_array hangs backend
Дата
Msg-id 162867790708100426p73df8f32n47d08ff17822133e@mail.gmail.com
обсуждение исходный текст
Ответы Re: regexp_split_to_array hangs backend
Список pgsql-hackers
Hello,

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.

following patch correct it

Regards
Pavel Stehule

./regexp.c
*** ./regexp.c.orig     2007-08-10 14:17:15.000000000 +0200
--- ./regexp.c  2007-08-10 14:19:36.000000000 +0200
***************
*** 1048,1053 ****
--- 1048,1056 ----               {                       int length = splitctx->match.rm_so - startpos + 1;

+                       /* set the offset to the end of this match for
next time */
+                       splitctx->offset = pmatch->rm_eo;
+                       /*                        * If we are trying to match at the beginning
of the string and                        * we got a zero-length match, or if we just
matched where we
***************
*** 1063,1070 ****
         Int32GetDatum(startpos),
         Int32GetDatum(length));

-                       /* set the offset to the end of this match for
next time */
-                       splitctx->offset = pmatch->rm_eo;
                       return result;               }
--- 1066,1071 ----


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

Предыдущее
От: Omar Bettin
Дата:
Сообщение: Re: communication protocol
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: default_text_search_config and expression indexes