public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ewan Young <[email protected]>
To: Nitin Motiani <[email protected]>
Cc: Zsolt Parragi <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations
Date: Fri, 5 Jun 2026 19:26:26 +0800
Message-ID: <CAON2xHOJKPkcz8vkj7RVaE_U-3T_iVkj5Vwi0=d+Bg=VYiS_1A@mail.gmail.com> (raw)
In-Reply-To: <CAH5HC97_PzdSQNs9bsZS91bLRnpdhz99dWnxe5nRJqD7SbUh-Q@mail.gmail.com>
References: <CAH5HC94yU+K8Gcdy12M5BS8gwD_SXLSHzc9k5tNk7JDnpBiFMA@mail.gmail.com>
	<CAN4CZFP4nZnFvjj7OOLsm9UmG=rdy8w8xk2kKAGL-Yng6n8buQ@mail.gmail.com>
	<CAH5HC96PzfLzNAemhxPMdKRO7U+ubXCkq5zhYxNzm_YoP+VpgQ@mail.gmail.com>
	<CAH5HC97_PzdSQNs9bsZS91bLRnpdhz99dWnxe5nRJqD7SbUh-Q@mail.gmail.com>

Hi,

I reviewed the v2 patch.

The patch applies cleanly on the current master (4cb2a9863d8). I built with
--enable-cassert and ICU, and confirmed that the three backslash test
cases give wrong results on unpatched master and the expected results
with the patch applied. The full regression suite passes (245/245),
including the updated collate.icu.utf8 test.

Two comments:

1. The commit message describes the symptom as "an incorrect match
failure", but the bug also causes incorrect matches in the other
direction. Since the unescaping logic dropped the literal backslash
from the pattern, a text *without* a backslash could wrongly match a
pattern that requires one:

    SELECT 'backslash' COLLATE ignore_accents LIKE 'back\\slash%';
    -- unpatched: t (wrong), patched: f (correct)

I think it's worth mentioning this false-positive side of the bug in
the commit message, since silently-too-permissive LIKE filters are
arguably the more dangerous symptom for applications.

2. A small typo in the new comment in like_match.c:
"occurences" should be "occurrences".

Best regards

On Fri, Jun 5, 2026 at 7:21 PM Nitin Motiani <[email protected]> wrote:
>
> Hi,
>
> I have created a commitfest entry for this patch here
> https://commitfest.postgresql.org/patch/6844/. Please take a look.
>
> Thanks,
> Nitin Motiani
> Google
>
>
>
>






view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations
  In-Reply-To: <CAON2xHOJKPkcz8vkj7RVaE_U-3T_iVkj5Vwi0=d+Bg=VYiS_1A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox