]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
EUC_CN, EUC_JP, EUC_KR, EUC_TW: Skip U+00A0 tests instead of failing.
authorNoah Misch <noah@leadboat.com>
Thu, 26 Feb 2026 02:13:22 +0000 (18:13 -0800)
committerNoah Misch <noah@leadboat.com>
Thu, 26 Feb 2026 02:13:25 +0000 (18:13 -0800)
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 c67bef3f3252a3a38bf347f9f119944176a796ce.  Back-patch
to v14, like that commit.

Discussion: https://postgr.es/m/20260217184758.da.noahmisch@microsoft.com
Backpatch-through: 14

14 files changed:
src/pl/plperl/GNUmakefile
src/pl/plperl/expected/plperl_elog.out
src/pl/plperl/expected/plperl_elog_1.out
src/pl/plperl/expected/plperl_unicode.out [new file with mode: 0644]
src/pl/plperl/expected/plperl_unicode_1.out [new file with mode: 0644]
src/pl/plperl/meson.build
src/pl/plperl/sql/plperl_elog.sql
src/pl/plperl/sql/plperl_unicode.sql [new file with mode: 0644]
src/pl/plpython/expected/plpython_unicode.out
src/pl/plpython/expected/plpython_unicode_1.out [new file with mode: 0644]
src/pl/plpython/sql/plpython_unicode.sql
src/pl/tcl/expected/pltcl_unicode.out
src/pl/tcl/expected/pltcl_unicode_1.out [new file with mode: 0644]
src/pl/tcl/sql/pltcl_unicode.sql

index 602cb243084d3427e2417d125bd46908c9360fba..88baf15a5e23595fd2f4b44c5b85166a2493c605 100644 (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
index a6d35cb79c4f981d132adda22b92f05a6aa54505..3f9449a9659b48b77232e5819c5c0b445dc41582 100644 (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"
index 85aa460ec4c2c539ab81908f932fcc01675d4651..34d5d5836da22e77aca57018bf82657b5fd9f82d 100644 (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"
diff --git a/src/pl/plperl/expected/plperl_unicode.out b/src/pl/plperl/expected/plperl_unicode.out
new file mode 100644 (file)
index 0000000..3c48f2e
--- /dev/null
@@ -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"
diff --git a/src/pl/plperl/expected/plperl_unicode_1.out b/src/pl/plperl/expected/plperl_unicode_1.out
new file mode 100644 (file)
index 0000000..761de04
--- /dev/null
@@ -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
index 1cfeb978f52644c23a242114f7306de2c61931ff..8fbfda6f1da361c7816338227ced0a6b11b0b7bd 100644 (file)
@@ -88,6 +88,7 @@ tests += {
       'plperl_trigger',
       'plperl_shared',
       'plperl_elog',
+      'plperl_unicode',
       'plperl_util',
       'plperl_init',
       'plperlu',
index 9ea1350069b86a3afc3c9555b01ec32ef1595af5..032fd8b8ba74a570bafc1e00a7f91ddb697567be 100644 (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();
diff --git a/src/pl/plperl/sql/plperl_unicode.sql b/src/pl/plperl/sql/plperl_unicode.sql
new file mode 100644 (file)
index 0000000..7e1ad74
--- /dev/null
@@ -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();
index fd54b0b88e8f8dd0ec412016d9c9f4b34fe3c083..bd8d9c561c956993161ad0ce24134ffa950045c8 100644 (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
diff --git a/src/pl/plpython/expected/plpython_unicode_1.out b/src/pl/plpython/expected/plpython_unicode_1.out
new file mode 100644 (file)
index 0000000..f8b21fd
--- /dev/null
@@ -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
index 14f7b4e0053dbeb0cbfee02f5419e42c21e01382..f45844b906e470d405d231b35200820a66a8c990 100644 (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;
 
index eea7d70664f47fb854ece84e33e07753ce362d7b..d33afd7548f0f52a7429ebcf78260886664e5759 100644 (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
diff --git a/src/pl/tcl/expected/pltcl_unicode_1.out b/src/pl/tcl/expected/pltcl_unicode_1.out
new file mode 100644 (file)
index 0000000..f8b21fd
--- /dev/null
@@ -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
index f0006046127d4c0d7f0b0f86d1f27a3a667615cf..a09e4998b2bf699ae84a5a7cc13e094a2bbb5ac4 100644 (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;