On 6/26/08, Tom Lane <[EMAIL PROTECTED]> wrote:
> "David E. Wheeler" <[EMAIL PROTECTED]> writes:
>  > Datum citext_ne (PG_FUNCTION_ARGS) {
>  >      // Fast path for different-length inputs. Okay for canonical
>  > equivalence?
>  >      if (VARSIZE(PG_GETARG_TEXT_P(0)) != VARSIZE(PG_GETARG_TEXT_P(1)))
>  >          PG_RETURN_BOOL( 1 );
>  >      PG_RETURN_BOOL( citextcmp( PG_ARGS ) != 0 );
>  > }
>
> BTW, I don't think you can use that same-length optimization for
>  citext.  There's no reason to think that upper/lowercase pairs will
>  have the same length all the time in multibyte encodings.

What about this code in current str_tolower():

        /* Output workspace cannot have more codes than input bytes */
        workspace = (wchar_t *) palloc((nbytes + 1) * sizeof(wchar_t));

Bug?

-- 
marko

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

Reply via email to