Re: PATCH: CITEXT 2.0 v3
| От | Tom Lane |
|---|---|
| Тема | Re: PATCH: CITEXT 2.0 v3 |
| Дата | |
| Msg-id | 444.1215819944@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: PATCH: CITEXT 2.0 v3 ("David E. Wheeler" <david@kineticode.com>) |
| Ответы |
Re: PATCH: CITEXT 2.0 v3
|
| Список | pgsql-hackers |
"David E. Wheeler" <david@kineticode.com> writes:
> lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
> rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
> result = varstr_cmp(
> lcstr,
> VARSIZE_ANY_EXHDR(left),
> rcstr,
> VARSIZE_ANY_EXHDR(right)
> );
Not sure about a memory leak, but this code is clearly wrong if
str_tolower results in a change of physical string length (clearly
possible in Turkish, for instance, and probably in some other
locales too). You need to do strlen's on the lowercased strings.
regards, tom lane
В списке pgsql-hackers по дате отправления: