Обсуждение: pgsql: Use xmlParseInNodeContext not xmlParseBalancedChunkMemory.

Поиск
Список
Период
Сортировка

pgsql: Use xmlParseInNodeContext not xmlParseBalancedChunkMemory.

От
Tom Lane
Дата:
Use xmlParseInNodeContext not xmlParseBalancedChunkMemory.

xmlParseInNodeContext has basically the same functionality with
a different API: we have to supply an xmlNode that's attached to a
document rather than just the document.  That's not hard though.
The benefits are two:

* Early 2.13.x releases of libxml2 contain a bug that causes
xmlParseBalancedChunkMemory to return the wrong status value in some
cases.  This breaks our regression tests.  While that bug is now fixed
upstream and will probably never be seen in any production-oriented
distro, it is currently a problem on some more-bleeding-edge-friendly
platforms.

* xmlParseBalancedChunkMemory is considered to depend on libxml2's
semi-deprecated SAX1 APIs, and will go away when and if they do.
There may already be libxml2 builds out there that lack this function.

So there are both short- and long-term reasons to make this change.

While here, avoid allocating an xmlParserCtxt in DOCUMENT parse mode,
since that code path is not going to use it.

Like 066e8ac6e, this will need to be back-patched.  This is just a
trial commit to see if the buildfarm agrees that we can use
xmlParseInNodeContext unconditionally.

Erik Wienhold and Tom Lane, per report from Frank Streitzig.

Discussion: https://postgr.es/m/trinity-b0161630-d230-4598-9ebc-7a23acdb37cb-1720186432160@3c-app-gmx-bap25
Discussion: https://postgr.es/m/trinity-361ba18b-541a-4fe7-bc63-655ae3a7d599-1720259822452@3c-app-gmx-bs01

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6082b3d5d3d141aa1ec67ff98955a0d8e12d0e1a

Modified Files
--------------
src/backend/utils/adt/xml.c | 75 +++++++++++++++++++++++++++++++--------------
1 file changed, 52 insertions(+), 23 deletions(-)