mirror of
https://github.com/postgres/postgres.git
synced 2026-03-09 09:40:40 -04:00
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:
parent
df927d3d08
commit
4cb70f73ea
14 changed files with 109 additions and 58 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
18
src/pl/plperl/expected/plperl_unicode.out
Normal file
18
src/pl/plperl/expected/plperl_unicode.out
Normal 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"
|
||||
10
src/pl/plperl/expected/plperl_unicode_1.out
Normal file
10
src/pl/plperl/expected/plperl_unicode_1.out
Normal 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
|
||||
|
|
@ -88,6 +88,7 @@ tests += {
|
|||
'plperl_trigger',
|
||||
'plperl_shared',
|
||||
'plperl_elog',
|
||||
'plperl_unicode',
|
||||
'plperl_util',
|
||||
'plperl_init',
|
||||
'plperlu',
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
19
src/pl/plperl/sql/plperl_unicode.sql
Normal file
19
src/pl/plperl/sql/plperl_unicode.sql
Normal 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();
|
||||
|
|
@ -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
|
||||
|
|
|
|||
12
src/pl/plpython/expected/plpython_unicode_1.out
Normal file
12
src/pl/plpython/expected/plpython_unicode_1.out
Normal 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
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
12
src/pl/tcl/expected/pltcl_unicode_1.out
Normal file
12
src/pl/tcl/expected/pltcl_unicode_1.out
Normal 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
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue