Bug #22823 gt and lt operators appear to be reversed in ExtractValue() command
Submitted: 29 Sep 2006 13:04 Modified: 17 Nov 2006 16:20
Reporter: Vincent Fumo Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: XML functions Severity:S2 (Serious)
Version:5.1.11 OS:Microsoft Windows (Windows)
Assigned to: Alexander Barkov
Tags: ExtractValue, XML, XPath

[29 Sep 2006 13:04] Vincent Fumo
In reguards to XPath evaluation of integer and floating point values, the greater than and less than operators appear to have been implemented in reverse.

How to repeat:
If you run the following select statement:

'/entry[(pt < 9)]/id'

the result you get is: 'foo bar' where you would expect to get 0 results. If you reverse the '<' operator as follows:

'/entry[(pt > 9)]/id'

you get 0 results.

This can be repeated using floating points as well.

Suggested fix:
Reverse the implementation of the operarors when they are used to evaluate integers and floating point values.
[17 Oct 2006 7:38] Hartmut Holzgraefe
mysqltest test case

Attachment: bug22823.tar.gz (application/x-gzip, text), 786 bytes.

[23 Oct 2006 9:17] 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:


ChangeSet@1.2310, 2006-10-23 14:17:57+05:00, bar@mysql.com +3 -0
  Bug#22823 gt and lt operators appear to be reversed in ExtractValue() command
  Problem: "greater than" and "less than" XPath operators appeared to have been implemented in reverse.
  Fix: swap arguments to eq_func() and eq_func_reverse() to provide correct operation result.
[3 Nov 2006 11:59] Alexander Barkov
Pushed into 5.1.13-rpl
[16 Nov 2006 16:46] Alexander Barkov
Appeared in 5.1.14 common
[17 Nov 2006 16:20] 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


Documented bugfix in 5.1.14 changelog.