summaryrefslogtreecommitdiff
path: root/mysql-test/t/xml.test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com/bar.intranet.mysql.r18.ru>2006-10-23 14:17:57 +0500
committerunknown <bar@mysql.com/bar.intranet.mysql.r18.ru>2006-10-23 14:17:57 +0500
commit7595cb06eb92658258bc59ac7a0c8212388d75e8 (patch)
tree80ec071f5e4273a7cb535927c60ec872affb2853 /mysql-test/t/xml.test
parent81eb1ccda26658d4cae69cc396413bb2819221ff (diff)
downloadmariadb-git-7595cb06eb92658258bc59ac7a0c8212388d75e8.tar.gz
Bug#22823 gt and lt operators appear to be reversed in ExtractValue() command
Problem: "greater than" and "less than" XPath operators appeared to have been implemented in reverse. Fix: swap arguments to eq_func() and eq_func_reverse() to provide correct operation result. mysql-test/r/xml.result: Adding test case mysql-test/t/xml.test: Adding test case sql/item_xmlfunc.cc: Pass argumemtns to eq_func() and eq_func_reverse() in correct order: nodeset argument first, then scalar argument. Also, fixing eq_func_reverse() to do correct conversion, e.g: "scalar > nodeset" into "nodeset < scalar" instead of wrong "nodeset <= scalar" "scalar >= nodeset" into "nodeset <= scalar" instead of wrong "nodeset < scalar".
Diffstat (limited to 'mysql-test/t/xml.test')
-rw-r--r--mysql-test/t/xml.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 3347573b4b7..ef94c7508c4 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -376,3 +376,33 @@ select extractValue('<:>test</:>','//*');
select extractValue('<_>test</_>','//*');
# dot, dash, underscore and semicolon are good identifier middle characters
select extractValue('<x.-_:>test</x.-_:>','//*');
+
+#
+# Bug#22823 gt and lt operators appear to be
+# reversed in ExtractValue() command
+#
+set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
+select ExtractValue(@xml, "/entry[(pt=10)]/id");
+select ExtractValue(@xml, "/entry[(pt!=10)]/id");
+select ExtractValue(@xml, "/entry[(pt<10)]/id");
+select ExtractValue(@xml, "/entry[(pt<=10)]/id");
+select ExtractValue(@xml, "/entry[(pt>10)]/id");
+select ExtractValue(@xml, "/entry[(pt>=10)]/id");
+select ExtractValue(@xml, "/entry[(pt=50)]/id");
+select ExtractValue(@xml, "/entry[(pt!=50)]/id");
+select ExtractValue(@xml, "/entry[(pt<50)]/id");
+select ExtractValue(@xml, "/entry[(pt<=50)]/id");
+select ExtractValue(@xml, "/entry[(pt>50)]/id");
+select ExtractValue(@xml, "/entry[(pt>=50)]/id");
+select ExtractValue(@xml, "/entry[(10=pt)]/id");
+select ExtractValue(@xml, "/entry[(10!=pt)]/id");
+select ExtractValue(@xml, "/entry[(10>pt)]/id");
+select ExtractValue(@xml, "/entry[(10>=pt)]/id");
+select ExtractValue(@xml, "/entry[(10<pt)]/id");
+select ExtractValue(@xml, "/entry[(10<=pt)]/id");
+select ExtractValue(@xml, "/entry[(50=pt)]/id");
+select ExtractValue(@xml, "/entry[(50!=pt)]/id");
+select ExtractValue(@xml, "/entry[(50>pt)]/id");
+select ExtractValue(@xml, "/entry[(50>=pt)]/id");
+select ExtractValue(@xml, "/entry[(50<pt)]/id");
+select ExtractValue(@xml, "/entry[(50<=pt)]/id");