unify-libxml-error-results-wip.patch
text/x-diff
Filename: unify-libxml-error-results-wip.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/test/regress/expected/xml.out | 25 | 25 |
| src/test/regress/sql/xml.sql | 7 | 7 |
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out
index 3e80a7ff465..d3c7f626738 100644
--- a/src/test/regress/expected/xml.out
+++ b/src/test/regress/expected/xml.out
@@ -4,13 +4,13 @@ CREATE TABLE xmltest (
);
INSERT INTO xmltest VALUES (1, '<value>one</value>');
INSERT INTO xmltest VALUES (2, '<value>two</value>');
-INSERT INTO xmltest VALUES (3, '<wrong');
+INSERT INTO xmltest VALUES (3, '<value>two</wrong> ');
ERROR: invalid XML content
-LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
+LINE 1: INSERT INTO xmltest VALUES (3, '<value>two</wrong> ');
^
-DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
-<wrong
- ^
+DETAIL: line 1: Opening and ending tag mismatch: value line 1 and wrong
+<value>two</wrong>
+ ^
SELECT * FROM xmltest;
id | data
----+--------------------
@@ -89,13 +89,13 @@ SELECT xmlconcat(1, 2);
ERROR: argument of XMLCONCAT must be type xml, not type integer
LINE 1: SELECT xmlconcat(1, 2);
^
-SELECT xmlconcat('bad', '<syntax');
+SELECT xmlconcat('bad', '<wrong></syntax> ');
ERROR: invalid XML content
-LINE 1: SELECT xmlconcat('bad', '<syntax');
+LINE 1: SELECT xmlconcat('bad', '<wrong></syntax> ');
^
-DETAIL: line 1: Couldn't find end of Start Tag syntax line 1
-<syntax
- ^
+DETAIL: line 1: Opening and ending tag mismatch: wrong line 1 and syntax
+<wrong></syntax>
+ ^
SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
xmlconcat
--------------
@@ -271,13 +271,13 @@ SELECT xmlparse(content '<relativens xmlns=''relative''/>');
<relativens xmlns='relative'/>
(1 row)
-SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced> ');
ERROR: invalid XML content
DETAIL: line 1: Entity 'idontexist' not defined
-<twoerrors>&idontexist;</unbalanced>
+<twoerrors>&idontexist;</unbalanced>
^
line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
-<twoerrors>&idontexist;</unbalanced>
+<twoerrors>&idontexist;</unbalanced>
^
SELECT xmlparse(content '<nosuchprefix:tag/>');
xmlparse
@@ -285,11 +285,11 @@ SELECT xmlparse(content '<nosuchprefix:tag/>');
<nosuchprefix:tag/>
(1 row)
-SELECT xmlparse(document ' ');
+SELECT xmlparse(document '!');
ERROR: invalid XML document
DETAIL: line 1: Start tag expected, '<' not found
-
- ^
+!
+^
SELECT xmlparse(document 'abc');
ERROR: invalid XML document
DETAIL: line 1: Start tag expected, '<' not found
@@ -301,21 +301,21 @@ SELECT xmlparse(document '<abc>x</abc>');
<abc>x</abc>
(1 row)
-SELECT xmlparse(document '<invalidentity>&</abc>');
+SELECT xmlparse(document '<invalidentity>&</abc> ');
ERROR: invalid XML document
DETAIL: line 1: xmlParseEntityRef: no name
-<invalidentity>&</abc>
+<invalidentity>&</abc>
^
line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
-<invalidentity>&</abc>
+<invalidentity>&</abc>
^
-SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc> ');
ERROR: invalid XML document
DETAIL: line 1: Entity 'idontexist' not defined
-<undefinedentity>&idontexist;</abc>
+<undefinedentity>&idontexist;</abc>
^
line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
-<undefinedentity>&idontexist;</abc>
+<undefinedentity>&idontexist;</abc>
^
SELECT xmlparse(document '<invalidns xmlns=''<''/>');
xmlparse
@@ -329,13 +329,13 @@ SELECT xmlparse(document '<relativens xmlns=''relative''/>');
<relativens xmlns='relative'/>
(1 row)
-SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced> ');
ERROR: invalid XML document
DETAIL: line 1: Entity 'idontexist' not defined
-<twoerrors>&idontexist;</unbalanced>
+<twoerrors>&idontexist;</unbalanced>
^
line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
-<twoerrors>&idontexist;</unbalanced>
+<twoerrors>&idontexist;</unbalanced>
^
SELECT xmlparse(document '<nosuchprefix:tag/>');
xmlparse
diff --git a/src/test/regress/sql/xml.sql b/src/test/regress/sql/xml.sql
index 2b8445e499e..0366b776119 100644
--- a/src/test/regress/sql/xml.sql
+++ b/src/test/regress/sql/xml.sql
@@ -5,7 +5,7 @@ CREATE TABLE xmltest (
INSERT INTO xmltest VALUES (1, '<value>one</value>');
INSERT INTO xmltest VALUES (2, '<value>two</value>');
-INSERT INTO xmltest VALUES (3, '<wrong');
+INSERT INTO xmltest VALUES (3, '<value>two</wrong> ');
SELECT * FROM xmltest;
@@ -30,7 +30,7 @@ SELECT xmlconcat(xmlcomment('hello'),
SELECT xmlconcat('hello', 'you');
SELECT xmlconcat(1, 2);
-SELECT xmlconcat('bad', '<syntax');
+SELECT xmlconcat('bad', '<wrong></syntax> ');
SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
SELECT xmlconcat(NULL);
@@ -75,17 +75,17 @@ SELECT xmlparse(content '<invalidentity>&</invalidentity>');
SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
SELECT xmlparse(content '<invalidns xmlns=''<''/>');
SELECT xmlparse(content '<relativens xmlns=''relative''/>');
-SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced> ');
SELECT xmlparse(content '<nosuchprefix:tag/>');
-SELECT xmlparse(document ' ');
+SELECT xmlparse(document '!');
SELECT xmlparse(document 'abc');
SELECT xmlparse(document '<abc>x</abc>');
-SELECT xmlparse(document '<invalidentity>&</abc>');
-SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
+SELECT xmlparse(document '<invalidentity>&</abc> ');
+SELECT xmlparse(document '<undefinedentity>&idontexist;</abc> ');
SELECT xmlparse(document '<invalidns xmlns=''<''/>');
SELECT xmlparse(document '<relativens xmlns=''relative''/>');
-SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
+SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced> ');
SELECT xmlparse(document '<nosuchprefix:tag/>');