Commit cf36ae5c authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-26831 fallout: cache cleanup

Correct cache cleanup (cached field number also have to be reset).
parent 87c3d50b
...@@ -6361,8 +6361,19 @@ find_field_in_tables(THD *thd, Item_ident *item, ...@@ -6361,8 +6361,19 @@ find_field_in_tables(THD *thd, Item_ident *item,
Store the original table of the field, which may be different from Store the original table of the field, which may be different from
cur_table in the case of NATURAL/USING join. cur_table in the case of NATURAL/USING join.
*/ */
item->cached_table= (!actual_table->cacheable_table || found) ? if (actual_table->cacheable_table /*(1)*/ && !found /*(2)*/)
0 : actual_table; {
/*
We have just found a field allowed to cache (1) and
it is not dublicate search (2).
*/
item->cached_table= actual_table;
}
else
{
item->cached_table= NULL;
item->cached_field_index= NO_CACHED_FIELD_INDEX;
}
DBUG_ASSERT(thd->where); DBUG_ASSERT(thd->where);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment