Re: UTF8MatchText - Mailing list pgsql-patches

From Tom Lane
Subject Re: UTF8MatchText
Date
Msg-id 18822.1179459082@sss.pgh.pa.us
Whole thread Raw
In response to Re: UTF8MatchText  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: UTF8MatchText  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> Attached is my current WIP patch.

A few quick eyeball comments:

> ! static __inline__ int

Under *no* circumstances use __inline__, as it will certainly break
every non-gcc compiler.  Use "inline", which we #define appropriately
at need.

> !          * UTF8 has disjoint representations for first-bytes and
> !          * not-first-bytes of MB characters, and thus it is
> !          * impossible to make a false match in which an MB pattern
> !          * character is matched to the end of one data character
> !          * plus the start of another.
> !          * In character sets without that property, we have to use the
> !          * slow way to ensure we don't make out-of-sync matches.

I thought we'd concluded that this explanation is pseudo-science?

> !          * Branch for non-utf8 multi-byte charsets and also for single-byte
> !          * charsets which don't gain any benefir from the above optimisation.

spellcheck...

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: UTF8MatchText
Next
From: Andrew Dunstan
Date:
Subject: Re: UTF8MatchText