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

Make marking/testing of top level item uniform

There where several different implementations of is_top_level_item(),
with different variable names and tests. In some cases the code used
'is_top_level_item()' as a test, in other cases it accessed the variable
directrly. This patch makes all usage of 'top_level_item' uniform.

The new implementation stores the 'is_tol_level_item()' flag as part
of base_flags. This saves 7 bytes in all items that previously stored
the flag in it's own bool.

I had to keep 'top_level_item()' virtual to ensure that Item_bool_const
item's will not be updated.  'is_top_level_item()' is not virtual
anymore.
This commit is contained in:
Monty
2021-07-03 03:39:15 +03:00
committed by Vicențiu Ciorbaru
parent f069aa1dc2
commit fcbb2a1df1
6 changed files with 82 additions and 93 deletions

View File

@@ -16362,9 +16362,9 @@ static void update_const_equal_items(THD *thd, COND *cond, JOIN_TAB *tab,
Item *item;
while ((item= li++))
update_const_equal_items(thd, item, tab,
(((Item_cond*) cond)->top_level() &&
((Item_cond*) cond)->functype() ==
Item_func::COND_AND_FUNC));
cond->is_top_level_item() &&
((Item_cond*) cond)->functype() ==
Item_func::COND_AND_FUNC);
}
else if (cond->type() == Item::FUNC_ITEM &&
((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC)