summaryrefslogtreecommitdiff
path: root/mysql-test/t/xml.test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-04-11 13:25:02 +0500
committerunknown <bar@mysql.com>2006-04-11 13:25:02 +0500
commit6c0cfad17b54029974d4c40503e5146adc994ca9 (patch)
treeefede149e0da572a4272ed490cb8c7f5de23d47d /mysql-test/t/xml.test
parenta514095a5d306fead8d22d03a39c83db18d98ef8 (diff)
downloadmariadb-git-6c0cfad17b54029974d4c40503e5146adc994ca9.tar.gz
Bug#16233: XML: ExtractValue() fails with special characters
ExtractValue didn't understand tag and attribute names consisting of "tricky" national letters (e.g. latin accenter letters). It happened because XPath lex parser recognized only basic latin letter a..z ad a part of an identifier. Fixed to recognize all letters by means of new "full ctype" which was added recently. mysql-test/r/xml.result: Adding test case mysql-test/t/xml.test: Adding test case sql/item_xmlfunc.cc: Using recently implemented "true" ctype functionality to treat all national letters as valid tag names, Only basic latin letters worked so far. strings/ctype-simple.c: A bug fix: ctype is array of 257 elements, adding offset to address correct element.
Diffstat (limited to 'mysql-test/t/xml.test')
-rw-r--r--mysql-test/t/xml.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index af3ec2d827e..4bc76287fe2 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -295,3 +295,23 @@ select extractValue('<e>1</e>','last()');
--error 1105
select extractValue('<e><a>1</a></e>','/e/');
+#
+# Bug#16233: XML: ExtractValue() fails with special characters
+#
+set names utf8;
+select extractValue('<Ñ><r>r</r></Ñ>','/Ñ/r');
+select extractValue('<r><Ñ>Ñ</Ñ></r>','/r/Ñ');
+select extractValue('<Ñ r="r"/>','/Ñ/@r');
+select extractValue('<r Ñ="Ñ"/>','/r/@Ñ');
+--disable_warnings
+DROP PROCEDURE IF EXISTS p2;
+--enable_warnings
+DELIMITER //;
+CREATE PROCEDURE p2 ()
+BEGIN
+ DECLARE p LONGTEXT CHARACTER SET UTF8 DEFAULT '<Ñ><r>A</r></Ñ>';
+ SELECT EXTRACTVALUE(p,'/Ñ/r');
+END//
+DELIMITER ;//
+CALL p2();
+DROP PROCEDURE p2;