Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation
Дата
Msg-id 375807.1764696352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: BUG #19341: REPLACE() fails to match final character when using nondeterministic ICU collation
Список pgsql-bugs
Laurenz Albe <laurenz.albe@cybertec.at> writes:
>>> for (const char *test_end = hptr; test_end <= haystack_end; test_end += pg_mblen(test_end))

> During the last iteration of the loop, "test_end" will be equal to "haystack_end",
> and the loop increment will call "pg_mblen(test_end)".

Right, clearly unsafe (and I bet valgrind would complain about it).
You need to rearrange the loop logic so that we won't attempt to
increment test_end that last time through.  Perhaps a for-loop
isn't the best way to write it.

            regards, tom lane



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