mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31380: Assertion `s->table->opt_range_condition_rows <= s->found_records' failed
LooseScan code set opt_range_condition_rows to be the MIN(loose_scan_plan->records, table->records) totally ignoring possible quick range selects. If there was a quick select $QUICK on another index with $QUICK->records < loose_scan_plan->records this would create a situation where opt_range_condition_rows > $QUICK->records which causes an assert in 10.6+ and potentially wrong query plan choice in 10.5. Fixed by making opt_range_condition_rows to be the minimum #rows of any quick select. Approved-by: Monty <monty@mariadb.org>
This commit is contained in:
@@ -3030,8 +3030,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
||||
restore_nonrange_trees(¶m, tree, backup_keys);
|
||||
if ((group_trp= get_best_group_min_max(¶m, tree, read_time)))
|
||||
{
|
||||
param.table->opt_range_condition_rows= MY_MIN(group_trp->records,
|
||||
head->stat_records());
|
||||
set_if_smaller(param.table->opt_range_condition_rows,
|
||||
group_trp->records);
|
||||
Json_writer_object grp_summary(thd, "best_group_range_summary");
|
||||
|
||||
if (unlikely(thd->trace_started()))
|
||||
|
Reference in New Issue
Block a user