Re: UTF8MatchText - Mailing list pgsql-patches

From db@zigo.dhs.org
Subject Re: UTF8MatchText
Date
Msg-id 57644.192.121.104.48.1179727084.squirrel@zigo.dhs.org
Whole thread Raw
In response to Re: UTF8MatchText  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: UTF8MatchText  (Andrew Dunstan <andrew@dunslane.net>)
List 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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY-able csv log outputs
Next
From: NikhilS
Date:
Subject: Re: CREATE TABLE LIKE INCLUDING INDEXES support