diff options
author | Michael Widenius <monty@mariadb.org> | 2020-07-28 19:41:05 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:27:28 +0200 |
commit | ae39f4f6d61bdd57394afa8f88285f9e34640eb7 (patch) | |
tree | 52c6ff54e719f69cab2b9d1638ff642d12bfd9a6 /sql/item_cmpfunc.cc | |
parent | 963e5e406da7bc94eff3e8fc07f6cb625dd84d52 (diff) | |
download | mariadb-git-ae39f4f6d61bdd57394afa8f88285f9e34640eb7.tar.gz |
Revert MDEV-16592 "Change Item::with_sum_func to a virtual method"
Added back variable 'with_sum_func' to Item class as a bit field.
This made the code shorter, faster (removed some virtual methods,
less code to create an initialized item etc) and made many Item's 7 bytes
smaller.
The code is also easier to understand as 'with_sum_func' is threated as any
other Item variable when creating or copying items.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 97c41373d12..aea30ebf0c1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1342,7 +1342,7 @@ bool Item_in_optimizer::fix_left(THD *thd) used_tables_cache= args[0]->used_tables(); } eval_not_null_tables(NULL); - copy_with_sum_func(args[0]); + with_sum_func= args[0]->with_sum_func; with_param= args[0]->with_param || args[1]->with_param; with_field= args[0]->with_field; if ((const_item_cache= args[0]->const_item())) @@ -1354,7 +1354,7 @@ bool Item_in_optimizer::fix_left(THD *thd) { /* to avoid overriding is called to update left expression */ used_tables_and_const_cache_join(args[1]); - join_with_sum_func(args[1]); + with_sum_func= with_sum_func || args[1]->with_sum_func; } DBUG_RETURN(0); } @@ -1390,7 +1390,7 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref) if (args[1]->maybe_null) maybe_null=1; m_with_subquery= true; - join_with_sum_func(args[1]); + with_sum_func= with_sum_func || args[1]->with_sum_func; with_field= with_field || args[1]->with_field; with_param= args[0]->with_param || args[1]->with_param; used_tables_and_const_cache_join(args[1]); @@ -1939,7 +1939,7 @@ bool Item_func_interval::fix_length_and_dec() max_length= 2; used_tables_and_const_cache_join(row); not_null_tables_cache= row->not_null_tables(); - join_with_sum_func(row); + with_sum_func= with_sum_func || row->with_sum_func; with_param= with_param || row->with_param; with_field= with_field || row->with_field; return FALSE; @@ -4939,7 +4939,7 @@ Item_cond::fix_fields(THD *thd, Item **ref) const_item_cache= FALSE; } - join_with_sum_func(item); + with_sum_func|= item->with_sum_func; with_param|= item->with_param; with_field|= item->with_field; m_with_subquery|= item->with_subquery(); @@ -7058,7 +7058,7 @@ bool Item_equal::fix_fields(THD *thd, Item **ref) used_tables_cache|= item->used_tables(); tmp_table_map= item->not_null_tables(); not_null_tables_cache|= tmp_table_map; - DBUG_ASSERT(!item->with_sum_func() && !item->with_subquery()); + DBUG_ASSERT(!item->with_sum_func && !item->with_subquery()); if (item->maybe_null) maybe_null= 1; if (!item->get_item_equal()) |