summaryrefslogtreecommitdiff
path: root/src/test/regress
diff options
context:
space:
mode:
authorPeter Eisentraut2007-11-09 15:52:51 +0000
committerPeter Eisentraut2007-11-09 15:52:51 +0000
commit8db43db01efb6c6dd13c1e1101af269a2f3e32f5 (patch)
treed9885ee9da99682cf8d23abdf37feefa5b33d2ff /src/test/regress
parent3991c3fb2beb7164fc3a1461928e06d52e680dfd (diff)
Allow XML processing instructions starting with "xml" while prohibiting
those being exactly "xml". Bug #3735 from Ben Leslie
Diffstat (limited to 'src/test/regress')
-rw-r--r--src/test/regress/expected/xml.out26
-rw-r--r--src/test/regress/expected/xml_1.out12
-rw-r--r--src/test/regress/sql/xml.sql3
3 files changed, 37 insertions, 4 deletions
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out
index 8ffde1dc6af..45d82c7dda8 100644
--- a/src/test/regress/expected/xml.out
+++ b/src/test/regress/expected/xml.out
@@ -180,9 +180,15 @@ SELECT xmlpi(name foo);
<?foo?>
(1 row)
-SELECT xmlpi(name xmlstuff);
+SELECT xmlpi(name xml);
ERROR: invalid XML processing instruction
-DETAIL: XML processing instruction target name cannot start with "xml".
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff);
+ xmlpi
+--------------
+ <?xmlstuff?>
+(1 row)
+
SELECT xmlpi(name foo, 'bar');
xmlpi
-------------
@@ -198,9 +204,21 @@ SELECT xmlpi(name foo, null);
(1 row)
-SELECT xmlpi(name xmlstuff, null);
+SELECT xmlpi(name xml, null);
ERROR: invalid XML processing instruction
-DETAIL: XML processing instruction target name cannot start with "xml".
+DETAIL: XML processing instruction target name cannot be "xml".
+SELECT xmlpi(name xmlstuff, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ xmlpi
+-------------------------------------------------------
+ <?xml-stylesheet href="mystyle.css" type="text/css"?>
+(1 row)
+
SELECT xmlpi(name foo, ' bar');
xmlpi
-------------
diff --git a/src/test/regress/expected/xml_1.out b/src/test/regress/expected/xml_1.out
index ae85f71acc3..76455919fc0 100644
--- a/src/test/regress/expected/xml_1.out
+++ b/src/test/regress/expected/xml_1.out
@@ -140,6 +140,10 @@ SELECT xmlpi(name foo);
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xml);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
SELECT xmlpi(name xmlstuff);
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
@@ -156,10 +160,18 @@ SELECT xmlpi(name foo, null);
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name xml, null);
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
SELECT xmlpi(name xmlstuff, null);
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
HINT: You need to rebuild PostgreSQL using --with-libxml.
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
+HINT: You need to rebuild PostgreSQL using --with-libxml.
SELECT xmlpi(name foo, ' bar');
ERROR: unsupported XML feature
DETAIL: This functionality requires the server to be built with libxml support.
diff --git a/src/test/regress/sql/xml.sql b/src/test/regress/sql/xml.sql
index 2c9db299fda..cae45dd28cb 100644
--- a/src/test/regress/sql/xml.sql
+++ b/src/test/regress/sql/xml.sql
@@ -61,11 +61,14 @@ SELECT xmlparse(document '<abc>x</abc>');
SELECT xmlpi(name foo);
+SELECT xmlpi(name xml);
SELECT xmlpi(name xmlstuff);
SELECT xmlpi(name foo, 'bar');
SELECT xmlpi(name foo, 'in?>valid');
SELECT xmlpi(name foo, null);
+SELECT xmlpi(name xml, null);
SELECT xmlpi(name xmlstuff, null);
+SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
SELECT xmlpi(name foo, ' bar');