bool Item_param::set_str(const char *str, ulong length,
                         CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
  DBUG_ENTER("Item_param::set_str");
  DBUG_ASSERT(value.type_handler()->cmp_type() == STRING_RESULT);
  /*
    Assign string with no conversion: data is converted only after it's
    been written to the binary log.
  */
  uint dummy_errors;
  if (unlikely(value.m_string.copy(str, length, fromcs, tocs, &dummy_errors)))
    DBUG_RETURN(TRUE);
  /*
    Set str_value_ptr to make sure it's in sync with str_value.
    This is needed in case if we're called from Item_param::set_value(),
    from the code responsible for setting OUT parameters in
    sp_head::execute_procedure(). This makes sure that
    Protocol_binary::send_out_parameters() later gets a valid value
    from Item_param::val_str().
    Note, for IN parameters, Item_param::convert_str_value() will be called
    later, which will convert the value from the client character set to the
    connection character set, and will reset both str_value and str_value_ptr.
  */
  value.m_string_ptr.set(value.m_string.ptr(),
                         value.m_string.length(),
                         value.m_string.charset());
  state= SHORT_DATA_VALUE;
  collation.set(tocs, DERIVATION_COERCIBLE);
  max_length= length;
  maybe_null= 0;
  null_value= 0;
  /* max_length and decimals are set after charset conversion */
  /* sic: str may be not null-terminated, don't add DBUG_PRINT here */
  fix_type(Item::STRING_ITEM);
  DBUG_RETURN(FALSE);
}
bool Item_param::set_str(const char *str, ulong length,
                         CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
  DBUG_ENTER("Item_param::set_str");
  DBUG_ASSERT(value.type_handler()->cmp_type() == STRING_RESULT);
   
  uint dummy_errors;
  if (unlikely(value.m_string.copy(str, length, fromcs, tocs, &dummy_errors)))
    DBUG_RETURN(TRUE);
   
  value.m_string_ptr.set(value.m_string.ptr(),
                         value.m_string.length(),
                         value.m_string.charset());
  state= SHORT_DATA_VALUE;
  collation.set(tocs, DERIVATION_COERCIBLE);
  max_length= length;
  maybe_null= 0;
  null_value= 0;
   
   
  fix_type(Item::STRING_ITEM);
  DBUG_RETURN(FALSE);
}