1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#16319: XML: extractvalue() returns syntax errors for some functions

mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Adding support for missing XPath function string-length().
  Fixing function lookup to allow functions with one optional arguments
  (i.e. with 0 or 1 arguments)
This commit is contained in:
unknown
2006-04-07 14:07:56 +05:00
parent 6de776f70a
commit e84041f174
3 changed files with 55 additions and 1 deletions

View File

@@ -192,6 +192,20 @@ select extractValue(@xml, '/a/@b[substring(.,1,1)="2"]');
select extractValue(@xml, '/a/@b[substring(.,2,1)="1"]');
select extractValue(@xml, '/a/@b[substring(.,2,1)="2"]');
#
# Bug#16319: XML: extractvalue() returns syntax errors for some functions
#
SET @xml='<a><b>b1</b><b>b2</b></a>';
SELECT extractValue(@xml, '/a/b[string-length("x")=1]');
SELECT extractValue(@xml, '/a/b[string-length("xx")=2]');
SELECT extractValue(@xml, '/a/b[string-length("xxx")=2]');
SELECT extractValue(@xml, '/a/b[string-length("x")]');
SELECT extractValue(@xml, '/a/b[string-length("xx")]');
SELECT extractValue(@xml, '/a/b[string-length()]');
--error 1105
SELECT extractValue(@xml, 'string-length()');
SELECT extractValue(@xml, 'string-length("x")');
SET @xml='<a b="b11" b="b12" b="b21" b="22"/>';
select extractValue(@xml,'/a/@b');
select extractValue(@xml,'/a/@b[contains(.,"1")]');