Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Fix for bug #19474: LIKE fails to match literal backslashes with nondeterministic collations
Date: 2026-05-14 17:58:29
Message-ID: CAN4CZFP4nZnFvjj7OOLsm9UmG=rdy8w8xk2kKAGL-Yng6n8buQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

I verified that the patch works, but I have one concern:

> I didn't check for the end of the
> string because that check is already handled in the block above when
> checking for escape characters.

The code isn't easy to reason about like this, it relies on specific
details of the outer loop, which was only mentioned in the email
itself.

This should be also explained in a comment and the commit message, or
maybe instead of the current way, the loop could work similarly like
how another loop uses an afterescape flag in do_like_escape (in the
same file), that form seems less fragile.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-05-14 18:03:36 Re: Fix bug of COPY TO support partition table
Previous Message Fujii Masao 2026-05-14 17:57:18 postgres_fdw: use_scram_passthrough on user mapping is ignored when also set on server