8000 Fix up memory management problems in contrib/xml2. · postgres/postgres@936c4af · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"936c4af1c6876e09e914eca91c37949e6885b02e","url":"/postgres/postgres/commit/936c4af1c6876e09e914eca91c37949e6885b02e","authoredDate":"2010-02-28T21:31:57.000Z","committedDate":"2010-02-28T21:31:57.000Z","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eFix up memory management problems in contrib/xml2.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Get rid of the code that attempted to funnel libxml2's memory allocations\ninto palloc. We already knew from experience with the core xml datatype\nthat trying to do this is simply not reliable. Unlike the core code, I\ndid not bother adding a lot of PG_TRY/PG_CATCH logic to try to ensure that\neverything is cleaned up on error exit. Hence, we might leak some memory\nif one of these functions fails partway through. Given the deprecated\nstatus of this contrib module and the fact that errors partway through\nthe functions shouldn't be too common, it doesn't seem worth worrying about.\n\nAlso fix a separate bug in xpath_table, that it did the wrong things\nif given a result tuple descriptor with less than 2 columns. While\nsuch a case isn't very useful in practice, we shouldn't fail or stomp\nmemory when it occurs.\n\nAdd some simple regression tests based on all the reported crash cases\nthat I have on hand.\n\nThis should be back-patched, but let's see if the buildfarm likes it first.","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["7d7db18a68b7a16df85e8dc9d345b3ee7f39d460"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOjkzNmM0YWYxYzY4NzZlMDllOTE0ZWNhOTFjMzc5NDllNjg4NWIwMmU=","sha1":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","sha2":"936c4af1c6876e09e914eca91c37949e6885b02e"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -1,4 +1,4 @@","html":"@@ -1,4 +1,4 @@","displayNoNewLineWarning":false,"position":0,"left":0,"right":0},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1,"text":"-# $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.12 2008/05/08 16:49:37 tgl Exp $","html":"-\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.\u003cspan class=\"x x-first x-last\"\u003e12 2008/05/08 16:49:37\u003c/span\u003e tgl Exp $\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":1,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+# $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.13 2010/02/28 21:31:57 tgl Exp $","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.\u003cspan class=\"x x-first x-last\"\u003e13 2010/02/28 21:31:57\u003c/span\u003e tgl Exp $\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":1,"right":1},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":2,"right":2},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":3,"text":" MODULE_big = pgxml","html":" \u003cspan class=\"pl-smi\"\u003eMODULE_big\u003c/span\u003e = pgxml","displayNoNewLineWarning":false,"position":4,"left":3,"right":3},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":4,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":5,"left":4,"right":4},{"stylingDirective":null,"type":"HUNK","blobLineNumber":7,"text":"@@ -8,6 +8,7 @@ SHLIB_LINK += $(filter -lxslt, $(LIBS)) $(filter -lxml2, $(LIBS))","html":"@@ -8,6 +8,7 @@ SHLIB_LINK += $(filter -lxslt, $(LIBS)) $(filter -lxml2, $(LIBS))","displayNoNewLineWarning":false,"position":6,"left":7,"right":7},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":8,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":7,"left":8,"right":8},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9,"text":" DATA_built = pgxml.sql","html":" \u003cspan class=\"pl-smi\"\u003eDATA_built\u003c/span\u003e = pgxml.sql","displayNoNewLineWarning":false,"position":8,"left":9,"right":9},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10,"text":" DATA = uninstall_pgxml.sql","html":" \u003cspan class=\"pl-smi\"\u003eDATA\u003c/span\u003e = uninstall_pgxml.sql","displayNoNewLineWarning":false,"position":9,"left":10,"right":10},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11,"text":"+REGRESS = xml2","html":"+\u003cspan class=\"pl-smi\"\u003eREGRESS\u003c/span\u003e = xml2","displayNoNewLineWarning":false,"position":10,"left":10,"right":11},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":12,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":11,"left":11,"right":12},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":13,"text":" ifdef USE_PGXS","html":" \u003cspan class=\"pl-k\"\u003eifdef\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eUSE_PGXS\u003c/span\u003e","displayNoNewLineWarning":false,"position":12,"left":12,"right":13},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":14,"text":" PG_CONFIG = pg_config","html":" \u003cspan class=\"pl-smi\"\u003ePG_CONFIG\u003c/span\u003e = pg_config","displayNoNewLineWarning":false,"position":13,"left":13,"right":14}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":22,"linesChanged":3,"newTreeEntry":{"lineCount":22,"path":"contrib/xml2/Makefile","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"contrib/xml2/Makefile","mode":100644},"linesAdded":2,"linesDeleted":1,"path":"contrib/xml2/Makefile","pathDigest":"6bda284aca345244e496a8622e72f27f905ba8302174e78642baf6e1b9ca6bf0","status":"MODIFIED","truncatedReason":null,"oldOid":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","newOid":"936c4af1c6876e09e914eca91c37949e6885b02e","copilotChatReference":null,"deletedSha":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -0,0 +1,147 @@","html":"@@ -0,0 +1,147 @@","displayNoNewLineWarning":false,"position":0,"left":null,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+--","html":"+--","displayNoNewLineWarning":false,"position":1,"left":null,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+-- first, define the functions. Turn off echoing so that expected file","html":"+-- first, define the functions. Turn off echoing so that expected file","displayNoNewLineWarning":false,"position":2,"left":null,"right":2},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3,"text":"+-- does not depend on contents of pgxml.sql.","html":"+-- does not depend on contents of pgxml.sql.","displayNoNewLineWarning":false,"position":3,"left":null,"right":3},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":4,"text":"+--","html":"+--","displayNoNewLineWarning":false,"position":4,"left":null,"right":4},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":5,"text":"+SET client_min_messages = warning;","html":"+SET client_min_messages = warning;","displayNoNewLineWarning":false,"position":5,"left":null,"right":5},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":6,"text":"+\\set ECHO none","html":"+\\set ECHO none","displayNoNewLineWarning":false,"position":6,"left":null,"right":6},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7,"text":"+RESET client_min_messages;","html":"+RESET client_min_messages;","displayNoNewLineWarning":false,"position":7,"left":null,"right":7},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":8,"text":"+select query_to_xml('select 1 as x',true,false,'');","html":"+select query_to_xml(\u0026#39;select 1 as x\u0026#39;,true,false,\u0026#39;\u0026#39;);","displayNoNewLineWarning":false,"position":8,"left":null,"right":8},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9,"text":"+ query_to_xml ","html":"+ query_to_xml ","displayNoNewLineWarning":false,"position":9,"left":null,"right":9},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10,"text":"+---------------------------------------------------------------","html":"+---------------------------------------------------------------","displayNoNewLineWarning":false,"position":10,"left":null,"right":10},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11,"text":"+ \u003ctable xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\u003e+","html":"+ \u0026lt;table xmlns:xsi=\u0026quot;http://www.w3.org/2001/XMLSchema-instance\u0026quot;\u0026gt;+","displayNoNewLineWarning":false,"position":11,"left":null,"right":11},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":12,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":12,"left":null,"right":12},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":13,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":13,"left":null,"right":13},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":14,"text":"+ \u003cx\u003e1\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;1\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":14,"left":null,"right":14},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":15,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":15,"left":null,"right":15},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":16,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":16,"left":null,"right":16},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":17,"text":"+ \u003c/table\u003e +","html":"+ \u0026lt;/table\u0026gt; +","displayNoNewLineWarning":false,"position":17,"left":null,"right":17},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":18,"text":"+ ","html":"+ ","displayNoNewLineWarning":false,"position":18,"left":null,"right":18},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":19,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":19,"left":null,"right":19},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":20,"text":"+","html":"+","displayNoNewLineWarning":false,"position":20,"left":null,"right":20},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":21,"text":"+select xslt_process( query_to_xml('select x from generate_series(1,5) as ","html":"+select xslt_process( query_to_xml(\u0026#39;select x from generate_series(1,5) as ","displayNoNewLineWarning":false,"position":21,"left":null,"right":21},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":22,"text":"+x',true,false,'')::text,","html":"+x\u0026#39;,true,false,\u0026#39;\u0026#39;)::text,","displayNoNewLineWarning":false,"position":22,"left":null,"right":22},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":23,"text":"+$$\u003cxsl:stylesheet version=\"1.0\"","html":"+$$\u0026lt;xsl:stylesheet version=\u0026quot;1.0\u0026quot;","displayNoNewLineWarning":false,"position":23,"left":null,"right":23},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":24,"text":"+ xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+ xmlns:xsl=\u0026quot;http://www.w3.org/1999/XSL/Transform\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":24,"left":null,"right":24},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":25,"text":"+\u003cxsl:output method=\"xml\" indent=\"yes\" /\u003e","html":"+\u0026lt;xsl:output method=\u0026quot;xml\u0026quot; indent=\u0026quot;yes\u0026quot; /\u0026gt;","displayNoNewLineWarning":false,"position":25,"left":null,"right":25},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":26,"text":"+\u003cxsl:template match=\"*\"\u003e","html":"+\u0026lt;xsl:template match=\u0026quot;*\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":26,"left":null,"right":26},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":27,"text":"+ \u003cxsl:copy\u003e","html":"+ \u0026lt;xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":27,"left":null,"right":27},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":28,"text":"+ \u003cxsl:copy-of select=\"@*\" /\u003e","html":"+ \u0026lt;xsl:copy-of select=\u0026quot;@*\u0026quot; /\u0026gt;","displayNoNewLineWarning":false,"position":28,"left":null,"right":28},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":29,"text":"+ \u003cxsl:apply-templates /\u003e","html":"+ \u0026lt;xsl:apply-templates /\u0026gt;","displayNoNewLineWarning":false,"position":29,"left":null,"right":29},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":30,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u0026lt;/xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":30,"left":null,"right":30},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":31,"text":"+\u003c/xsl:template\u003e","html":"+\u0026lt;/xsl:template\u0026gt;","displayNoNewLineWarning":false,"position":31,"left":null,"right":31},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":32,"text":"+\u003cxsl:template match=\"comment()|processing-instruction()\"\u003e","html":"+\u0026lt;xsl:template match=\u0026quot;comment()|processing-instruction()\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":32,"left":null,"right":32},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":33,"text":"+ \u003cxsl:copy /\u003e","html":"+ \u0026lt;xsl:copy /\u0026gt;","displayNoNewLineWarning":false,"position":33,"left":null,"right":33},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":34,"text":"+\u003c/xsl:template\u003e","html":"+\u0026lt;/xsl:template\u0026gt;","displayNoNewLineWarning":false,"position":34,"left":null,"right":34},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":35,"text":"+\u003c/xsl:stylesheet\u003e","html":"+\u0026lt;/xsl:stylesheet\u0026gt;","displayNoNewLineWarning":false,"position":35,"left":null,"right":35},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":36,"text":"+$$::text);","html":"+$$::text);","displayNoNewLineWarning":false,"position":36,"left":null,"right":36},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":37,"text":"+ xslt_process ","html":"+ xslt_process ","displayNoNewLineWarning":false,"position":37,"left":null,"right":37},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":38,"text":"+---------------------------------------------------------------","html":"+---------------------------------------------------------------","displayNoNewLineWarning":false,"position":38,"left":null,"right":38},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":39,"text":"+ \u003c?xml version=\"1.0\"?\u003e +","html":"+ \u0026lt;?xml version=\u0026quot;1.0\u0026quot;?\u0026gt; +","displayNoNewLineWarning":false,"position":39,"left":null,"right":39},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":40,"text":"+ \u003ctable xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\u003e+","html":"+ \u0026lt;table xmlns:xsi=\u0026quot;http://www.w3.org/2001/XMLSchema-instance\u0026quot;\u0026gt;+","displayNoNewLineWarning":false,"position":40,"left":null,"right":40},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":41,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":41,"left":null,"right":41},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":42,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":42,"left":null,"right":42},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":43,"text":"+ \u003cx\u003e1\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;1\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":43,"left":null,"right":43},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":44,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":44,"left":null,"right":44},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":45,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":45,"left":null,"right":45},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":46,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":46,"left":null,"right":46},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":47,"text":"+ \u003cx\u003e2\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;2\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":47,"left":null,"right":47},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":48,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":48,"left":null,"right":48},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":49,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":49,"left":null,"right":49},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":50,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":50,"left":null,"right":50},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":51,"text":"+ \u003cx\u003e3\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;3\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":51,"left":null,"right":51},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":52,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":52,"left":null,"right":52},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":53,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":53,"left":null,"right":53},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":54,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":54,"left":null,"right":54},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":55,"text":"+ \u003cx\u003e4\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;4\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":55,"left":null,"right":55},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":56,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":56,"left":null,"right":56},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":57,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":57,"left":null,"right":57},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":58,"text":"+ \u003crow\u003e +","html":"+ \u0026lt;row\u0026gt; +","displayNoNewLineWarning":false,"position":58,"left":null,"right":58},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":59,"text":"+ \u003cx\u003e5\u003c/x\u003e +","html":"+ \u0026lt;x\u0026gt;5\u0026lt;/x\u0026gt; +","displayNoNewLineWarning":false,"position":59,"left":null,"right":59},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":60,"text":"+ \u003c/row\u003e +","html":"+ \u0026lt;/row\u0026gt; +","displayNoNewLineWarning":false,"position":60,"left":null,"right":60},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":61,"text":"+ +","html":"+ +","displayNoNewLineWarning":false,"position":61,"left":null,"right":61},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":62,"text":"+ \u003c/table\u003e +","html":"+ \u0026lt;/table\u0026gt; +","displayNoNewLineWarning":false,"position":62,"left":null,"right":62},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":63,"text":"+ ","html":"+ ","displayNoNewLineWarning":false,"position":63,"left":null,"right":63},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":64,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":64,"left":null,"right":64},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":65,"text":"+","html":"+","displayNoNewLineWarning":false,"position":65,"left":null,"right":65},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":66,"text":"+CREATE TABLE xpath_test (id integer NOT NULL, t xml);","html":"+CREATE TABLE xpath_test (id integer NOT NULL, t xml);","displayNoNewLineWarning":false,"position":66,"left":null,"right":66},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":67,"text":"+INSERT INTO xpath_test VALUES (1, '\u003cdoc\u003e\u003cint\u003e1\u003c/int\u003e\u003c/doc\u003e');","html":"+INSERT INTO xpath_test VALUES (1, \u0026#39;\u0026lt;doc\u0026gt;\u0026lt;int\u0026gt;1\u0026lt;/int\u0026gt;\u0026lt;/doc\u0026gt;\u0026#39;);","displayNoNewLineWarning":false,"position":67,"left":null,"right":67},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":68,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+SELECT * FROM xpath_table(\u0026#39;id\u0026#39;, \u0026#39;t\u0026#39;, \u0026#39;xpath_test\u0026#39;, \u0026#39;/doc/int\u0026#39;, \u0026#39;true\u0026#39;)","displayNoNewLineWarning":false,"position":68,"left":null,"right":68},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":69,"text":"+as t(id int4);","html":"+as t(id int4);","displayNoNewLineWarning":false,"position":69,"left":null,"right":69},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":70,"text":"+ id ","html":"+ id ","displayNoNewLineWarning":false,"position":70,"left":null,"right":70},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":71,"text":"+----","html":"+----","displayNoNewLineWarning":false,"position":71,"left":null,"right":71},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":72,"text":"+(0 rows)","html":"+(0 rows)","displayNoNewLineWarning":false,"position":72,"left":null,"right":72},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":73,"text":"+","html":"+","displayNoNewLineWarning":false,"position":73,"left":null,"right":73},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":74,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+SELECT * FROM xpath_table(\u0026#39;id\u0026#39;, \u0026#39;t\u0026#39;, \u0026#39;xpath_test\u0026#39;, \u0026#39;/doc/int\u0026#39;, \u0026#39;true\u0026#39;)","displayNoNewLineWarning":false,"position":74,"left":null,"right":74},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":75,"text":"+as t(id int4, doc int4);","html":"+as t(id int4, doc int4);","displayNoNewLineWarning":false,"position":75,"left":null,"right":75},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":76,"text":"+ id | doc ","html":"+ id | doc ","displayNoNewLineWarning":false,"position":76,"left":null,"right":76},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":77,"text":"+----+-----","html":"+----+-----","displayNoNewLineWarning":false,"position":77,"left":null,"right":77},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":78,"text":"+ 1 | 1","html":"+ 1 | 1","displayNoNewLineWarning":false,"position":78,"left":null,"right":78},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":79,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":79,"left":null,"right":79},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":80,"text":"+","html":"+","displayNoNewLineWarning":false,"position":80,"left":null,"right":80},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":81,"text":"+DROP TABLE xpath_test;","html":"+DROP TABLE xpath_test;","displayNoNewLineWarning":false,"position":81,"left":null,"right":81},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":82,"text":"+CREATE TABLE xpath_test (id integer NOT NULL, t text);","html":"+CREATE TABLE xpath_test (id integer NOT NULL, t text);","displayNoNewLineWarning":false,"position":82,"left":null,"right":82},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":83,"text":"+INSERT INTO xpath_test VALUES (1, '\u003cdoc\u003e\u003cint\u003e1\u003c/int\u003e\u003c/doc\u003e');","html":"+INSERT INTO xpath_test VALUES (1, \u0026#39;\u0026lt;doc\u0026gt;\u0026lt;int\u0026gt;1\u0026lt;/int\u0026gt;\u0026lt;/doc\u0026gt;\u0026#39;);","displayNoNewLineWarning":false,"position":83,"left":null,"right":83},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":84,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+SELECT * FROM xpath_table(\u0026#39;id\u0026#39;, \u0026#39;t\u0026#39;, \u0026#39;xpath_test\u0026#39;, \u0026#39;/doc/int\u0026#39;, \u0026#39;true\u0026#39;)","displayNoNewLineWarning":false,"position":84,"left":null,"right":84},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":85,"text":"+as t(id int4);","html":"+as t(id int4);","displayNoNewLineWarning":false,"position":85,"left":null,"right":85},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":86,"text":"+ id ","html":"+ id ","displayNoNewLineWarning":false,"position":86,"left":null,"right":86},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":87,"text":"+----","html":"+----","displayNoNewLineWarning":false,"position":87,"left":null,"right":87},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":88,"text":"+(0 rows)","html":"+(0 rows)","displayNoNewLineWarning":false,"position":88,"left":null,"right":88},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":89,"text":"+","html":"+","displayNoNewLineWarning":false,"position":89,"left":null,"right":89},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":90,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+SELECT * FROM xpath_table(\u0026#39;id\u0026#39;, \u0026#39;t\u0026#39;, \u0026#39;xpath_test\u0026#39;, \u0026#39;/doc/int\u0026#39;, \u0026#39;true\u0026#39;)","displayNoNewLineWarning":false,"position":90,"left":null,"right":90},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":91,"text":"+as t(id int4, doc int4);","html":"+as t(id int4, doc int4);","displayNoNewLineWarning":false,"position":91,"left":null,"right":91},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":92,"text":"+ id | doc ","html":"+ id | doc ","displayNoNewLineWarning":false,"position":92,"left":null,"right":92},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":93,"text":"+----+-----","html":"+----+-----","displayNoNewLineWarning":false,"position":93,"left":null,"right":93},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":94,"text":"+ 1 | 1","html":"+ 1 | 1","displayNoNewLineWarning":false,"position":94,"left":null,"right":94},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":95,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":95,"left":null,"right":95},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":96,"text":"+","html":"+","displayNoNewLineWarning":false,"position":96,"left":null,"right":96},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":97,"text":"+create table articles (article_id integer, article_xml xml, date_entered date);","html":"+create table articles (article_id integer, article_xml xml, date_entered date);","displayNoNewLineWarning":false,"position":97,"left":null,"right":97},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":98,"text":"+insert into articles (article_id, article_xml, date_entered)","html":"+insert into articles (article_id, article_xml, date_entered)","displayNoNewLineWarning":false,"position":98,"left":null,"right":98},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":99,"text":"+values (2, '\u003carticle\u003e\u003cauthor\u003etest\u003c/author\u003e\u003cpages\u003e37\u003c/pages\u003e\u003c/article\u003e', now());","html":"+values (2, \u0026#39;\u0026lt;article\u0026gt;\u0026lt;author\u0026gt;test\u0026lt;/author\u0026gt;\u0026lt;pages\u0026gt;37\u0026lt;/pages\u0026gt;\u0026lt;/article\u0026gt;\u0026#39;, now());","displayNoNewLineWarning":false,"position":99,"left":null,"right":99},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":100,"text":"+SELECT * FROM","html":"+SELECT * FROM","displayNoNewLineWarning":false,"position":100,"left":null,"right":100},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":101,"text":"+xpath_table('article_id',","html":"+xpath_table(\u0026#39;article_id\u0026#39;,","displayNoNewLineWarning":false,"position":101,"left":null,"right":101},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":102,"text":"+ 'article_xml',","html":"+ \u0026#39;article_xml\u0026#39;,","displayNoNewLineWarning":false,"position": 8000 102,"left":null,"right":102},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":103,"text":"+ 'articles',","html":"+ \u0026#39;articles\u0026#39;,","displayNoNewLineWarning":false,"position":103,"left":null,"right":103},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":104,"text":"+ '/article/author|/article/pages|/article/title',","html":"+ \u0026#39;/article/author|/article/pages|/article/title\u0026#39;,","displayNoNewLineWarning":false,"position":104,"left":null,"right":104},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":105,"text":"+ 'date_entered \u003e ''2003-01-01'' ')","html":"+ \u0026#39;date_entered \u0026gt; \u0026#39;\u0026#39;2003-01-01\u0026#39;\u0026#39; \u0026#39;)","displayNoNewLineWarning":false,"position":105,"left":null,"right":105},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":106,"text":"+AS t(article_id integer, author text, page_count integer, title text);","html":"+AS t(article_id integer, author text, page_count integer, title text);","displayNoNewLineWarning":false,"position":106,"left":null,"right":106},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":107,"text":"+ article_id | author | page_count | title ","html":"+ article_id | author | page_count | title ","displayNoNewLineWarning":false,"position":107,"left":null,"right":107},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":108,"text":"+------------+--------+------------+-------","html":"+------------+--------+------------+-------","displayNoNewLineWarning":false,"position":108,"left":null,"right":108},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":109,"text":"+ 2 | test | 37 | ","html":"+ 2 | test | 37 | ","displayNoNewLineWarning":false,"position":109,"left":null,"right":109},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":110,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":110,"left":null,"right":110},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":111,"text":"+","html":"+","displayNoNewLineWarning":false,"position":111,"left":null,"right":111},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":112,"text":"+-- this used to fail when invoked a second time","html":"+-- this used to fail when invoked a second time","displayNoNewLineWarning":false,"position":112,"left":null,"right":112},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":113,"text":"+select xslt_process('\u003caaa/\u003e',$$\u003cxsl:stylesheet version=\"1.0\"","html":"+select xslt_process(\u0026#39;\u0026lt;aaa/\u0026gt;\u0026#39;,$$\u0026lt;xsl:stylesheet version=\u0026quot;1.0\u0026quot;","displayNoNewLineWarning":false,"position":113,"left":null,"right":113},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":114,"text":"+xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+xmlns:xsl=\u0026quot;http://www.w3.org/1999/XSL/Transform\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":114,"left":null,"right":114},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":115,"text":"+\u003cxsl:template match=\"@*|node()\"\u003e","html":"+\u0026lt;xsl:template match=\u0026quot;@*|node()\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":115,"left":null,"right":115},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":116,"text":"+ \u003cxsl:copy\u003e","html":"+ \u0026lt;xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":116,"left":null,"right":116},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":117,"text":"+ \u003cxsl:apply-templates select=\"@*|node()\"/\u003e","html":"+ \u0026lt;xsl:apply-templates select=\u0026quot;@*|node()\u0026quot;/\u0026gt;","displayNoNewLineWarning":false,"position":117,"left":null,"right":117},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":118,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u0026lt;/xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":118,"left":null,"right":118},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":119,"text":"+ \u003c/xsl:template\u003e","html":"+ \u0026lt;/xsl:template\u0026gt;","displayNoNewLineWarning":false,"position":119,"left":null,"right":119},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":120,"text":"+\u003c/xsl:stylesheet\u003e$$)::xml;","html":"+\u0026lt;/xsl:stylesheet\u0026gt;$$)::xml;","displayNoNewLineWarning":false,"position":120,"left":null,"right":120},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":121,"text":"+ xslt_process ","html":"+ xslt_process ","displayNoNewLineWarning":false,"position":121,"left":null,"right":121},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":122,"text":"+--------------","html":"+--------------","displayNoNewLineWarning":false,"position":122,"left":null,"right":122},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":123,"text":"+ \u003caaa/\u003e +","html":"+ \u0026lt;aaa/\u0026gt; +","displayNoNewLineWarning":false,"position":123,"left":null,"right":123},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":124,"text":"+ ","html":"+ ","displayNoNewLineWarning":false,"position":124,"left":null,"right":124},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":125,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":125,"left":null,"right":125},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":126,"text":"+","html":"+","displayNoNewLineWarning":false,"position":126,"left":null,"right":126},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":127,"text":"+select xslt_process('\u003caaa/\u003e',$$\u003cxsl:stylesheet version=\"1.0\"","html":"+select xslt_process(\u0026#39;\u0026lt;aaa/\u0026gt;\u0026#39;,$$\u0026lt;xsl:stylesheet version=\u0026quot;1.0\u0026quot;","displayNoNewLineWarning":false,"position":127,"left":null,"right":127},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":128,"text":"+xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+xmlns:xsl=\u0026quot;http://www.w3.org/1999/XSL/Transform\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":128,"left":null,"right":128},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":129,"text":"+\u003cxsl:template match=\"@*|node()\"\u003e","html":"+\u0026lt;xsl:template match=\u0026quot;@*|node()\u0026quot;\u0026gt;","displayNoNewLineWarning":false,"position":129,"left":null,"right":129},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":130,"text":"+ \u003cxsl:copy\u003e","html":"+ \u0026lt;xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":130,"left":null,"right":130},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":131,"text":"+ \u003cxsl:apply-templates select=\"@*|node()\"/\u003e","html":"+ \u0026lt;xsl:apply-templates select=\u0026quot;@*|node()\u0026quot;/\u0026gt;","displayNoNewLineWarning":false,"position":131,"left":null,"right":131},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":132,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u0026lt;/xsl:copy\u0026gt;","displayNoNewLineWarning":false,"position":132,"left":null,"right":132},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":133,"text":"+ \u003c/xsl:template\u003e","html":"+ \u0026lt;/xsl:template\u0026gt;","displayNoNewLineWarning":false,"position":133,"left":null,"right":133},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":134,"text":"+\u003c/xsl:stylesheet\u003e$$)::xml;","html":"+\u0026lt;/xsl:stylesheet\u0026gt;$$)::xml;","displayNoNewLineWarning":false,"position":134,"left":null,"right":134},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":135,"text":"+ xslt_process ","html":"+ xslt_process ","displayNoNewLineWarning":false,"position":135,"left":null,"right":135},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":136,"text":"+--------------","html":"+--------------","displayNoNewLineWarning":false,"position":136,"left":null,"right":136},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":137,"text":"+ \u003caaa/\u003e +","html":"+ \u0026lt;aaa/\u0026gt; +","displayNoNewLineWarning":false,"position":137,"left":null,"right":137},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":138,"text":"+ ","html":"+ ","displayNoNewLineWarning":false,"position":138,"left":null,"right":138},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":139,"text":"+(1 row)","html":"+(1 row)","displayNoNewLineWarning":false,"position":139,"left":null,"right":139},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":140,"text":"+","html":"+","displayNoNewLineWarning":false,"position":140,"left":null,"right":140},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":141,"text":"+create table t1 (id integer, xml_data xml);","html":"+create table t1 (id integer, xml_data xml);","displayNoNewLineWarning":false,"position":141,"left":null,"right":141},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":142,"text":"+insert into t1 (id, xml_data)","html":"+insert into t1 (id, xml_data)","displayNoNewLineWarning":false,"position":142,"left":null,"right":142},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":143,"text":"+values","html":"+values","displayNoNewLineWarning":false,"position":143,"left":null,"right":143},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":144,"text":"+(1, '\u003cattributes\u003e\u003cattribute name=\"attr_1\"\u003eSome","html":"+(1, \u0026#39;\u0026lt;attributes\u0026gt;\u0026lt;attribute name=\u0026quot;attr_1\u0026quot;\u0026gt;Some","displayNoNewLineWarning":false,"position":144,"left":null,"right":144},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":145,"text":"+Value\u003c/attribute\u003e\u003c/attributes\u003e');","html":"+Value\u0026lt;/attribute\u0026gt;\u0026lt;/attributes\u0026gt;\u0026#39;);","displayNoNewLineWarning":false,"position":145,"left":null,"right":145},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":146,"text":"+create index idx_xpath on t1 ( xpath_string","html":"+create index idx_xpath on t1 ( xpath_string","displayNoNewLineWarning":false,"position":146,"left":null,"right":146},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":147,"text":"+('/attributes/attribute[@name=\"attr_1\"]/text()', xml_data::text));","html":"+(\u0026#39;/attributes/attribute[@name=\u0026quot;attr_1\u0026quot;]/text()\u0026#39;, xml_data::text));","displayNoNewLineWarning":false,"position":147,"left":null,"right":147}],"diffNumber":1,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":147,"linesChanged":147,"newTreeEntry":{"lineCount":147,"path":"contrib/xml2/expected/xml2.out","mode":100644,"isGenerated":false},"oldTreeEntry":null,"linesAdded":147,"linesDeleted":0,"path":"contrib/xml2/expected/xml2.out","pathDigest":"28fa881978e917e3116c45eb8883312b48cb56a304c8b5393ddbb1896fea4e2e","status":"ADDED","truncatedReason":null,"oldOid":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","newOid":"936c4af1c6876e09e914eca91c37949e6885b02e","copilotChatReference":null,"deletedSha":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":0,"text":"@@ -0,0 +1,82 @@","html":"@@ -0,0 +1,82 @@","displayNoNewLineWarning":false,"position":0,"left":null,"right":0},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1,"text":"+--","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":null,"right":1},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2,"text":"+-- first, define the functions. Turn off echoing so that expected file","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e first, define the functions. Turn off echoing so that expected file\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":null,"right":2},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":3,"text":"+-- does not depend on contents of pgxml.sql.","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e does not depend on contents of pgxml.sql.\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":null,"right":3},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":4,"text":"+--","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":null,"right":4},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":5,"text":"+SET client_min_messages = warning;","html":"+\u003cspan class=\"pl-k\"\u003eSET\u003c/span\u003e client_min_messages \u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e warning;","displayNoNewLineWarning":false,"position":5,"left":null,"right":5},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":6,"text":"+\\set ECHO none","html":"+\\\u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e ECHO none","displayNoNewLineWarning":false,"position":6,"left":null,"right":6},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":7,"text":"+\\i pgxml.sql","html":"+\\i \u003cspan class=\"pl-c1\"\u003epgxml\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003esql\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":null,"right":7},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":8,"text":"+\\set ECHO all","html":"+\\\u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e ECHO all","displayNoNewLineWarning":false,"position":8,"left":null,"right":8},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":9,"text":"+RESET client_min_messages;","html":"+RESET client_min_messages;","displayNoNewLineWarning":false,"position":9,"left":null,"right":9},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":10,"text":"+","html":"+","displayNoNewLineWarning":false,"position":10,"left":null,"right":10},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":11,"text":"+select query_to_xml('select 1 as x',true,false,'');","html":"+\u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e query_to_xml(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eselect 1 as x\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,true,false,\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":11,"left":null,"right":11},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":12,"text":"+","html":"+","displayNoNewLineWarning":false,"position":12,"left":null,"right":12},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":13,"text":"+select xslt_process( query_to_xml('select x from generate_series(1,5) as ","html":"+\u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e xslt_process( query_to_xml(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eselect x from generate_series(1,5) as \u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":null,"right":13},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":14,"text":"+x',true,false,'')::text,","html":"+\u003cspan class=\"pl-s\"\u003ex\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,true,false,\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)::\u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e,","displayNoNewLineWarning":false,"position":14,"left":null,"right":14},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":15,"text":"+$$\u003cxsl:stylesheet version=\"1.0\"","html":"+$$\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:stylesheet version\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e1.0\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":15,"left":null,"right":15},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":16,"text":"+ xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+ xmlns:xsl\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003ehttp://www.w3.org/1999/XSL/Transform\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":null,"right":16},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":17,"text":"+\u003cxsl:output method=\"xml\" indent=\"yes\" /\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:output method\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003exml\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e indent\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003eyes\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":null,"right":17},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":18,"text":"+\u003cxsl:template match=\"*\"\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:template match\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e*\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":18,"left":null,"right":18},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":19,"text":"+ \u003cxsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":19,"left":null,"right":19},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":20,"text":"+ \u003cxsl:copy-of select=\"@*\" /\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e-\u003c/span\u003eof \u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e@*\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":20,"left":null,"right":20},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":21,"text":"+ \u003cxsl:apply-templates /\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:apply\u003cspan class=\"pl-k\"\u003e-\u003c/span\u003etemplates \u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":21,"left":null,"right":21},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":22,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":22,"left":null,"right":22},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":23,"text":"+\u003c/xsl:template\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:template\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":null,"right":23},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":24,"text":"+\u003cxsl:template match=\"comment()|processing-instruction()\"\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:template match\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003ecomment()|processing-instruction()\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":24,"left":null,"right":24},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":25,"text":"+ \u003cxsl:copy /\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:copy \u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":25,"left":null,"right":25},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":26,"text":"+\u003c/xsl:template\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:template\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":26,"left":null,"right":26},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":27,"text":"+\u003c/xsl:stylesheet\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:stylesheet\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":27,"left":null,"right":27},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":28,"text":"+$$::text);","html":"+$$::\u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e);","displayNoNewLineWarning":false,"position":28,"left":null,"right":28},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":29,"text":"+","html":"+","displayNoNewLineWarning":false,"position":29,"left":null,"right":29},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":30,"text":"+CREATE TABLE xpath_test (id integer NOT NULL, t xml);","html":"+\u003cspan class=\"pl-k\"\u003eCREATE\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eTABLE\u003c/span\u003e \u003cspan class=\"pl-en\"\u003expath_test\u003c/span\u003e (id \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eNOT NULL\u003c/span\u003e, t xml);","displayNoNewLineWarning":false,"position":30,"left":null,"right":30},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":31,"text":"+INSERT INTO xpath_test VALUES (1, '\u003cdoc\u003e\u003cint\u003e1\u003c/int\u003e\u003c/doc\u003e');","html":"+\u003cspan class=\"pl-k\"\u003eINSERT INTO\u003c/span\u003e xpath_test \u003cspan class=\"pl-k\"\u003eVALUES\u003c/span\u003e (\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;doc\u0026gt;\u0026lt;int\u0026gt;1\u0026lt;/int\u0026gt;\u0026lt;/doc\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":31,"left":null,"right":31},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":32,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e xpath_table(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eid\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003expath_test\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/doc/int\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003etrue\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)","displayNoNewLineWarning":false,"position":32,"left":null,"right":32},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":33,"text":"+as t(id int4);","html":"+\u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e t(id int4);","displayNoNewLineWarning":false,"position":33,"left":null,"right":33},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":34,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e xpath_table(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eid\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003expath_test\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/doc/int\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003etrue\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)","displayNoNewLineWarning":false,"position":34,"left":null,"right":34},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":35,"text":"+as t(id int4, doc int4);","html":"+\u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e t(id int4, doc int4);","displayNoNewLineWarning":false,"position":35,"left":null,"right":35},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":36,"text":"+","html":"+","displayNoNewLineWarning":false,"position":36,"left":null,"right":36},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":37,"text":"+DROP TABLE xpath_test;","html":"+\u003cspan class=\"pl-k\"\u003eDROP\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eTABLE\u003c/span\u003e xpath_test;","displayNoNewLineWarning":false,"position":37,"left":null,"right":37},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":38,"text":"+CREATE TABLE xpath_test (id integer NOT NULL, t text);","html":"+\u003cspan class=\"pl-k\"\u003eCREATE\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eTABLE\u003c/span\u003e \u003cspan class=\"pl-en\"\u003expath_test\u003c/span\u003e (id \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eNOT NULL\u003c/span\u003e, t \u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e);","displayNoNewLineWarning":false,"position":38,"left":null,"right":38},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":39,"text":"+INSERT INTO xpath_test VALUES (1, '\u003cdoc\u003e\u003cint\u003e1\u003c/int\u003e\u003c/doc\u003e');","html":"+\u003cspan class=\"pl-k\"\u003eINSERT INTO\u003c/span\u003e xpath_test \u003cspan class=\"pl-k\"\u003eVALUES\u003c/span\u003e (\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;doc\u0026gt;\u0026lt;int\u0026gt;1\u0026lt;/int\u0026gt;\u0026lt;/doc\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":39,"left":null,"right":39},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":40,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e xpath_table(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eid\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003expath_test\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/doc/int\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003etrue\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)","displayNoNewLineWarning":false,"position":40,"left":null,"right":40},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":41,"text":"+as t(id int4);","html":"+\u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e t(id int4);","displayNoNewLineWarning":false,"position":41,"left":null,"right":41},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":42,"text":"+SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')","html":"+\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e xpath_table(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003eid\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003expath_test\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/doc/int\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003etrue\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)","displayNoNewLineWarning":false,"position":42,"left":null,"right":42},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":43,"text":"+as t(id int4, doc int4);","html":"+\u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e t(id int4, doc int4);","displayNoNewLineWarning":false,"position":43,"left":null,"right":43},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":44,"text":"+","html":"+","displayNoNewLineWarning":false,"position":44,"left":null,"right":44},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":45,"text":"+create table articles (article_id integer, article_xml xml, date_entered date);","html":"+\u003cspan class=\"pl-k\"\u003ecreate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etable\u003c/span\u003e \u003cspan class=\"pl-en\"\u003earticles\u003c/span\u003e (article_id \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e, article_xml xml, date_entered \u003cspan class=\"pl-k\"\u003edate\u003c/span\u003e);","displayNoNewLineWarning":false,"position":45,"left":null,"right":45},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":46,"text":"+insert into articles (article_id, article_xml, date_entered)","html":"+\u003cspan class=\"pl-k\"\u003einsert into\u003c/span\u003e articles (article_id, article_xml, date_entered)","displayNoNewLineWarning":false,"position":46,"left":null,"right":46},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":47,"text":"+values (2, '\u003carticle\u003e\u003cauthor\u003etest\u 8000 003c/author\u003e\u003cpages\u003e37\u003c/pages\u003e\u003c/article\u003e', now());","html":"+\u003cspan class=\"pl-k\"\u003evalues\u003c/span\u003e (\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;article\u0026gt;\u0026lt;author\u0026gt;test\u0026lt;/author\u0026gt;\u0026lt;pages\u0026gt;37\u0026lt;/pages\u0026gt;\u0026lt;/article\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, now());","displayNoNewLineWarning":false,"position":47,"left":null,"right":47},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":48,"text":"+SELECT * FROM","html":"+\u003cspan class=\"pl-k\"\u003eSELECT\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eFROM\u003c/span\u003e","displayNoNewLineWarning":false,"position":48,"left":null,"right":48},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":49,"text":"+xpath_table('article_id',","html":"+xpath_table(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003earticle_id\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":49,"left":null,"right":49},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":50,"text":"+ 'article_xml',","html":"+ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003earticle_xml\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":50,"left":null,"right":50},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":51,"text":"+ 'articles',","html":"+ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003earticles\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":51,"left":null,"right":51},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":52,"text":"+ '/article/author|/article/pages|/article/title',","html":"+ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/article/author|/article/pages|/article/title\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,","displayNoNewLineWarning":false,"position":52,"left":null,"right":52},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":53,"text":"+ 'date_entered \u003e ''2003-01-01'' ')","html":"+ \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003edate_entered \u0026gt; \u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e2003-01-01\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e \u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e)","displayNoNewLineWarning":false,"position":53,"left":null,"right":53},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":54,"text":"+AS t(article_id integer, author text, page_count integer, title text);","html":"+\u003cspan class=\"pl-k\"\u003eAS\u003c/span\u003e t(article_id \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e, author \u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e, page_count \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e, title \u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e);","displayNoNewLineWarning":false,"position":54,"left":null,"right":54},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":55,"text":"+","html":"+","displayNoNewLineWarning":false,"position":55,"left":null,"right":55},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":56,"text":"+-- this used to fail when invoked a second time","html":"+\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e--\u003c/span\u003e this used to fail when invoked a second time\u003c/span\u003e","displayNoNewLineWarning":false,"position":56,"left":null,"right":56},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":57,"text":"+select xslt_process('\u003caaa/\u003e',$$\u003cxsl:stylesheet version=\"1.0\"","html":"+\u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e xslt_process(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;aaa/\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,$$\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:stylesheet version\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e1.0\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":57,"left":null,"right":57},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":58,"text":"+xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+xmlns:xsl\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003ehttp://www.w3.org/1999/XSL/Transform\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":58,"left":null,"right":58},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":59,"text":"+\u003cxsl:template match=\"@*|node()\"\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:template match\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e@*|node()\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":59,"left":null,"right":59},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":60,"text":"+ \u003cxsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":60,"left":null,"right":60},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":61,"text":"+ \u003cxsl:apply-templates select=\"@*|node()\"/\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:apply\u003cspan class=\"pl-k\"\u003e-\u003c/span\u003etemplates \u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e@*|node()\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":61,"left":null,"right":61},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":62,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":62,"left":null,"right":62},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":63,"text":"+ \u003c/xsl:template\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:template\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":63,"left":null,"right":63},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":64,"text":"+\u003c/xsl:stylesheet\u003e$$)::xml;","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:stylesheet\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e$$)::xml;","displayNoNewLineWarning":false,"position":64,"left":null,"right":64},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":65,"text":"+","html":"+","displayNoNewLineWarning":false,"position":65,"left":null,"right":65},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":66,"text":"+select xslt_process('\u003caaa/\u003e',$$\u003cxsl:stylesheet version=\"1.0\"","html":"+\u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e xslt_process(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;aaa/\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e,$$\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:stylesheet version\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e1.0\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e","displayNoNewLineWarning":false,"position":66,"left":null,"right":66},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":67,"text":"+xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e","html":"+xmlns:xsl\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003ehttp://www.w3.org/1999/XSL/Transform\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":67,"left":null,"right":67},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":68,"text":"+\u003cxsl:template match=\"@*|node()\"\u003e","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:template match\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e@*|node()\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":68,"left":null,"right":68},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":69,"text":"+ \u003cxsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":69,"left":null,"right":69},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":70,"text":"+ \u003cxsl:apply-templates select=\"@*|node()\"/\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003exsl:apply\u003cspan class=\"pl-k\"\u003e-\u003c/span\u003etemplates \u003cspan class=\"pl-k\"\u003eselect\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e=\u003c/span\u003e\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e@*|node()\u003cspan class=\"pl-pds\"\u003e\u0026quot;\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":70,"left":null,"right":70},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":71,"text":"+ \u003c/xsl:copy\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:copy\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":71,"left":null,"right":71},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":72,"text":"+ \u003c/xsl:template\u003e","html":"+ \u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:template\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e","displayNoNewLineWarning":false,"position":72,"left":null,"right":72},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":73,"text":"+\u003c/xsl:stylesheet\u003e$$)::xml;","html":"+\u003cspan class=\"pl-k\"\u003e\u0026lt;\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e/\u003c/span\u003exsl:stylesheet\u003cspan class=\"pl-k\"\u003e\u0026gt;\u003c/span\u003e$$)::xml;","displayNoNewLineWarning":false,"position":73,"left":null,"right":73},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":74,"text":"+","html":"+","displayNoNewLineWarning":false,"position":74,"left":null,"right":74},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":75,"text":"+create table t1 (id integer, xml_data xml);","html":"+\u003cspan class=\"pl-k\"\u003ecreate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003etable\u003c/span\u003e \u003cspan class=\"pl-en\"\u003et1\u003c/span\u003e (id \u003cspan class=\"pl-k\"\u003einteger\u003c/span\u003e, xml_data xml);","displayNoNewLineWarning":false,"position":75,"left":null,"right":75},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":76,"text":"+insert into t1 (id, xml_data)","html":"+\u003cspan class=\"pl-k\"\u003einsert into\u003c/span\u003e t1 (id, xml_data)","displayNoNewLineWarning":false,"position":76,"left":null,"right":76},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":77,"text":"+values","html":"+\u003cspan class=\"pl-k\"\u003evalues\u003c/span\u003e","displayNoNewLineWarning":false,"position":77,"left":null,"right":77},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":78,"text":"+(1, '\u003cattributes\u003e\u003cattribute name=\"attr_1\"\u003eSome","html":"+(\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u0026lt;attributes\u0026gt;\u0026lt;attribute name=\u0026quot;attr_1\u0026quot;\u0026gt;Some\u003c/span\u003e","displayNoNewLineWarning":false,"position":78,"left":null,"right":78},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":79,"text":"+Value\u003c/attribute\u003e\u003c/attributes\u003e');","html":"+\u003cspan class=\"pl-s\"\u003eValue\u0026lt;/attribute\u0026gt;\u0026lt;/attributes\u0026gt;\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e);","displayNoNewLineWarning":false,"position":79,"left":null,"right":79},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":80,"text":"+","html":"+","displayNoNewLineWarning":false,"position":80,"left":null,"right":80},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":81,"text":"+create index idx_xpath on t1 ( xpath_string","html":"+\u003cspan class=\"pl-k\"\u003ecreate\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eindex\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eidx_xpath\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eon\u003c/span\u003e t1 ( xpath_string","displayNoNewLineWarning":false,"position":81,"left":null,"right":81},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":82,"text":"+('/attributes/attribute[@name=\"attr_1\"]/text()', xml_data::text));","html":"+(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e/attributes/attribute[@name=\u0026quot;attr_1\u0026quot;]/text()\u003cspan class=\"pl-pds\"\u003e\u0026#39;\u003c/span\u003e\u003c/span\u003e, xml_data::\u003cspan class=\"pl-k\"\u003etext\u003c/span\u003e));","displayNoNewLineWarning":false,"position":82,"left":null,"right":82}],"diffNumber":2,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":82,"linesChanged":82,"newTreeEntry":{"lineCount":82,"path":"contrib/xml2/sql/xml2.sql","mode":100644,"isGenerated":false},"oldTreeEntry":null,"linesAdded":82,"linesDeleted":0,"path":"contrib/xml2/sql/xml2.sql","pathDigest":"0e896e418fc27b83e41baf548722e08aa18bcf86561eeaa3f98eb3910b910453","status":"ADDED","truncatedReason":null,"oldOid":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","newOid":"936c4af1c6876e09e914eca91c37949e6885b02e","copilotChatReference":null,"deletedSha":"7d7db18a68b7a16df85e8dc9d345b3ee7f39d460","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"path":"contrib/xml2/xpath.c","pathDigest":"d08d9a34ae6ce09033733a881325bf109fb68b865c172f3d720b12e40041f36e","status":"MODIFIED"}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/936c4af1c6876e09e914eca91c37949e6885b02e","fileTreeExpanded":true,"headerInfo":{"additions":253,"deletions":57,"filesChanged":4,"filesChangedString":"4"},"moreDiffsToLoad":true,"asyncDiffLoadInfo":{"startIndex":3,"truncated":false,"byteCount":8760,"lineShownCount":245},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"WjpULPmANqMSekq-OIvV5o6mLfElx7R7US1T06E-b8AzM-4sTQsFGTXnyoDGjw4JYY87L1KbH5AQMPK2o6fIKw"},"/users/diffview?diff=unified":{"post":"7cdzQXtZbOPDWl7oXvGdSXEF3FRESrVLEETSv-eMnliEzslBz9JfWeTH3tag9UamnizKijMWHqBRWXPa5RU5sw"},"/notifications/thread":{"post":"cq4b2nMoy47JxqZq-X96HTcYkLeTPq8kE4vWAQjbUbc47X4TxR-iVXr8eJdXDhzESKQ9XwMEFZPlhSuJPfo53A"}}},"title":"Fix up memory management problems in contrib/xml2. · postgres/postgres@936c4af","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit 936c4af

