diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-08-31 22:21:32 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-08-31 22:21:39 -0400 |
commit | 4ea07e7cf3c6b5ff7a7059c223fa54241533b0a5 (patch) | |
tree | d098758c026e2d4e98a2839d2ebdfb3efcde5abd /src | |
parent | fede15417225c08479fc6cd10812a25826c65f86 (diff) | |
download | postgresql-4ea07e7cf3c6b5ff7a7059c223fa54241533b0a5.tar.gz postgresql-4ea07e7cf3c6b5ff7a7059c223fa54241533b0a5.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/expected/xml.out | 4 | ||||
-rw-r--r-- | src/test/regress/expected/xml_1.out | 2 | ||||
-rw-r--r-- | src/test/regress/expected/xml_2.out | 4 | ||||
-rw-r--r-- | src/test/regress/sql/xml.sql | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out index 55ac49be261..948b4e702c1 100644 --- a/src/test/regress/expected/xml.out +++ b/src/test/regress/expected/xml.out @@ -1555,9 +1555,9 @@ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PAT (1 row) \x -SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/'); +SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/'); -[ RECORD 1 ]----------------------------------------------------------- -x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post +x | <n2>&deep</n2> y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>+ | diff --git a/src/test/regress/expected/xml_1.out b/src/test/regress/expected/xml_1.out index 3477606af76..2fce06069f2 100644 --- a/src/test/regress/expected/xml_1.out +++ b/src/test/regress/expected/xml_1.out @@ -1243,7 +1243,7 @@ LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml ... ^ DETAIL: This functionality requires the server to be built with libxml support. \x -SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/'); +SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/'); ERROR: unsupported XML feature LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?... ^ diff --git a/src/test/regress/expected/xml_2.out b/src/test/regress/expected/xml_2.out index 493c6186e16..5fd3886b5ef 100644 --- a/src/test/regress/expected/xml_2.out +++ b/src/test/regress/expected/xml_2.out @@ -1535,9 +1535,9 @@ SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PAT (1 row) \x -SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/'); +SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/'); -[ RECORD 1 ]----------------------------------------------------------- -x | pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post +x | <n2>&deep</n2> y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>+ | diff --git a/src/test/regress/sql/xml.sql b/src/test/regress/sql/xml.sql index e3f90db4d56..484e3637e43 100644 --- a/src/test/regress/sql/xml.sql +++ b/src/test/regress/sql/xml.sql @@ -613,7 +613,7 @@ SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c -- XPath result can be boolean or number too 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(.)'); \x -SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH 'node()', y xml PATH '/'); +SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/'); \x SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"'); |