summaryrefslogtreecommitdiff
path: root/mysql-test/r/xml.result
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-03-20 14:57:34 +0400
committerunknown <bar@mysql.com>2006-03-20 14:57:34 +0400
commit5f8bd7fe0f4ecc534b24f1e13276b7200ec14bd2 (patch)
treef209b3c5a6738ea9d5c2ec741c26d967825e724c /mysql-test/r/xml.result
parentf9dd31ca8ec96c2c315a9f8011d4f1ed5b73b0a4 (diff)
downloadmariadb-git-5f8bd7fe0f4ecc534b24f1e13276b7200ec14bd2.tar.gz
Bug #18172 XML: Extractvalue() accepts mallformed
XPath without a XPath syntax error item_xmlfunc.cc: Error message didn't happen because after a failing attempt to parse RelativeLocationPath, my_xpath_parse_AbsoluteLocationPath() returned success. Changeing logic a bit: - Try to parse EOF first, return success if true. - Then try to parse RelativeLocationPath(), return success if true. - Otherwise return failure. xml.result: Adding test case. Also, this change made it possible to generate an error message earlier in the case of another bad XPATH syntax. xml.test: Adding test case. sql/item_xmlfunc.cc: Bug #18172 XML: Extractvalue() accepts mallformed XPath without a XPath syntax error Error message didn't happen because after a failing attempt to parse RelativeLocationPath(), my_xpath_parse_AbsoluteLocationPath() returned with 1. Changeing logic a bit: check for EOF first. Then try to parse RelativeLocationPath(). If the latter fails, return failure. mysql-test/t/xml.test: Adding test case. mysql-test/r/xml.result: Adding test case. Also, this change makes error message to be generated earlier in the case of another bad XPATH syntax.
Diffstat (limited to 'mysql-test/r/xml.result')
-rw-r--r--mysql-test/r/xml.result4
1 files changed, 3 insertions, 1 deletions
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index d213ef98885..52f80000015 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -546,7 +546,7 @@ select extractvalue('<a>a<b>B</b></a>','a|/b');
extractvalue('<a>a<b>B</b></a>','a|/b')
a
select extractvalue('<a>A</a>','/<a>');
-ERROR HY000: XPATH syntax error: '>'
+ERROR HY000: XPATH syntax error: '<a>'
select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
ERROR HY000: XPATH syntax error: '!'
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*');
@@ -613,3 +613,5 @@ select extractValue('<e>1</e>','position()');
ERROR HY000: XPATH syntax error: ''
select extractValue('<e>1</e>','last()');
ERROR HY000: XPATH syntax error: ''
+select extractValue('<e><a>1</a></e>','/e/');
+ERROR HY000: XPATH syntax error: ''