]> granicus.if.org Git - postgresql/commitdiff
Fix XMLTABLE on older libxml2
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Mar 2017 16:29:48 +0000 (13:29 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Mar 2017 16:29:48 +0000 (13:29 -0300)
libxml2 older than 2.9.1 does not have xmlXPathSetContextNode (released
in 2013, so reasonable platforms have trouble).  That function is fairly
trivial, so I have inlined it in the one added caller.  This passes
tests on my machine; let's see what the buildfarm thinks about it.

Per joint complaint from Tom Lane and buildfarm.

src/backend/utils/adt/xml.c

index f2e5224fc3f18eabad53553d78f18e8760acac99..7fd3ec3fae716820f9682308d0bdf9502b4f23e4 100644 (file)
@@ -4431,7 +4431,7 @@ XmlTableGetValue(TableFuncScanState *state, int colnum,
        PG_TRY();
        {
                /* Set current node as entry point for XPath evaluation */
-               xmlXPathSetContextNode(cur, xtCxt->xpathcxt);
+               xtCxt->xpathcxt->node = cur;
 
                /* Evaluate column path */
                xpathobj = xmlXPathCompiledEval(xtCxt->xpathscomp[colnum], xtCxt->xpathcxt);