Bug #20795 extractvalue() won't accept names containing a dot (.)
Submitted: 30 Jun 2006 17:17 Modified: 6 Nov 2006 15:03
Reporter: Thomas Tallyce Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: XML functions Severity:S3 (Non-critical)
Version:5.1-BK, 5.1.11 OS:Linux (Linux)
Assigned to: Alexander Barkov CPU Architecture:Any

[30 Jun 2006 17:17] Thomas Tallyce
Description:
Problem as described on
http://forums.mysql.com/read.php?10,94146,94146

When a tag in some inserted XML contains a . character, querying using ExtractValue results in NULL response.

How to repeat:
Insert XML into a table such as:

<foo>
  <foo.bar>Data</foo.bar>
  <something>Other data</something>
</foo>

Running

SELECT id,EXTRACTVALUE(data,'/foo/something') FROM tablename;

then results in

+-------------------------------------+
| EXTRACTVALUE(data,'/foo/something') |
+-------------------------------------+
| NULL                                |
+-------------------------------------+
[1 Jul 2006 9:11] Valeriy Kravchuk
Thank you for a problem report. Verified just as described, also on 5.1-BK on Linux.
[1 Jul 2006 9:14] Valeriy Kravchuk
Test case:

create table txml (id int, xml text);
insert into txml 
values(1, '<foo><foo.bar>Data</foo.bar><something>Other data</something></foo>');
SELECT id,EXTRACTVALUE(xml,'/foo/something') from txml;
[25 Jul 2006 13: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/9539
[31 Jul 2006 11:40] Sergey Glukhov
ok to push
[1 Aug 2006 10:09] Alexander Barkov
Pushed into 5.1-kt currently marked as 5.1.12-beta
[11 Sep 2006 11:10] Alexander Barkov
Merged into 5.1.12
[14 Sep 2006 7:03] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.12 changelog.
[6 Nov 2006 15:03] Thomas Tallyce
I can confirm that this issue is definitely corrected in the released 5.1.12, as I've been able to remove our workaround code to cope with it.

Many thanks for fixing this.