1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-20056 Assertion `!prebuilt->index->is_primary()' failed

in row_search_idx_cond_check

When usage of rowid filter is evaluated by the optimizer to join a table
to the current partial join employing a certain index it should be checked
that a key for at least the major component of this index can be constructed
using values from the columns of the partial join.
This commit is contained in:
Igor Babaev
2019-11-25 17:40:47 -08:00
parent b6f7ec6a5b
commit 4d4b2867a2
3 changed files with 137 additions and 1 deletions

View File

@ -1638,6 +1638,12 @@ bool JOIN::make_range_rowid_filters()
{
if (!tab->range_rowid_filter_info)
continue;
DBUG_ASSERT(!(tab->ref.key >= 0 &&
tab->ref.key == (int) tab->range_rowid_filter_info->key_no));
DBUG_ASSERT(!(tab->ref.key == -1 && tab->quick &&
tab->quick->index == tab->range_rowid_filter_info->key_no));
int err;
SQL_SELECT *sel= NULL;
Rowid_filter_container *filter_container= NULL;
@ -7701,7 +7707,8 @@ best_access_path(JOIN *join,
found_ref);
} /* not ft_key */
if (records < DBL_MAX)
if (records < DBL_MAX &&
(found_part & 1)) // start_key->key can be used for index access
{
double rows= record_count * records;
double access_cost_factor= MY_MIN(tmp / rows, 1.0);