mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
c
This commit is contained in:
@@ -5567,7 +5567,6 @@ best_access_path(JOIN *join,
|
||||
tmp= best_time; // Do nothing
|
||||
}
|
||||
|
||||
DBUG_ASSERT(tmp > 0 || record_count == 0);
|
||||
tmp += s->startup_cost;
|
||||
loose_scan_opt.check_ref_access_part2(key, start_key, records, tmp);
|
||||
} /* not ft_key */
|
||||
@@ -7772,16 +7771,19 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
|
||||
}
|
||||
keyuse++;
|
||||
} while (keyuse->table == table && keyuse->key == key);
|
||||
|
||||
if (!keyparts && allow_full_scan)
|
||||
{
|
||||
/* It's a LooseIndexScan strategy scanning whole index */
|
||||
j->type= JT_ALL;
|
||||
j->index= key;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
DBUG_ASSERT(length > 0);
|
||||
DBUG_ASSERT(keyparts != 0);
|
||||
} /* not ftkey */
|
||||
|
||||
if (!keyparts && allow_full_scan)
|
||||
{
|
||||
/* It's a LooseIndexScan strategy scanning whole index */
|
||||
j->type= JT_ALL;
|
||||
j->index= key;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
/* set up fieldref */
|
||||
j->ref.key_parts= keyparts;
|
||||
j->ref.key_length= length;
|
||||
@@ -18283,6 +18285,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
||||
bool changed_key= false;
|
||||
DBUG_ENTER("test_if_skip_sort_order");
|
||||
|
||||
/* Check that we are always called with first non-const table */
|
||||
DBUG_ASSERT(tab == tab->join->join_tab + tab->join->const_tables);
|
||||
|
||||
/*
|
||||
Keys disabled by ALTER TABLE ... DISABLE KEYS should have already
|
||||
been taken into account.
|
||||
@@ -18370,7 +18375,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
|
||||
keyuse++;
|
||||
|
||||
if (create_ref_for_key(tab->join, tab, keyuse, FALSE,
|
||||
tab->join->const_table_map))
|
||||
(tab->join->const_table_map |
|
||||
OUTER_REF_TABLE_BIT)))
|
||||
goto use_filesort;
|
||||
|
||||
pick_table_access_method(tab);
|
||||
|
||||
Reference in New Issue
Block a user