Commit c49fd902 authored by Monty's avatar Monty

Ensure keyread_tmp variable is assigned.

In the case of calcuating cost for a ref access for which there exists
a usable range, the variable keyread_tmp would always be 0.
If there is also another index that could be used as a filter, the cost
of that filter would be wrong.
In many cases 'the worst_seeks optimzation' would disable the filter
from getting used, which is why this bug has not been noticed before.

The next commit, which allows one to disable worst_seeks, will have a
test case for this bug.
parent 2fcb5d65
......@@ -8219,6 +8219,9 @@ best_access_path(JOIN *join,
trace_access_idx.add("used_range_estimates", true);
tmp= adjust_quick_cost(table->opt_range[key].cost,
table->opt_range[key].rows);
keyread_tmp= table->file->keyread_time(key, 1,
table->opt_range[key].
rows);
goto got_cost;
}
else
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment