Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations
Date
Msg-id 4161801.1783114393@sss.pgh.pa.us
Whole thread
In response to Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations  (Nitin Motiani <nitinmotiani@google.com>)
Responses Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations
List pgsql-hackers
Nitin Motiani <nitinmotiani@google.com> writes:
> I have updated the commit message. I also added another test for this
> scenario in v3.

I don't think this patch is ready.  It is wasting code and cycles to
fix a nonexistent problem.  We are working in a backend-safe encoding,
therefore it is not possible for one byte of a multibyte character to
match '\' (nor '_' nor '%').  So the existing logic that pays no
attention to multibyte boundaries is not wrong, and if it were then
the preceding loop that looks for the end of the literal-match
substring would also be wrong (as well as some hundreds of other
places that make similar assumptions).

This code does get consecutive-backslash cases wrong, and we need
to fix that, but we don't need to add complexity to fix something
that's not broken.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Dmitry Fomin
Date:
Subject: Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation
Next
From: Dmitry Fomin
Date:
Subject: Re: [PATCH v1 0/7] Wait event timing and tracing instrumentation