summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2017-03-08 16:29:48 +0000
committerAlvaro Herrera2017-03-08 16:29:48 +0000
commita9f66f92533b2bfd7abf289219152091b7697e87 (patch)
tree3aac37dd43b357d98f8cd274cacab361f0358310
parent0d130c7abc85f828dced6c134a5fcbff3215c497 (diff)
Fix XMLTABLE on older libxml2
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.
-rw-r--r--src/backend/utils/adt/xml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index f2e5224fc3..7fd3ec3fae 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -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);