EUC_CN, EUC_JP, EUC_KR, EUC_TW: Skip U+00A0 tests instead of failing.

Settings that ran the new test euc_kr.sql to completion would fail these
older src/pl tests.  Use alternative expected outputs, for which psql
\gset and \if have reduced the maintenance burden.  This fixes
"LANG=ko_KR.euckr LC_MESSAGES=C make check-world".  (LC_MESSAGES=C fixes
IO::Pty usage in tests 010_tab_completion and 001_password.)  That file
is new in commit c67bef3f32.  Back-patch
to v14, like that commit.

Discussion: https://postgr.es/m/20260217184758.da.noahmisch@microsoft.com
Backpatch-through: 14
This commit is contained in:
Noah Misch 2026-02-25 18:13:22 -08:00
parent df927d3d08
commit 4cb70f73ea
14 changed files with 109 additions and 58 deletions

View file

@ -62,7 +62,7 @@ endif
REGRESS_OPTS = --dbname=$(PL_TESTDB) --dlpath=$(top_builddir)/src/test/regress
REGRESS = plperl_setup plperl plperl_lc plperl_trigger plperl_shared \
plperl_elog plperl_util plperl_init plperlu plperl_array \
plperl_elog plperl_unicode plperl_util plperl_init plperlu plperl_array \
plperl_call plperl_transaction plperl_env
# if Perl can support two interpreters in one backend,
# test plperl-and-plperlu cases

View file

@ -97,16 +97,3 @@ NOTICE: caught die
2
(1 row)
-- Test non-ASCII error messages
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
SET client_encoding TO UTF8;
create or replace function error_with_nbsp() returns void language plperl as $$
elog(ERROR, "this message contains a no-break space");
$$;
select error_with_nbsp();
ERROR: this message contains a no-break space at line 2.
CONTEXT: PL/Perl function "error_with_nbsp"

View file

@ -97,16 +97,3 @@ NOTICE: caught die
2
(1 row)
-- Test non-ASCII error messages
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
SET client_encoding TO UTF8;
create or replace function error_with_nbsp() returns void language plperl as $$
elog(ERROR, "this message contains a no-break space");
$$;
select error_with_nbsp();
ERROR: this message contains a no-break space at line 2.
CONTEXT: PL/Perl function "error_with_nbsp"

View file

@ -0,0 +1,18 @@
-- Test non-ASCII error messages
--
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;
create or replace function error_with_nbsp() returns void language plperl as $$
elog(ERROR, "this message contains a no-break space");
$$;
select error_with_nbsp();
ERROR: this message contains a no-break space at line 2.
CONTEXT: PL/Perl function "error_with_nbsp"

View file

@ -0,0 +1,10 @@
-- Test non-ASCII error messages
--
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit

View file

@ -88,6 +88,7 @@ tests += {
'plperl_trigger',
'plperl_shared',
'plperl_elog',
'plperl_unicode',
'plperl_util',
'plperl_init',
'plperlu',

View file

@ -76,18 +76,3 @@ return $a + $b;
$$;
select indirect_die_caller();
-- Test non-ASCII error messages
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
SET client_encoding TO UTF8;
create or replace function error_with_nbsp() returns void language plperl as $$
elog(ERROR, "this message contains a no-break space");
$$;
select error_with_nbsp();

View file

@ -0,0 +1,19 @@
-- Test non-ASCII error messages
--
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;
create or replace function error_with_nbsp() returns void language plperl as $$
elog(ERROR, "this message contains a no-break space");
$$;
select error_with_nbsp();

View file

@ -1,11 +1,16 @@
--
-- Unicode handling
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;
CREATE TABLE unicode_test (
testvalue text NOT NULL

View file

@ -0,0 +1,12 @@
--
-- Unicode handling
--
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit

View file

@ -1,11 +1,16 @@
--
-- Unicode handling
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;

View file

@ -1,11 +1,16 @@
--
-- Unicode handling
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;
CREATE TABLE unicode_test (
testvalue text NOT NULL

View file

@ -0,0 +1,12 @@
--
-- Unicode handling
--
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit

View file

@ -1,11 +1,16 @@
--
-- Unicode handling
--
-- Note: this test case is known to fail if the database encoding is
-- EUC_CN, EUC_JP, EUC_KR, or EUC_TW, for lack of any equivalent to
-- U+00A0 (no-break space) in those encodings. However, testing with
-- plain ASCII data would be rather useless, so we must live with that.
-- This test case would fail if the database encoding is EUC_CN, EUC_JP,
-- EUC_KR, or EUC_TW, for lack of any equivalent to U+00A0 (no-break space) in
-- those encodings. However, testing with plain ASCII data would be rather
-- useless, so we must live with that.
--
SELECT getdatabaseencoding() IN ('EUC_CN', 'EUC_JP', 'EUC_KR', 'EUC_TW')
AS skip_test \gset
\if :skip_test
\quit
\endif
SET client_encoding TO UTF8;