Re: UTF8MatchText

From: db(at)zigo(dot)dhs(dot)org
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Dennis Bjorklund" <db(at)zigo(dot)dhs(dot)org>, "ITAGAKI Takahiro" <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, "Bruce Momjian" <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: UTF8MatchText
Date: 2007-05-21 05:58:04
Message-ID: 57644.192.121.104.48.1179727084.squirrel@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Doh, you're right ... but on third thought, what happens with a pattern
> containing "%_"? If % tries to advance bytewise then we'll be trying to
> apply NextChar in the middle of a data character, and bad things ensue.

Right, when you have '_' after a '%' you need to make sure the '%'
advances full characters. In my suggestion the test if '_' (or '\') come
after the '%' is done once and it select which of the two loops to use,
the one that do byte stepping or the one with NextChar.

It's difficult to know for sure that we have thought about all the corner
cases. I hope the gain is worth the effort.. :-)

/Dennis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message NikhilS 2007-05-21 06:53:42 Re: CREATE TABLE LIKE INCLUDING INDEXES support
Previous Message Shachar Shemesh 2007-05-21 05:04:41 Re: Re: [Oledb-dev] double precision error with pg linux server, but not with windows pg server

Browse pgsql-patches by date

  From Date Subject
Next Message NikhilS 2007-05-21 06:53:42 Re: CREATE TABLE LIKE INCLUDING INDEXES support
Previous Message Tom Lane 2007-05-21 03:47:50 Re: COPY-able csv log outputs