pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid failure when selecting a namespace node in XMLTABLE.
Date: Fri, 25 Oct 2019 19:23:30 +0000
Message-ID: <E1iO5BK-0006sD-Le@gemulon.postgresql.org> (raw)

Avoid failure when selecting a namespace node in XMLTABLE.

It appears that libxml2 doesn't bother to set the "children" field of
an XML_NAMESPACE_DECL node to null; that field just contains garbage.
In v10 and v11, this can result in a crash in XMLTABLE().  The rewrite
done in commit 251cf2e27 fixed this, somewhat accidentally, in v12.
We're not going to back-patch 251cf2e27, however.  The case apparently
doesn't have wide use, so rather than risk introducing other problems,
just add a safety check to throw an error.

Even though no bug manifests in v12/HEAD, add the relevant test case
there too, to prevent future regressions.

Chapman Flack (per private report)

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/test/regress/expected/xml.out   | 8 ++++++++
src/test/regress/expected/xml_1.out | 8 ++++++++
src/test/regress/expected/xml_2.out | 8 ++++++++
src/test/regress/sql/xml.sql        | 4 ++++
4 files changed, 28 insertions(+)



view thread (4+ messages)  latest in thread

Message-ID: <E1iO5BK-0006sD-Le@gemulon.postgresql.org>
Permalink:  ../E1iO5BK-0006sD-Le@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iO5BK-0006sD-Le@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid failure when selecting a namespace node in XMLTABLE.
  In-Reply-To: <E1iO5BK-0006sD-Le@gemulon.postgresql.org>
  References: <E1iO5BK-0006sD-Le@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