Item_type_holder::Item_type_holder(THD *thd, Item *item)
  :Item(thd, item),
   Type_handler_hybrid_real_field_type(get_real_type(item)),
   enum_set_typelib(0),
   geometry_type(Field::GEOM_GEOMETRY)
{
  DBUG_ASSERT(item->fixed);
  maybe_null= item->maybe_null;
  collation.set(item->collation);
  get_full_info(item);
  /**
    Field::result_merge_type(real_field_type()) should be equal to
    result_type(), with one exception when "this" is a Item_field for
    a BIT field:
    - Field_bit::result_type() returns INT_RESULT, so does its Item_field.
    - Field::result_merge_type(MYSQL_TYPE_BIT) returns STRING_RESULT.
    Perhaps we need a new method in Type_handler to cover these type
    merging rules for UNION.
  */
  DBUG_ASSERT(real_field_type() == MYSQL_TYPE_BIT ||
              Item_type_holder::result_type()  ==
              Field::result_merge_type(Item_type_holder::real_field_type()));
  /* fix variable decimals which always is NOT_FIXED_DEC */
  if (Field::result_merge_type(real_field_type()) == INT_RESULT)
    decimals= 0;
  prev_decimal_int_part= item->decimal_int_part();
#ifdef HAVE_SPATIAL
  if (item->field_type() == MYSQL_TYPE_GEOMETRY)
    geometry_type= item->get_geometry_type();
#endif /* HAVE_SPATIAL */
}
Item_type_holder::Item_type_holder(THD *thd, Item *item)
  :Item(thd, item),
   Type_handler_hybrid_real_field_type(get_real_type(item)),
   enum_set_typelib(0),
   geometry_type(Field::GEOM_GEOMETRY)
{
  DBUG_ASSERT(item->fixed);
  maybe_null= item->maybe_null;
  collation.set(item->collation);
  get_full_info(item);
   
  DBUG_ASSERT(real_field_type() == MYSQL_TYPE_BIT ||
              Item_type_holder::result_type()  ==
              Field::result_merge_type(Item_type_holder::real_field_type()));
   
  if (Field::result_merge_type(real_field_type()) == INT_RESULT)
    decimals= 0;
  prev_decimal_int_part= item->decimal_int_part();
#ifdef HAVE_SPATIAL
  if (item->field_type() == MYSQL_TYPE_GEOMETRY)
    geometry_type= item->get_geometry_type();
#endif  
}