Browse files
committed
Fix up memory management problems in contrib/xml2.
Get rid of the code that attempted to funnel libxml2's memory allocations into palloc. We already knew from experience with the core xml datatype that trying to do this is simply not reliable. Unlike the core code, I did not bother adding a lot of PG_TRY/PG_CATCH logic to try to ensure that everything is cleaned up on error exit. Hence, we might leak some memory if one of these functions fails partway through. Given the deprecated status of this contrib module and the fact that errors partway through the functions shouldn't be too common, it doesn't seem worth worrying about. Also fix a separate bug in xpath_table, that it did the wrong things if given a result tuple descriptor with less than 2 columns. While such a case isn't very useful in practice, we shouldn't fail or stomp memory when it occurs. Add some simple regression tests based on all the reported crash cases that I have on hand. This should be back-patched, but let's see if the buildfarm likes it first.
1 parent 7d7db18 commit 936c4af

File tree

4 files changed

+253
-57
lines changed

4 files changed

+253
-57
lines changed

contrib/xml2/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.12 2008/05/08 16:49:37 tgl Exp $
1+
# $PostgreSQL: pgsql/contrib/xml2/Makefile,v 1.13 2010/02/28 21:31:57 tgl Exp $
22

33
MODULE_big = pgxml
44

@@ -8,6 +8,7 @@ SHLIB_LINK += $(filter -lxslt, $(LIBS)) $(filter -lxml2, $(LIBS))
88

