agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix LIKE matching with nondeterministic collations and backslash
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix LIKE matching with nondeterministic collations and backslash
@ 2026-07-06 18:48 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-07-06 18:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix LIKE matching with nondeterministic collations and backslashes.

Commit 85b7efa1c added support for LIKE with nondeterministic
collations, but it included a bug in the de-escaping logic for
literal pattern substrings.  That unconditionally skipped all
backslashes, but when it encounters '\\' it should emit the second
backslash as a de-escaped character.  That led to acting as though
the escaped backslash was not there.

Bug: #19474
Reported-by: Bowen Shi <zxwsbg12138@gmail.com>
Author: Nitin Motiani <nitinmotiani@google.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19474-5b86a95f3d9a7ecb@postgresql.org
Discussion: https://postgr.es/m/CAH5HC94yU+K8Gcdy12M5BS8gwD_SXLSHzc9k5tNk7JDnpBiFMA@mail.gmail.com
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d6ffcae32a10bd9b53fcfe7be507ba00c6083acc

Modified Files
--------------
src/backend/utils/adt/like_match.c             |  5 ++---
src/test/regress/expected/collate.icu.utf8.out | 31 ++++++++++++++++++++++++++
src/test/regress/sql/collate.icu.utf8.sql      |  7 ++++++
3 files changed, 40 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix LIKE matching with nondeterministic collations and backslash
@ 2026-07-06 18:48 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-07-06 18:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix LIKE matching with nondeterministic collations and backslashes.

Commit 85b7efa1c added support for LIKE with nondeterministic
collations, but it included a bug in the de-escaping logic for
literal pattern substrings.  That unconditionally skipped all
backslashes, but when it encounters '\\' it should emit the second
backslash as a de-escaped character.  That led to acting as though
the escaped backslash was not there.

Bug: #19474
Reported-by: Bowen Shi <zxwsbg12138@gmail.com>
Author: Nitin Motiani <nitinmotiani@google.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19474-5b86a95f3d9a7ecb@postgresql.org
Discussion: https://postgr.es/m/CAH5HC94yU+K8Gcdy12M5BS8gwD_SXLSHzc9k5tNk7JDnpBiFMA@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/99775b3885b600277dea577db69e7469e59bcdbe

Modified Files
--------------
src/backend/utils/adt/like_match.c             |  5 ++---
src/test/regress/expected/collate.icu.utf8.out | 31 ++++++++++++++++++++++++++
src/test/regress/sql/collate.icu.utf8.sql      |  7 ++++++
3 files changed, 40 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix LIKE matching with nondeterministic collations and backslash
@ 2026-07-06 18:48 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-07-06 18:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix LIKE matching with nondeterministic collations and backslashes.

Commit 85b7efa1c added support for LIKE with nondeterministic
collations, but it included a bug in the de-escaping logic for
literal pattern substrings.  That unconditionally skipped all
backslashes, but when it encounters '\\' it should emit the second
backslash as a de-escaped character.  That led to acting as though
the escaped backslash was not there.

Bug: #19474
Reported-by: Bowen Shi <zxwsbg12138@gmail.com>
Author: Nitin Motiani <nitinmotiani@google.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Ewan Young <kdbase.hack@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19474-5b86a95f3d9a7ecb@postgresql.org
Discussion: https://postgr.es/m/CAH5HC94yU+K8Gcdy12M5BS8gwD_SXLSHzc9k5tNk7JDnpBiFMA@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a99bd8d584ea268d8a3d02d0f0facb74429ffcf9

Modified Files
--------------
src/backend/utils/adt/like_match.c             |  5 ++---
src/test/regress/expected/collate.icu.utf8.out | 31 ++++++++++++++++++++++++++
src/test/regress/sql/collate.icu.utf8.sql      |  7 ++++++
3 files changed, 40 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-07-06 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-06 18:48 pgsql: Fix LIKE matching with nondeterministic collations and backslash Tom Lane <tgl@sss.pgh.pa.us>
2026-07-06 18:48 pgsql: Fix LIKE matching with nondeterministic collations and backslash Tom Lane <tgl@sss.pgh.pa.us>
2026-07-06 18:48 pgsql: Fix LIKE matching with nondeterministic collations and backslash Tom Lane <tgl@sss.pgh.pa.us>

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