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

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Ignore XML declaration in xpath_internal(), for UTF8 databases.
Date: 2017-11-11 20:02:56
Message-ID: E1eDbzU-0004G5-Lk@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2f4061aff504049767602927e69c85b5b4621273

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2017-11-11 21:11:17 pgsql: Fix previous commit's test, for non-UTF8 databases with non-XML
Previous Message Andreas Seltenreich 2017-11-11 17:28:14 Re: pgsql: Remove secondary checkpoint