Skip to content

Commit 100d77e

Browse files
author
Alexander Barkov
committed
Clean-up: removing the unused "Item_result cmp_type" parameter from the methods:
- Item_bool_func::get_func_mm_tree() - Item_bool_func::get_mm_parts() - Item_bool_func::get_ne_mm_tree()
1 parent 322bc6e commit 100d77e

File tree

2 files changed

+32
-47
lines changed

2 files changed

+32
-47
lines changed

sql/item_cmpfunc.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,10 @@ class Item_bool_func :public Item_int_func
139139
@param param PARAM from SQL_SELECT::test_quick_select
140140
@param field field in the predicate
141141
@param value constant in the predicate
142-
@param cmp_type compare type for the field
143142
@return Pointer to the tree built tree
144143
*/
145144
virtual SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
146-
Field *field, Item *value,
147-
Item_result cmp_type)
145+
Field *field, Item *value)
148146
{
149147
DBUG_ENTER("Item_bool_func2::get_func_mm_tree");
150148
DBUG_ASSERT(0);
@@ -153,11 +151,9 @@ class Item_bool_func :public Item_int_func
153151
SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
154152
Item_field *field_item, Item *value);
155153
SEL_TREE *get_mm_parts(RANGE_OPT_PARAM *param, Field *field,
156-
Item_func::Functype type,
157-
Item *value, Item_result cmp_type);
154+
Item_func::Functype type, Item *value);
158155
SEL_TREE *get_ne_mm_tree(RANGE_OPT_PARAM *param,
159-
Field *field, Item *lt_value, Item *gt_value,
160-
Item_result cmp_type);
156+
Field *field, Item *lt_value, Item *gt_value);
161157
virtual SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
162158
KEY_PART *key_part,
163159
Item_func::Functype type, Item *value);
@@ -334,7 +330,7 @@ class Item_bool_func2 :public Item_bool_func
334330
uint *and_level, table_map usable_tables,
335331
SARGABLE_PARAM **sargables, bool equal_func);
336332
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
337-
Field *field, Item *value, Item_result cmp_type)
333+
Field *field, Item *value)
338334
{
339335
DBUG_ENTER("Item_bool_func2::get_func_mm_tree");
340336
/*
@@ -346,7 +342,7 @@ class Item_bool_func2 :public Item_bool_func
346342
*/
347343
Item_func::Functype func_type=
348344
(value != arguments()[0]) ? functype() : rev_functype();
349-
DBUG_RETURN(get_mm_parts(param, field, func_type, value, cmp_type));
345+
DBUG_RETURN(get_mm_parts(param, field, func_type, value));
350346
}
351347
public:
352348
Item_bool_func2(THD *thd, Item *a, Item *b):
@@ -664,10 +660,10 @@ class Item_func_ne :public Item_bool_rowready_func2
664660
{
665661
protected:
666662
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
667-
Field *field, Item *value, Item_result cmp_type)
663+
Field *field, Item *value)
668664
{
669665
DBUG_ENTER("Item_func_ne::get_func_mm_tree");
670-
DBUG_RETURN(get_ne_mm_tree(param, field, value, value, cmp_type));
666+
DBUG_RETURN(get_ne_mm_tree(param, field, value, value));
671667
}
672668
public:
673669
Item_func_ne(THD *thd, Item *a, Item *b):
@@ -731,7 +727,7 @@ class Item_func_between :public Item_func_opt_neg
731727
{
732728
protected:
733729
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
734-
Field *field, Item *value, Item_result cmp_type);
730+
Field *field, Item *value);
735731
public:
736732
String value0,value1,value2;
737733
/* TRUE <=> arguments will be compared as dates. */
@@ -1384,7 +1380,7 @@ class Item_func_in :public Item_func_opt_neg
13841380
{
13851381
protected:
13861382
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
1387-
Field *field, Item *value, Item_result cmp_type);
1383+
Field *field, Item *value);
13881384
public:
13891385
/*
13901386
an array of values when the right hand arguments of IN
@@ -1487,10 +1483,10 @@ class Item_func_null_predicate :public Item_bool_func
14871483
{
14881484
protected:
14891485
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
1490-
Field *field, Item *value, Item_result cmp_type)
1486+
Field *field, Item *value)
14911487
{
14921488
DBUG_ENTER("Item_func_null_predicate::get_func_mm_tree");
1493-
DBUG_RETURN(get_mm_parts(param, field, functype(), value, cmp_type));
1489+
DBUG_RETURN(get_mm_parts(param, field, functype(), value));
14941490
}
14951491
SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
14961492
KEY_PART *key_part,

sql/opt_range.cc

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6965,7 +6965,6 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
69656965
field field in the predicate
69666966
lt_value constant that field should be smaller
69676967
gt_value constant that field should be greaterr
6968-
cmp_type compare type for the field
69696968
69706969
RETURN
69716970
# Pointer to tree built tree
@@ -6974,38 +6973,36 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
69746973

69756974
SEL_TREE *Item_bool_func::get_ne_mm_tree(RANGE_OPT_PARAM *param,
69766975
Field *field,
6977-
Item *lt_value, Item *gt_value,
6978-
Item_result cmp_type)
6976+
Item *lt_value, Item *gt_value)
69796977
{
69806978
SEL_TREE *tree;
6981-
tree= get_mm_parts(param, field, Item_func::LT_FUNC, lt_value, cmp_type);
6979+
tree= get_mm_parts(param, field, Item_func::LT_FUNC, lt_value);
69826980
if (tree)
69836981
tree= tree_or(param, tree, get_mm_parts(param, field, Item_func::GT_FUNC,
6984-
gt_value, cmp_type));
6982+
gt_value));
69856983
return tree;
69866984
}
69876985

69886986

69896987
SEL_TREE *Item_func_between::get_func_mm_tree(RANGE_OPT_PARAM *param,
6990-
Field *field, Item *value,
6991-
Item_result cmp_type)
6988+
Field *field, Item *value)
69926989
{
69936990
SEL_TREE *tree;
69946991
DBUG_ENTER("Item_func_between::get_func_mm_tree");
69956992
if (!value)
69966993
{
69976994
if (negated)
69986995
{
6999-
tree= get_ne_mm_tree(param, field, args[1], args[2], cmp_type);
6996+
tree= get_ne_mm_tree(param, field, args[1], args[2]);
70006997
}
70016998
else
70026999
{
7003-
tree= get_mm_parts(param, field, Item_func::GE_FUNC, args[1], cmp_type);
7000+
tree= get_mm_parts(param, field, Item_func::GE_FUNC, args[1]);
70047001
if (tree)
70057002
{
70067003
tree= tree_and(param, tree, get_mm_parts(param, field,
70077004
Item_func::LE_FUNC,
7008-
args[2], cmp_type));
7005+
args[2]));
70097006
}
70107007
}
70117008
}
@@ -7017,18 +7014,17 @@ SEL_TREE *Item_func_between::get_func_mm_tree(RANGE_OPT_PARAM *param,
70177014
Item_func::LT_FUNC):
70187015
(value == (Item*)1 ? Item_func::LE_FUNC :
70197016
Item_func::GE_FUNC)),
7020-
args[0], cmp_type);
7017+
args[0]);
70217018
}
70227019
DBUG_RETURN(tree);
70237020
}
70247021

70257022

70267023
SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
7027-
Field *field, Item *value,
7028-
Item_result cmp_type)
7024+
Field *field, Item *value)
70297025
{
70307026
SEL_TREE *tree= 0;
7031-
DBUG_ENTER("Iten_func_in::get_func_mm_tree");
7027+
DBUG_ENTER("Item_func_in::get_func_mm_tree");
70327028
/*
70337029
Array for IN() is constructed when all values have the same result
70347030
type. Tree won't be built for values with different result types,
@@ -7090,8 +7086,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
70907086
do
70917087
{
70927088
array->value_to_item(i, value_item);
7093-
tree= get_mm_parts(param, field, Item_func::LT_FUNC,
7094-
value_item, cmp_type);
7089+
tree= get_mm_parts(param, field, Item_func::LT_FUNC, value_item);
70957090
if (!tree)
70967091
break;
70977092
i++;
@@ -7109,8 +7104,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
71097104
{
71107105
/* Get a SEL_TREE for "-inf < X < c_i" interval */
71117106
array->value_to_item(i, value_item);
7112-
tree2= get_mm_parts(param, field, Item_func::LT_FUNC,
7113-
value_item, cmp_type);
7107+
tree2= get_mm_parts(param, field, Item_func::LT_FUNC, value_item);
71147108
if (!tree2)
71157109
{
71167110
tree= NULL;
@@ -7171,37 +7165,35 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
71717165
Get the SEL_TREE for the last "c_last < X < +inf" interval
71727166
(value_item cotains c_last already)
71737167
*/
7174-
tree2= get_mm_parts(param, field, Item_func::GT_FUNC,
7175-
value_item, cmp_type);
7168+
tree2= get_mm_parts(param, field, Item_func::GT_FUNC, value_item);
71767169
tree= tree_or(param, tree, tree2);
71777170
}
71787171
}
71797172
else
71807173
{
7181-
tree= get_ne_mm_tree(param, field, args[1], args[1], cmp_type);
7174+
tree= get_ne_mm_tree(param, field, args[1], args[1]);
71827175
if (tree)
71837176
{
71847177
Item **arg, **end;
71857178
for (arg= args + 2, end= arg + arg_count - 2; arg < end ; arg++)
71867179
{
71877180
tree= tree_and(param, tree, get_ne_mm_tree(param, field,
7188-
*arg, *arg, cmp_type));
7181+
*arg, *arg));
71897182
}
71907183
}
71917184
}
71927185
}
71937186
else
71947187
{
7195-
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, args[1], cmp_type);
7188+
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, args[1]);
71967189
if (tree)
71977190
{
71987191
Item **arg, **end;
71997192
for (arg= args + 2, end= arg + arg_count - 2;
72007193
arg < end ; arg++)
72017194
{
72027195
tree= tree_or(param, tree, get_mm_parts(param, field,
7203-
Item_func::EQ_FUNC,
7204-
*arg, cmp_type));
7196+
Item_func::EQ_FUNC, *arg));
72057197
}
72067198
}
72077199
}
@@ -7304,9 +7296,8 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
73047296
ref_tables|= arg->used_tables();
73057297
}
73067298
Field *field= field_item->field;
7307-
Item_result cmp_type= field->cmp_type();
73087299
if (!((ref_tables | field->table->map) & param_comp))
7309-
ftree= get_func_mm_tree(param, field, value, cmp_type);
7300+
ftree= get_func_mm_tree(param, field, value);
73107301
Item_equal *item_equal= field_item->item_equal;
73117302
if (item_equal)
73127303
{
@@ -7318,7 +7309,7 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
73187309
continue;
73197310
if (!((ref_tables | f->table->map) & param_comp))
73207311
{
7321-
tree= get_func_mm_tree(param, f, value, cmp_type);
7312+
tree= get_func_mm_tree(param, f, value);
73227313
ftree= !ftree ? tree : tree_and(param, ftree, tree);
73237314
}
73247315
}
@@ -7562,8 +7553,7 @@ SEL_TREE *Item_equal::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
75627553
Field *field= it.get_curr_field();
75637554
if (!((ref_tables | field->table->map) & param_comp))
75647555
{
7565-
tree= get_mm_parts(param, field, Item_func::EQ_FUNC,
7566-
value, field->cmp_type());
7556+
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, value);
75677557
ftree= !ftree ? tree : tree_and(param, ftree, tree);
75687558
}
75697559
}
@@ -7645,8 +7635,7 @@ SEL_TREE *Item_bool_func2::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
76457635

76467636
SEL_TREE *
76477637
Item_bool_func::get_mm_parts(RANGE_OPT_PARAM *param, Field *field,
7648-
Item_func::Functype type,
7649-
Item *value, Item_result cmp_type)
7638+
Item_func::Functype type, Item *value)
76507639
{
76517640
DBUG_ENTER("get_mm_parts");
76527641
if (field->table != param->table)

0 commit comments

Comments
 (0)