Re: PostgreSQL vs SQL/XML Standards - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: PostgreSQL vs SQL/XML Standards
Date
Msg-id 20190308122030.GA8440@alvherre.pgsql
Whole thread Raw
In response to Re: PostgreSQL vs SQL/XML Standards  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: PostgreSQL vs SQL/XML Standards
List pgsql-hackers
On 2019-Mar-08, Pavel Stehule wrote:

> looks like error in xmlXPathCompiledEval function, that produce little bit
> broken result for XML_DOCUMENT_NODE type. I hadn't this problem with
> libxml2 2.7.6 64bit, but I seen this issue on same version on 32bit.
> 
> Currently I had not fresh 32 bit system to check it.
> 
> I found a workaround - in this case copy (and release xmlNode) is not
> necessary.
> 
> please, apply attached patch.

Wow :-(  At this point I'm wondering if this should be put in back
branches as well ... I mean, distill part of commit 251cf2e27bec that
doesn't affect the behavior of text nodes, and put it on all branches
together with your fix?

Another thought: should we refuse to work on known-broken libxml2
versions?  Seems like this bug could affect other parts of code too -- I
see that xmlXPathCompiledEval() is called in file places (including two
in contrib/xml2).

Third thought: an alternative might be to create a wrapper for
xmlXPathCompiledEval that detects NULL content and fills in a pointer
that xmlFreeNode can free.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: Online verification of checksums
Next
From: Peter Eisentraut
Date:
Subject: Re: Reporting script runtimes in pg_regress