Bug #18201 XML: ExtractValue works even if the xml fragment is not well-formed xml
Submitted: 13 Mar 2006 22:59 Modified: 23 Jun 2006 6:40
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: XML functions Severity:S3 (Non-critical)
Version:5.1.7/5.1.8 BK OS:Windows (win xp pro/Suse Linux 10)
Assigned to: Alexander Barkov CPU Architecture:Any

[13 Mar 2006 22:59] Roland Bouman
Description:
Extractvalue accepts XML fragments that are not wellformed. It was expected that this woud yield a runtime error or warning

How to repeat:
mysql> select extractValue('<e>value','/e');
+-------------------------------+
| extractValue('<e>value','/e') |
+-------------------------------+
| value                         |
+-------------------------------+
1 row in set (0.00 sec)

mysql>

Suggested fix:
only allow illegal XML.
[14 Mar 2006 0:23] MySQL Verification Team
Thank you for the bug report.
[14 Mar 2006 13:22] Roland Bouman
Sorry, my comment should of course read:

only allow well-formed XML.

That is: please produce an error or warning when the XML is not well-formed.
[17 Apr 2006 9:47] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5005
[25 Apr 2006 10:22] Alexander Barkov
The patch looks ok to push
[25 Apr 2006 10:36] Alexander Barkov
Oops. I approved myself parch in a mistake. Setting back to "Pacth pending"
[7 Jun 2006 8:41] Sergei Glukhov
ok to push
[19 Jun 2006 14:33] Alexander Barkov
Pushed into team tree
[23 Jun 2006 6:40] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.12 changelog. Closed.