From 4eb245f030da9ce1b4854e9129b08bc68aaef59f Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 20 Mar 2013 01:35:05 -0700 Subject: [PATCH] Correction for the previous fix. --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 24d518d787a..20010eb6465 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6988,7 +6988,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, /* Discount the selectivity of the access method used to join table s */ if (s->quick && s->quick->index != MAX_KEY) { - if (!ref) + if (join->positions[idx].key == 0) { /* A range scan by index s->quick->index is used to access table s */ sel*= table_records/table->quick_rows[s->quick->index];