From 6c0cfad17b54029974d4c40503e5146adc994ca9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Apr 2006 13:25:02 +0500 Subject: 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. --- mysql-test/t/xml.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t/xml.test') 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('1','last()'); --error 1105 select extractValue('1','/e/'); +# +# Bug#16233: XML: ExtractValue() fails with special characters +# +set names utf8; +select extractValue('<Ñ>r','/Ñ/r'); +select extractValue('<Ñ>Ñ','/r/Ñ'); +select extractValue('<Ñ r="r"/>','/Ñ/@r'); +select extractValue('','/r/@Ñ'); +--disable_warnings +DROP PROCEDURE IF EXISTS p2; +--enable_warnings +DELIMITER //; +CREATE PROCEDURE p2 () +BEGIN + DECLARE p LONGTEXT CHARACTER SET UTF8 DEFAULT '<Ñ>A'; + SELECT EXTRACTVALUE(p,'/Ñ/r'); +END// +DELIMITER ;// +CALL p2(); +DROP PROCEDURE p2; -- cgit v1.2.1