Bug #16317 XML: extractvalue() finds truth in nonexistent places
Submitted: 9 Jan 2006 23:25 Modified: 12 Apr 2006 11:45
Reporter: Peter Gulutzan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: XML functions Severity:S3 (Non-critical)
Version:5.1.5-alpha-debug OS:Linux (SUSE 10.0)
Assigned to: Alexander Barkov CPU Architecture:Any

[9 Jan 2006 23:25] Peter Gulutzan
Description:
With extractvalue(), if a node doesn't exist, then any
contains() for that node should fail. But contains()
succeeds if the search is for "".

How to repeat:
mysql> select extractvalue('<a>a b</a>','/a[contains(../Q,"")]');
+----------------------------------------------------+
| extractvalue('<a>a b</a>','/a[contains(../Q,"")]') |
+----------------------------------------------------+
| a b                                                |
+----------------------------------------------------+
1 row in set (0.00 sec)
[12 Apr 2006 11:45] Alexander Barkov
This is rather expected behavior.

This online xpath visualization tool thinks the same:
http://www.activsoftware.com/xml/xpath/

Closing as not a bug.