diff options
author | Guilhem Bichot <guilhem@mysql.com> | 2009-10-19 15:14:43 +0200 |
---|---|---|
committer | Guilhem Bichot <guilhem@mysql.com> | 2009-10-19 15:14:43 +0200 |
commit | 3088f6c7ba361b1baa8de649d7ff32ed1f2293d4 (patch) | |
tree | 701ebd13b296eee5dae0a7aa9efec45753ef338a /sql/sql_select.cc | |
parent | 425c5ecd7c9a878479763f3c1e90b889f1572414 (diff) | |
download | mariadb-git-3088f6c7ba361b1baa8de649d7ff32ed1f2293d4.tar.gz |
Back-port from 6.0 of the fix for
BUG#38049 "incorrect rows estimations with references from preceding table"
(from revid:sergefp@mysql.com-20090126194259-ue20il3qro529l4d).
Compared to 6.0 where EXPLAIN indicates "Using index condition", here in join_optimizer.result
we see "Using where"; it's normal; 6.0 shows the same if disabling Index Condition Pushdown.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9d07deea9be..b66a1f8f1cf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4328,7 +4328,8 @@ best_access_path(JOIN *join, in ReuseRangeEstimateForRef-3. */ if (table->quick_keys.is_set(key) && - const_part & (1 << table->quick_key_parts[key]) && + (const_part & ((1 << table->quick_key_parts[key])-1)) == + ((1 << table->quick_key_parts[key])-1) && table->quick_n_ranges[key] == 1 && records > (double) table->quick_rows[key]) { |