pgsql: Add C test function for pg_locale.h APIs.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add C test function for pg_locale.h APIs.
Date: 2026-08-24 18:57:26
Message-ID: E1wyZrJ-00000001wPW-1VeX@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add C test function for pg_locale.h APIs.

Test the API independently to account for fallback paths that aren't
adequately tested from SQL.

The backport to 18 also tests the previously-supported behavior where
a size of -1 meant that the string was NUL-terminated. That behavior
was later removed in 19.

Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/v36ssaygf7grb3qzfsjhtdzi7kqd45ds56nyuf7gi5qjml4qbb@ezmfqzmhlrs2
Backpatch-through: 18

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/test/regress/expected/misc_functions.out | 40 +++++++
src/test/regress/regress.c | 150 +++++++++++++++++++++++++++
src/test/regress/sql/misc_functions.sql | 25 +++++
3 files changed, 215 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-08-24 20:58:44 pgsql: ltree/crc32.c: fix fragile code.
Previous Message Jeff Davis 2026-08-24 18:57:20 pgsql: Add C test function for pg_locale.h APIs.