pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@postgresql.org
Subject: pgsql: Ignore XML declaration in xpath_internal(), for UTF8 databases.
Date: Sat, 11 Nov 2017 20:02:56 +0000
Message-ID: <E1eDbzU-0004G2-LZ@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Ignore XML declaration in xpath_internal(), for UTF8 databases.

When a value contained an XML declaration naming some other encoding,
this function interpreted UTF8 bytes as the named encoding, yielding
mojibake.  xml_parse() already has similar logic.  This would be
necessary but not sufficient for non-UTF8 databases, so preserve
behavior there until the xpath facility can support such databases
comprehensively.  Back-patch to 9.3 (all supported versions).

Pavel Stehule and Noah Misch

Discussion: https://postgr.es/m/CAFj8pRC-dM=tT=QkGi+Achkm+gwPmjyOayGuUfXVumCxkDgYWg@mail.gmail.com

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/utils/adt/xml.c         | 14 +++++++++++++-
src/test/regress/expected/xml.out   | 31 +++++++++++++++++++++++++++++++
src/test/regress/expected/xml_1.out | 35 +++++++++++++++++++++++++++++++++++
src/test/regress/expected/xml_2.out | 31 +++++++++++++++++++++++++++++++
src/test/regress/sql/xml.sql        | 32 ++++++++++++++++++++++++++++++++
5 files changed, 142 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1eDbzU-0004G2-LZ@gemulon.postgresql.org>
Permalink:  ../E1eDbzU-0004G2-LZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eDbzU-0004G2-LZ@gemulon.postgresql.org

 · 

reply

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: noah@leadboat.com
  Subject: Re: pgsql: Ignore XML declaration in xpath_internal(), for UTF8 databases.
  In-Reply-To: <E1eDbzU-0004G2-LZ@gemulon.postgresql.org>
  References: <E1eDbzU-0004G2-LZ@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