From 32ede45dd416e3ddbcf26ed0704cd86886f5bbd4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Sep 2006 11:47:19 +0500 Subject: Bug#20854 XML functions: wrong result in ExtractValue mysql-test/r/xml.result: - Adding test case - Fixing error message mysql-test/t/xml.test: Adding test case sql/item_xmlfunc.cc: For grammar rules with loops like: AdditiveExpr ::= MultiplicativeExpr ('+' MultiplicativeExpr)* If we scanned scanned '+' and then met an error when parsing MultiplicativeExpr, then we should fully stop parsing - without trying to apply any other rules. Fix: add "error" member into MY_XPATH structure, and make my_xpath_parse_term() never return success as soon as error set. strings/xml.c: Adding my_xml_ctype map for flags, indicating whether a character is a space character, is a valid identifier start character, is a valid identifier body character. Using this map to properly scan identifiers. Also, using this map to scan spaces faster (instead of strchr). --- mysql-test/t/xml.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t/xml.test') diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index d510a61f04d..3347573b4b7 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -360,3 +360,19 @@ select extractValue('a','/ns:element/@x # select extractValue('DataOtherdata','/foo/foo.bar'); select extractValue('DataOtherdata','/foo/something'); + +# +# Bug#20854 XML functions: wrong result in ExtractValue +# +--error 1105 +select extractValue('<01>10:39:15<02>140','/zot/tim0/02'); +select extractValue('<01>10:39:15<02>140','//*'); +# dot and dash are bad identtifier start character +select extractValue('<.>test','//*'); +select extractValue('<->test','//*'); +# semicolon is good identifier start character +select extractValue('<:>test','//*'); +# underscore is good identifier start character +select extractValue('<_>test','//*'); +# dot, dash, underscore and semicolon are good identifier middle characters +select extractValue('test','//*'); -- cgit v1.2.1