summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2007-01-07 22:49:56 +0000
committerPeter Eisentraut <peter_e@gmx.net>2007-01-07 22:49:56 +0000
commitd807c7ef3f1a04026c3c4b5b24954f7fc84d0e46 (patch)
tree592a826a1d9a2cf29e6acae3f6cc0d5283708286 /src/test
parentde9aa5a7b4d9696b1daceba01d155cbd783bc883 (diff)
downloadpostgresql-d807c7ef3f1a04026c3c4b5b24954f7fc84d0e46.tar.gz
Some fine-tuning of xmlpi in corner cases:
- correct error codes - do syntax checks in correct order - strip leading spaces of argument
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/xml.out15
-rw-r--r--src/test/regress/expected/xml_1.out6
-rw-r--r--src/test/regress/sql/xml.sql3
3 files changed, 24 insertions, 0 deletions
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out
index 9ebef1404b..c0ec868bf8 100644
--- a/src/test/regress/expected/xml.out
+++ b/src/test/regress/expected/xml.out
@@ -124,6 +124,21 @@ SELECT xmlpi(name foo, 'bar');
SELECT xmlpi(name foo, 'in?>valid');
ERROR: invalid XML processing instruction
DETAIL: XML processing instruction cannot contain "?>".
+SELECT xmlpi(name foo, null);
+ xmlpi
+-------
+
+(1 row)
+
+SELECT xmlpi(name xmlstuff, null);
+ERROR: invalid XML processing instruction
+DETAIL: XML processing instruction target name cannot start with "xml".
+SELECT xmlpi(name foo, ' bar');
+ xmlpi
+-------------
+ <?foo bar?>
+(1 row)
+
SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
xmlroot
-----------------------
diff --git a/src/test/regress/expected/xml_1.out b/src/test/regress/expected/xml_1.out
index 662c0e236a..5a1a6ac031 100644
--- a/src/test/regress/expected/xml_1.out
+++ b/src/test/regress/expected/xml_1.out
@@ -62,6 +62,12 @@ SELECT xmlpi(name foo, 'bar');
ERROR: no XML support in this installation
SELECT xmlpi(name foo, 'in?>valid');
ERROR: no XML support in this installation
+SELECT xmlpi(name foo, null);
+ERROR: no XML support in this installation
+SELECT xmlpi(name xmlstuff, null);
+ERROR: no XML support in this installation
+SELECT xmlpi(name foo, ' bar');
+ERROR: no XML support in this installation
SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
ERROR: no XML support in this installation
SELECT xmlroot(xml '<foo/>', version '2.0');
diff --git a/src/test/regress/sql/xml.sql b/src/test/regress/sql/xml.sql
index cf96beab06..ae7d633c1c 100644
--- a/src/test/regress/sql/xml.sql
+++ b/src/test/regress/sql/xml.sql
@@ -51,6 +51,9 @@ SELECT xmlpi(name foo);
SELECT xmlpi(name xmlstuff);
SELECT xmlpi(name foo, 'bar');
SELECT xmlpi(name foo, 'in?>valid');
+SELECT xmlpi(name foo, null);
+SELECT xmlpi(name xmlstuff, null);
+SELECT xmlpi(name foo, ' bar');
SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
SELECT xmlroot(xml '<foo/>', version '2.0');