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

MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed in make_join_readinfo

The problem was a wrong assert. I changed it to match the code in
best_access_path().

The given test case was a bit tricky for the optimizer, which first
decided on using a index scan (because of force index), but then
test_if_skip_sort_order() decided to use range anyway to handle
distinct.
This commit is contained in:
Monty
2023-05-27 15:35:12 +03:00
parent 661141948f
commit aac88fc205
4 changed files with 52 additions and 1 deletions

View File

@@ -15373,7 +15373,16 @@ make_join_readinfo(JOIN *join, ulonglong options, uint no_jbuf_after)
push_index_cond(tab, tab->ref.key);
break;
case JT_NEXT: // Index scan
DBUG_ASSERT(!(tab->select && tab->select->quick));
DBUG_ASSERT(!tab->quick);
if (tab->select)
{
/*
select->quick may be set if there was a possible range and
it had a higher cost than a table scan.
*/
delete tab->select->quick;
tab->select->quick=0;
}
if (tab->use_quick == 2)
{
join->thd->set_status_no_good_index_used();