Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4ea07e7

Browse files
committed
Adjust XML test case to avoid unstable behavior.
Buildfarm member bowerbird is (inconsistently) showing different results for this test case since we enabled ASLR for MSVC builds. It's not very clear whether that's a bug in its version of libxml2 or the test case is relying on nominally-undefined behavior, ie the ordering of results from XPath's node(). It seems quite unlikely that it's *our* bug though, and what's more, using node() adds nothing to the test coverage so far as our code is concerned. So, tweak the test to not use node(). For the moment, only change HEAD because we've only seen the problem there. Perhaps a case will emerge for back-patching. Discussion: https://postgr.es/m/2655387.1661695793@sss.pgh.pa.us
1 parent fede154 commit 4ea07e7

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/test/regress/expected/xml.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -1555,9 +1555,9 @@ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PAT
15551555
(1 row)
15561556

15571557
\x
1558-
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
1558+
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/');
15591559
-[ RECORD 1 ]-----------------------------------------------------------
1560-
x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post
1560+
x | <n2>&amp;deep</n2>
15611561
y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>+
15621562
|
15631563

src/test/regress/expected/xml_1.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml ...
12431243
^
12441244
DETAIL: This functionality requires the server to be built with libxml support.
12451245
\x
1246-
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
1246+
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/');
12471247
ERROR: unsupported XML feature
12481248
LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?...
12491249
^

src/test/regress/expected/xml_2.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,9 @@ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PAT
15351535
(1 row)
15361536

15371537
\x
1538-
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
1538+
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/');
15391539
-[ RECORD 1 ]-----------------------------------------------------------
1540-
x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post
1540+
x | <n2>&amp;deep</n2>
15411541
y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>+
15421542
|
15431543

src/test/regress/sql/xml.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c
613613
-- XPath result can be boolean or number too
614614
SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
615615
\x
616-
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/');
616+
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&amp;deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/');
617617
\x
618618

619619
SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');

0 commit comments

Comments
 (0)