1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Monty
2023-12-21 18:25:39 +02:00
parent 2fcb5d651b
commit c49fd90263

View File

@@ -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