Bug #16321 XML: extractvalue() navigation problem
Submitted: 9 Jan 2006 23:31 Modified: 2 Mar 2006 7:29
Reporter: Peter Gulutzan Email Updates:
Status: Closed 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:31] Peter Gulutzan
Description:
With extractvalue(), if I navigate to the root, up from the root,
then down (which should take me back to the root),
I get nothing. This is true for /.. and for
/descendant::*/ancestor::*.. By analogy with
Unix, e.g. "cd /../var", I think such a thing
should be possible.

How to repeat:
mysql> select extractvalue('<a>A<b>B</b></a>','/../a');
+------------------------------------------+
| extractvalue('<a>A<b>B</b></a>','/../a') |
+------------------------------------------+
|                                          |
+------------------------------------------+
1 row in set (0.00 sec)
[9 Jan 2006 23:53] MySQL Verification Team
mysql> select extractvalue('<a>A<b>B</b></a>','/../a');
+------------------------------------------+
| extractvalue('<a>A<b>B</b></a>','/../a') |
+------------------------------------------+
|                                          |
+------------------------------------------+
1 row in set (0.01 sec)
[1 Mar 2006 10:07] Alexander Barkov
Oracle behaves the same. So I guess we can close as not a bug:

SQL> select sys.xmltype.getclobval(sys.xmltype.extract(x,'/a')) from t1;

SYS.XMLTYPE.GETCLOBVAL(SYS.XMLTYPE.EXTRACT(X,'/A'))
--------------------------------------------------------------------------------
<a>
A  <b>B</b>
</a>

SYS.XMLTYPE.GETCLOBVAL(SYS.XMLTYPE.EXTRACT(X,'/../A'))
--------------------------------------------------------------------------------

To doc team: consider documenting this behaviour, then close as "not a bug". Thanks!
[2 Mar 2006 7:29] Jon Stephens
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Updated documentation relating to limitations of XPath functions. Closed.