pgsql: Use multibyte-aware extraction of pattern prefixes.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use multibyte-aware extraction of pattern prefixes.
Date: 2025-12-15 18:26:50
Message-ID: E1vVDHV-000wjh-2T@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use multibyte-aware extraction of pattern prefixes.

Previously, like_fixed_prefix() used char-at-a-time logic, which
forced it to be too conservative for case-insensitive matching.

Introduce like_fixed_prefix_ci(), and use that for case-insensitive
pattern prefixes. It uses multibyte and locale-aware logic, along with
the new pg_iswcased() API introduced in 630706ced0.

Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d.camel@j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c8de1596912b36a8b22d880766ac660b66d03c7

Modified Files
--------------
src/backend/utils/adt/like_support.c | 169 +++++++++++++++++++++++------------
1 file changed, 112 insertions(+), 57 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2025-12-15 19:34:58 pgsql: Remove incorrect declarations in pg_wchar.h.
Previous Message Tom Lane 2025-12-15 17:40:42 pgsql: Add offnum range checks to suppress compile warnings with UBSAN.