pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Pin two ctype-dependent test_regex_utf8 cases to pg_c_utf8
Date: Wed, 26 Aug 2026 20:25:46 +0000
Message-ID: <E1wzKBt-00000002Epf-3eVC@gemulon.postgresql.org> (raw)

Pin two ctype-dependent test_regex_utf8 cases to pg_c_utf8

test_regex_utf8 decides whether to run by looking at the database
encoding alone, but two of its cases, [[:graph:]] and [[:print:]] over
E'xᔀሷ', depend on the ctype as well.  In a database with encoding
UTF8 and locale C they match just the x, because isgraph() and isprint()
are false for anything outside ASCII, and the file fails.

No buildfarm animal builds such a cluster, which is why this went
unnoticed, and why the to_date() crash in 18.5 went undetected for want
of exactly this coverage.  A pending buildfarm client change will let an
animal be configured that way.

Fix by giving the two cases an explicit collation, so that they exercise
a fixed Unicode ctype instead of whatever the database happened to be
initialized with.  test_regex() already passes its input collation down
to the regex compiler.  The expected results are unchanged; only the
echoed queries differ.

Backpatch-through: 17 (15 and 16 get a different fix)

Reviewed-by: Jonathan Gonzalez V. <jonathan@abdiel.eu>

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8554d746964dd6ceaea827e7edbc45a1bc5948c9

Modified Files
--------------
src/test/modules/test_regex/expected/test_regex_utf8.out | 6 ++++--
src/test/modules/test_regex/sql/test_regex_utf8.sql      | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1wzKBt-00000002Epf-3eVC@gemulon.postgresql.org>
Permalink:  ../E1wzKBt-00000002Epf-3eVC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wzKBt-00000002Epf-3eVC@gemulon.postgresql.org

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: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Pin two ctype-dependent test_regex_utf8 cases to pg_c_utf8
  In-Reply-To: <E1wzKBt-00000002Epf-3eVC@gemulon.postgresql.org>

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

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