Commit 0736cddb authored by Alexander Barkov's avatar Alexander Barkov

Field_num::get_equal_const_item() appeared to be in a wrong file (item.cc).

Moving to field.cc.
parent 4be6eee8
......@@ -1402,6 +1402,25 @@ Item *Field_num::convert_zerofill_number_to_string(THD *thd, Item *item) const
}
Item *Field_num::get_equal_const_item(THD *thd, const Context &ctx,
Item_field *field_item,
Item *const_item)
{
DBUG_ASSERT(const_item->const_item());
if ((flags & ZEROFILL_FLAG) && IS_NUM(type()))
{
if (ctx.subst_constraint() == IDENTITY_SUBST)
return convert_zerofill_number_to_string(thd, const_item);
else
{
DBUG_ASSERT(ctx.compare_type() != STRING_RESULT);
return field_item;
}
}
return const_item;
}
/**
Test if given number is a int.
......
......@@ -5370,25 +5370,6 @@ Item *Item_field::propagate_equal_fields(THD *thd,
}
Item *Field_num::get_equal_const_item(THD *thd, const Context &ctx,
Item_field *field_item,
Item *const_item)
{
DBUG_ASSERT(const_item->const_item());
if ((flags & ZEROFILL_FLAG) && IS_NUM(type()))
{
if (ctx.subst_constraint() == IDENTITY_SUBST)
return convert_zerofill_number_to_string(thd, const_item);
else
{
DBUG_ASSERT(ctx.compare_type() != STRING_RESULT);
return field_item;
}
}
return const_item;
}
/**
Mark the item to not be part of substitution if it's not a binary item.
......
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