Skip to content

Commit 24d6cd7

Browse files
committed
cleanup: Arg_comparator::cache_converted_constant()
It's a generic function, not using anything from Arg_comparator. Make it a static function, not a class method, to be able to use it later without Arg_comparator
1 parent c2671e9 commit 24d6cd7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

sql/item_cmpfunc.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "sql_time.h" // make_truncated_value_warning
3535
#include "sql_base.h" // dynamic_column_error_message
3636

37+
static Item** cache_converted_constant(THD *thd, Item **value,
38+
Item **cache_item, Item_result type,enum_field_types f_type);
3739

3840
/**
3941
find an temporal type (item) that others will be converted to
@@ -707,9 +709,8 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
707709
@return cache item or original value.
708710
*/
709711

710-
Item** Arg_comparator::cache_converted_constant(THD *thd, Item **value,
711-
Item **cache_item,
712-
Item_result type)
712+
static Item** cache_converted_constant(THD *thd, Item **value,
713+
Item **cache_item, Item_result type)
713714
{
714715
/*
715716
Don't need cache if doing context analysis only.

sql/item_cmpfunc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ class Arg_comparator: public Sql_alloc
113113
int compare_e_json_str();
114114
int compare_e_str_json();
115115

116-
Item** cache_converted_constant(THD *thd, Item **value, Item **cache,
117-
Item_result type);
118116
static arg_cmp_func comparator_matrix [6][2];
119117
inline bool is_owner_equal_func()
120118
{
@@ -1069,7 +1067,7 @@ class Item_func_nullif :public Item_func_hybrid_field_type
10691067
The left "a" is in a comparison and can be replaced by:
10701068
- Item_func::convert_const_compared_to_int_field()
10711069
- agg_item_set_converter() in set_cmp_func()
1072-
- Arg_comparator::cache_converted_constant() in set_cmp_func()
1070+
- cache_converted_constant() in set_cmp_func()
10731071
10741072
Both "a"s are subject to equal fields propagation and can be replaced by:
10751073
- Item_field::propagate_equal_fields(ANY_SUBST) for the left "a"

0 commit comments

Comments
 (0)