From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix plperl to handle non-ASCII error message texts correctly.
Date: Tue, 29 Sep 2015 14:52:45 +0000
Message-ID: <E1ZgwGr-0004m0-Cr@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Fix plperl to handle non-ASCII error message texts correctly.
We were passing error message texts to croak() verbatim, which turns out
not to work if the text contains non-ASCII characters; Perl mangles their
encoding, as reported in bug #13638 from Michal Leinweber. To fix, convert
the text into a UTF8-encoded SV first.
It's hard to test this without risking failures in different database
encodings; but we can follow the lead of plpython, which is already
assuming that no-break space (U+00A0) has an equivalent in all encodings
we care about running the regression tests in (cf commit 2dfa15de5).
Back-patch to 9.1. The code is quite different in 9.0, and anyway it seems
too risky to put something like this into 9.0's final minor release.
Alex Hunsaker, with suggestions from Tim Bunce and Tom Lane
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/f60b2e2d48976b71a47505b24468617886ac1a31
Modified Files
--------------
src/pl/plperl/SPI.xs | 2 +-
src/pl/plperl/Util.xs | 2 +-
src/pl/plperl/expected/plperl_elog.out | 13 ++++++++++
src/pl/plperl/expected/plperl_elog_1.out | 13 ++++++++++
src/pl/plperl/plperl.c | 12 +++++-----
src/pl/plperl/plperl_helpers.h | 38 ++++++++++++++++++++++++++++++
src/pl/plperl/sql/plperl_elog.sql | 15 ++++++++++++
7 files changed, 87 insertions(+), 8 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix plperl to handle non-ASCII error message texts correctly.
In-Reply-To: <E1ZgwGr-0004m0-Cr@gemulon.postgresql.org>
References: <E1ZgwGr-0004m0-Cr@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox