summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-03-31 03:44:51 +0400
committerunknown <konstantin@mysql.com>2005-03-31 03:44:51 +0400
commitf485db429a26666a8468c1ec1227d6bd64a45682 (patch)
treed891b9f81b26c11be96ca19e7eca03abf5ddfbfd /sql/item_cmpfunc.cc
parent30c85129548f7d8267fab809a723672161c6fce9 (diff)
downloadmariadb-git-f485db429a26666a8468c1ec1227d6bd64a45682.tar.gz
A fix for Bug#9443 "mysql_client_test fails on linux and some solaris
platforms": yet another issue with floating pointer comparisons. The fix uses the workaround with volatiles. sql/item_cmpfunc.cc: A fix for the failing mysql_client_test on some Intel platforms when compiled with optimization. We don't use -ffloat-store compileation as it may slow all floating point operations.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 690da1be18c..8498ab4800e 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -393,10 +393,16 @@ int Arg_comparator::compare_e_binary_string()
int Arg_comparator::compare_real()
{
- double val1= (*a)->val();
+ /*
+ Fix yet another manifestation of Bug#2338. 'Volatile' will instruct
+ gcc to flush double values out of 80-bit Intel FPU registers before
+ performing the comparison.
+ */
+ volatile double val1, val2;
+ val1= (*a)->val();
if (!(*a)->null_value)
{
- double val2= (*b)->val();
+ val2= (*b)->val();
if (!(*b)->null_value)
{
owner->null_value= 0;