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