99
DATA_built = pgxml.sql
1010
DATA = uninstall_pgxml.sql
11+
REGRESS = xml2
1112

1213
ifdef USE_PGXS
1314
PG_CONFIG = pg_config

contrib/xml2/expected/xml2.out

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
--
2+
-- first, define the functions. Turn off echoing so that expected file
3+
-- does not depend on contents of pgxml.sql.
4+
--
5+
SET client_min_messages = warning;
6+
\set ECHO none
7+
RESET client_min_messages;
8+
select query_to_xml('select 1 as x',true,false,'');
9+
query_to_xml
10+
---------------------------------------------------------------
11+
<table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
12+
+
13+
<row> +
14+
<x>1</x> +
15+
</row> +
16+
+
17+
</table> +
18+
19+
(1 row)
20+
21+
select xslt_process( query_to_xml('select x from generate_series(1,5) as
22+
x',true,false,'')::text,
23+
$$<xsl:stylesheet version="1.0"
24+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
25+
<xsl:output method="xml" indent="yes" />
26+
<xsl:template match="*">
27+
<xsl:copy>
28+
<xsl:copy-of select="@*" />
29+
<xsl:apply-templates />
30+
</xsl:copy>
31+
</xsl:template>
32+
<xsl:template match="comment()|processing-instruction()">
33+
<xsl:copy />
34+
</xsl:template>
35+
</xsl:stylesheet>
36+
$$::text);
37+
xslt_process
38+
---------------------------------------------------------------
39+
<?xml version="1.0"?> +
40+
<table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
41+
+
42+
<row> +
43+
<x>1</x> +
44+
</row> +
45+
+
46+
<row> +
47+
<x>2</x> +
48+
</row> +
49+
+
50+
<row> +
51+
<x>3</x> +
52+
</row> +
53+
+
54+
<row> +
55+
<x>4</x> +
56+
</row> +
57+
+
58+
<row> +
59+
<x>5</x> +
60+
</row> +
61+
+
62+
</table> +
63+
64+
(1 row)
65+
66+
CREATE TABLE xpath_test (id integer NOT NULL, t xml);
67+
INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
68+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
69+
as t(id int4);
70+
id
71+
----
72+
(0 rows)
73+
74+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
75+
as t(id int4, doc int4);
76+
id | doc
77+
----+-----
78+
1 | 1
79+
(1 row)
80+
81+
DROP TABLE xpath_test;
82+
CREATE TABLE xpath_test (id integer NOT NULL, t text);
83+
INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
84+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
85+
as t(id int4);
86+
id
87+
----
88+
(0 rows)
89+
90+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
91+
as t(id int4, doc int4);
92+
id | doc
93+
----+-----
94+
1 | 1
95+
(1 row)
96+
97+
create table articles (article_id integer, article_xml xml, date_entered date);
98+
insert into articles (article_id, article_xml, date_entered)
99+
values (2, '<article><author>test</author><pages>37</pages></article>', now());
100+
SELECT * FROM
101+
xpath_table('article_id',
102+
'article_xml',
103+
'articles',
104+
'/article/author|/article/pages|/article/title',
105+
'date_entered > ''2003-01-01'' ')
106+
AS t(article_id integer, author text, page_count integer, title text);
107+
article_id | author | page_count | title
108+
------------+--------+------------+-------
109+
2 | test | 37 |
110+
(1 row)
111+
112+
-- this used to fail when invoked a second time
113+
select xslt_process('<aaa/>',$$<xsl:stylesheet version="1.0"
114+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
115+
<xsl:template match="@*|node()">
116+
<xsl:copy>
117+
<xsl:apply-templates select="@*|node()"/>
118+
</xsl:copy>
119+
</xsl:template>
120+
</xsl:stylesheet>$$)::xml;
121+
xslt_process
122+
--------------
123+
<aaa/> +
124+
125+
(1 row)
126+
127+
select xslt_process('<aaa/>',$$<xsl:stylesheet version="1.0"
128+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
129+
<xsl:template match="@*|node()">
130+
<xsl:copy>
131+
<xsl:apply-templates select="@*|node()"/>
132+
</xsl:copy>
133+
</xsl:template>
134+
</xsl:stylesheet>$$)::xml;
135+
xslt_process
136+
--------------
137+
<aaa/> +
138+
139+
(1 row)
140+
141+
create table t1 (id integer, xml_data xml);
142+
insert into t1 (id, xml_data)
143+
values
144+
(1, '<attributes><attribute name="attr_1">Some
145+
Value</attribute></attributes>');
146+
create index idx_xpath on t1 ( xpath_string
147+
('/attributes/attribute[@name="attr_1"]/text()', xml_data::text));

contrib/xml2/sql/xml2.sql

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--
2+
-- first, define the functions. Turn off echoing so that expected file
3+
-- does not depend on contents of pgxml.sql.
4+
--
5+
SET client_min_messages = warning;
6+
\set ECHO none
7+
\i pgxml.sql
8+
\set ECHO all
9+
RESET client_min_messages;
10+
11+
select query_to_xml('select 1 as x',true,false,'');
12+
13+
select xslt_process( query_to_xml('select x from generate_series(1,5) as
14+
x',true,false,'')::text,
15+
$$<xsl:stylesheet version="1.0"
16+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17+
<xsl:output method="xml" indent="yes" />
18+
<xsl:template match="*">
19+
<xsl:copy>
20+
<xsl:copy-of select="@*" />
21+
<xsl:apply-templates />
22+
</xsl:copy>
23+
</xsl:template>
24+
<xsl:template match="comment()|processing-instruction()">
25+
<xsl:copy />
26+
</xsl:template>
27+
</xsl:stylesheet>
28+
$$::text);
29+
30+
CREATE TABLE xpath_test (id integer NOT NULL, t xml);
31+
INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
32+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
33+
as t(id int4);
34+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
35+
as t(id int4, doc int4);
36+
37+
DROP TABLE xpath_test;
38+
CREATE TABLE xpath_test (id integer NOT NULL, t text);
39+
INSERT INTO xpath_test VALUES (1, '<doc><int>1</int></doc>');
40+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
41+
as t(id int4);
42+
SELECT * FROM xpath_table('id', 't', 'xpath_test', '/doc/int', 'true')
43+
as t(id int4, doc int4);
44+
45+
create table articles (article_id integer, article_xml xml, date_entered date);
46+
insert into articles (article_id, article_xml, date_entered)
47+
values (2, '<article><author>test</author><pages>37</pages></article>', now());
48+
SELECT * FROM
49+
xpath_table('article_id',
50+
'article_xml',
51+
'articles',
52+
'/article/author|/article/pages|/article/title',
53+
'date_entered > ''2003-01-01'' ')
54+
AS t(article_id integer, author text, page_count integer, title text);
55+
56+
-- this used to fail when invoked a second time
57+
select xslt_process('<aaa/>',$$<xsl:stylesheet version="1.0"
58+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
59+
<xsl:template match="@*|node()">
60+
<xsl:copy>
61+
<xsl:apply-templates select="@*|node()"/>
62+
</xsl:copy>
63+
</xsl:template>
64+
</xsl:stylesheet>$$)::xml;
65+
66+
select xslt_process('<aaa/>',$$<xsl:stylesheet version="1.0"
67+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
68+
<xsl:template match="@*|node()">
69+
<xsl:copy>
70+
<xsl:apply-templates select="@*|node()"/>
71+
</xsl:copy>
72+
</xsl:template>
73+
</xsl:stylesheet>$$)::xml;
74+
75+
create table t1 (id integer, xml_data xml);
76+
insert into t1 (id, xml_data)
77+
values
78+
(1, '<attributes><attribute name="attr_1">Some
79+
Value</attribute></attributes>');
80+
81+
create index idx_xpath on t1 ( xpath_string
82+
('/attributes/attribute[@name="attr_1"]/text()', xml_data::text));

0 commit comments

Comments
 (0)
0