Re: Latest on CITEXT 2.0

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Latest on CITEXT 2.0
Date: 2008-07-01 14:50:43
Message-ID: e51f66da0807010750w31aae655h553578ce7aba9d78@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/26/08, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "David E. Wheeler" <david(at)kineticode(dot)com> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-01 14:52:16 Re: Latest on CITEXT 2.0
Previous Message Tom Lane 2008-07-01 14:38:32 Re: PATCH: CITEXT 2.0