summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-02-23 18:17:00 +0400
committerunknown <bar@mysql.com>2005-02-23 18:17:00 +0400
commit0de9a3dd14b286d3ef90db50c6f6a1f824caf2bd (patch)
treef31b42dd3c633b5bc0e3537bb74872291e418f8b
parent3fe941e4d3a8424f68563143c7b05b8d7bcac225 (diff)
parenta86dd5b707f1ef2c7fa9a038937daedbb6f95397 (diff)
downloadmariadb-git-0de9a3dd14b286d3ef90db50c6f6a1f824caf2bd.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/bar/mysql-5.0.fresh
-rw-r--r--sql/opt_range.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 66d9da10334..0418225965a 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -7030,8 +7030,12 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
cur_group_key_parts, tree, cur_index_tree,
cur_quick_prefix_records, have_min, have_max,
&cur_read_cost, &cur_records);
-
- if (cur_read_cost < best_read_cost)
+ /*
+ If cur_read_cost is lower than best_read_cost use cur_index.
+ Do not compare doubles directly because they may have different
+ representations (64 vs. 80 bits).
+ */
+ if (cur_read_cost < best_read_cost - (DBL_EPSILON * cur_read_cost))
{
index_info= cur_index_info;
index= cur_index;