Commit 100d77e6 authored by Alexander Barkov's avatar Alexander Barkov

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()
parent 322bc6e8
......@@ -139,12 +139,10 @@ protected:
@param param PARAM from SQL_SELECT::test_quick_select
@param field field in the predicate
@param value constant in the predicate
@param cmp_type compare type for the field
@return Pointer to the tree built tree
*/
virtual SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value,
Item_result cmp_type)
Field *field, Item *value)
{
DBUG_ENTER("Item_bool_func2::get_func_mm_tree");
DBUG_ASSERT(0);
......@@ -153,11 +151,9 @@ protected:
SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
Item_field *field_item, Item *value);
SEL_TREE *get_mm_parts(RANGE_OPT_PARAM *param, Field *field,
Item_func::Functype type,
Item *value, Item_result cmp_type);
Item_func::Functype type, Item *value);
SEL_TREE *get_ne_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *lt_value, Item *gt_value,
Item_result cmp_type);
Field *field, Item *lt_value, Item *gt_value);
virtual SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
KEY_PART *key_part,
Item_func::Functype type, Item *value);
......@@ -334,7 +330,7 @@ protected:
uint *and_level, table_map usable_tables,
SARGABLE_PARAM **sargables, bool equal_func);
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value, Item_result cmp_type)
Field *field, Item *value)
{
DBUG_ENTER("Item_bool_func2::get_func_mm_tree");
/*
......@@ -346,7 +342,7 @@ protected:
*/
Item_func::Functype func_type=
(value != arguments()[0]) ? functype() : rev_functype();
DBUG_RETURN(get_mm_parts(param, field, func_type, value, cmp_type));
DBUG_RETURN(get_mm_parts(param, field, func_type, value));
}
public:
Item_bool_func2(THD *thd, Item *a, Item *b):
......@@ -664,10 +660,10 @@ class Item_func_ne :public Item_bool_rowready_func2
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value, Item_result cmp_type)
Field *field, Item *value)
{
DBUG_ENTER("Item_func_ne::get_func_mm_tree");
DBUG_RETURN(get_ne_mm_tree(param, field, value, value, cmp_type));
DBUG_RETURN(get_ne_mm_tree(param, field, value, value));
}
public:
Item_func_ne(THD *thd, Item *a, Item *b):
......@@ -731,7 +727,7 @@ class Item_func_between :public Item_func_opt_neg
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value, Item_result cmp_type);
Field *field, Item *value);
public:
String value0,value1,value2;
/* TRUE <=> arguments will be compared as dates. */
......@@ -1384,7 +1380,7 @@ class Item_func_in :public Item_func_opt_neg
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value, Item_result cmp_type);
Field *field, Item *value);
public:
/*
an array of values when the right hand arguments of IN
......@@ -1487,10 +1483,10 @@ class Item_func_null_predicate :public Item_bool_func
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value, Item_result cmp_type)
Field *field, Item *value)
{
DBUG_ENTER("Item_func_null_predicate::get_func_mm_tree");
DBUG_RETURN(get_mm_parts(param, field, functype(), value, cmp_type));
DBUG_RETURN(get_mm_parts(param, field, functype(), value));
}
SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
KEY_PART *key_part,
......
......@@ -6965,7 +6965,6 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
field field in the predicate
lt_value constant that field should be smaller
gt_value constant that field should be greaterr
cmp_type compare type for the field
RETURN
# Pointer to tree built tree
......@@ -6974,21 +6973,19 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
SEL_TREE *Item_bool_func::get_ne_mm_tree(RANGE_OPT_PARAM *param,
Field *field,
Item *lt_value, Item *gt_value,
Item_result cmp_type)
Item *lt_value, Item *gt_value)
{
SEL_TREE *tree;
tree= get_mm_parts(param, field, Item_func::LT_FUNC, lt_value, cmp_type);
tree= get_mm_parts(param, field, Item_func::LT_FUNC, lt_value);
if (tree)
tree= tree_or(param, tree, get_mm_parts(param, field, Item_func::GT_FUNC,
gt_value, cmp_type));
gt_value));
return tree;
}
SEL_TREE *Item_func_between::get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value,
Item_result cmp_type)
Field *field, Item *value)
{
SEL_TREE *tree;
DBUG_ENTER("Item_func_between::get_func_mm_tree");
......@@ -6996,16 +6993,16 @@ SEL_TREE *Item_func_between::get_func_mm_tree(RANGE_OPT_PARAM *param,
{
if (negated)
{
tree= get_ne_mm_tree(param, field, args[1], args[2], cmp_type);
tree= get_ne_mm_tree(param, field, args[1], args[2]);
}
else
{
tree= get_mm_parts(param, field, Item_func::GE_FUNC, args[1], cmp_type);
tree= get_mm_parts(param, field, Item_func::GE_FUNC, args[1]);
if (tree)
{
tree= tree_and(param, tree, get_mm_parts(param, field,
Item_func::LE_FUNC,
args[2], cmp_type));
args[2]));
}
}
}
......@@ -7017,18 +7014,17 @@ SEL_TREE *Item_func_between::get_func_mm_tree(RANGE_OPT_PARAM *param,
Item_func::LT_FUNC):
(value == (Item*)1 ? Item_func::LE_FUNC :
Item_func::GE_FUNC)),
args[0], cmp_type);
args[0]);
}
DBUG_RETURN(tree);
}
SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value,
Item_result cmp_type)
Field *field, Item *value)
{
SEL_TREE *tree= 0;
DBUG_ENTER("Iten_func_in::get_func_mm_tree");
DBUG_ENTER("Item_func_in::get_func_mm_tree");
/*
Array for IN() is constructed when all values have the same result
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,
do
{
array->value_to_item(i, value_item);
tree= get_mm_parts(param, field, Item_func::LT_FUNC,
value_item, cmp_type);
tree= get_mm_parts(param, field, Item_func::LT_FUNC, value_item);
if (!tree)
break;
i++;
......@@ -7109,8 +7104,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
{
/* Get a SEL_TREE for "-inf < X < c_i" interval */
array->value_to_item(i, value_item);
tree2= get_mm_parts(param, field, Item_func::LT_FUNC,
value_item, cmp_type);
tree2= get_mm_parts(param, field, Item_func::LT_FUNC, value_item);
if (!tree2)
{
tree= NULL;
......@@ -7171,28 +7165,27 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
Get the SEL_TREE for the last "c_last < X < +inf" interval
(value_item cotains c_last already)
*/
tree2= get_mm_parts(param, field, Item_func::GT_FUNC,
value_item, cmp_type);
tree2= get_mm_parts(param, field, Item_func::GT_FUNC, value_item);
tree= tree_or(param, tree, tree2);
}
}
else
{
tree= get_ne_mm_tree(param, field, args[1], args[1], cmp_type);
tree= get_ne_mm_tree(param, field, args[1], args[1]);
if (tree)
{
Item **arg, **end;
for (arg= args + 2, end= arg + arg_count - 2; arg < end ; arg++)
{
tree= tree_and(param, tree, get_ne_mm_tree(param, field,
*arg, *arg, cmp_type));
*arg, *arg));
}
}
}
}
else
{
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, args[1], cmp_type);
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, args[1]);
if (tree)
{
Item **arg, **end;
......@@ -7200,8 +7193,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param,
arg < end ; arg++)
{
tree= tree_or(param, tree, get_mm_parts(param, field,
Item_func::EQ_FUNC,
*arg, cmp_type));
Item_func::EQ_FUNC, *arg));
}
}
}
......@@ -7304,9 +7296,8 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
ref_tables|= arg->used_tables();
}
Field *field= field_item->field;
Item_result cmp_type= field->cmp_type();
if (!((ref_tables | field->table->map) & param_comp))
ftree= get_func_mm_tree(param, field, value, cmp_type);
ftree= get_func_mm_tree(param, field, value);
Item_equal *item_equal= field_item->item_equal;
if (item_equal)
{
......@@ -7318,7 +7309,7 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param,
continue;
if (!((ref_tables | f->table->map) & param_comp))
{
tree= get_func_mm_tree(param, f, value, cmp_type);
tree= get_func_mm_tree(param, f, value);
ftree= !ftree ? tree : tree_and(param, ftree, tree);
}
}
......@@ -7562,8 +7553,7 @@ SEL_TREE *Item_equal::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
Field *field= it.get_curr_field();
if (!((ref_tables | field->table->map) & param_comp))
{
tree= get_mm_parts(param, field, Item_func::EQ_FUNC,
value, field->cmp_type());
tree= get_mm_parts(param, field, Item_func::EQ_FUNC, value);
ftree= !ftree ? tree : tree_and(param, ftree, tree);
}
}
......@@ -7645,8 +7635,7 @@ SEL_TREE *Item_bool_func2::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
SEL_TREE *
Item_bool_func::get_mm_parts(RANGE_OPT_PARAM *param, Field *field,
Item_func::Functype type,
Item *value, Item_result cmp_type)
Item_func::Functype type, Item *value)
{
DBUG_ENTER("get_mm_parts");
if (field->table != param->table)
......
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