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. <[email protected]>

Branch
------
master

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

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(-)

Reply via email to