diff options
author | unknown <bar@mysql.com> | 2006-04-07 14:07:56 +0500 |
---|---|---|
committer | unknown <bar@mysql.com> | 2006-04-07 14:07:56 +0500 |
commit | e84041f174684beda03b25acec82b93d04445e41 (patch) | |
tree | 8d20f849c47112de0d48b8646e94b32180cefeef /mysql-test/r/xml.result | |
parent | 6de776f70afb52fd4e851f57b7165d13dfa5dc95 (diff) | |
download | mariadb-git-e84041f174684beda03b25acec82b93d04445e41.tar.gz |
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)
Diffstat (limited to 'mysql-test/r/xml.result')
-rw-r--r-- | mysql-test/r/xml.result | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 52f80000015..e8d55124778 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -468,6 +468,30 @@ extractValue(@xml, '/a/@b[substring(.,2,1)="1"]') select extractValue(@xml, '/a/@b[substring(.,2,1)="2"]'); extractValue(@xml, '/a/@b[substring(.,2,1)="2"]') 12 22 +SET @xml='<a><b>b1</b><b>b2</b></a>'; +SELECT extractValue(@xml, '/a/b[string-length("x")=1]'); +extractValue(@xml, '/a/b[string-length("x")=1]') +b1 b2 +SELECT extractValue(@xml, '/a/b[string-length("xx")=2]'); +extractValue(@xml, '/a/b[string-length("xx")=2]') +b1 b2 +SELECT extractValue(@xml, '/a/b[string-length("xxx")=2]'); +extractValue(@xml, '/a/b[string-length("xxx")=2]') + +SELECT extractValue(@xml, '/a/b[string-length("x")]'); +extractValue(@xml, '/a/b[string-length("x")]') +b1 +SELECT extractValue(@xml, '/a/b[string-length("xx")]'); +extractValue(@xml, '/a/b[string-length("xx")]') +b2 +SELECT extractValue(@xml, '/a/b[string-length()]'); +extractValue(@xml, '/a/b[string-length()]') +b2 +SELECT extractValue(@xml, 'string-length()'); +ERROR HY000: XPATH syntax error: '' +SELECT extractValue(@xml, 'string-length("x")'); +extractValue(@xml, 'string-length("x")') +1 SET @xml='<a b="b11" b="b12" b="b21" b="22"/>'; select extractValue(@xml,'/a/@b'); extractValue(@xml,'/a/@b') |