Item *Item_num::safe_charset_converter(THD *thd, CHARSET_INFO *tocs)
{
  /*
    Item_num returns pure ASCII result,
    so conversion is needed only in case of "tricky" character
    sets like UCS2. If tocs is not "tricky", return the item itself.
  */
  if (!(tocs->state & MY_CS_NONASCII))
    return this;
  
  Item *conv;
  if ((conv= const_charset_converter(thd, tocs, true)))
    conv->fix_char_length(max_char_length());
  return conv;
}
Item *Item_num::safe_charset_converter(THD *thd, CHARSET_INFO *tocs)
{
   
  if (!(tocs->state & MY_CS_NONASCII))
    return this;
  
  Item *conv;
  if ((conv= const_charset_converter(thd, tocs, true)))
    conv->fix_char_length(max_char_length());
  return conv;
}