Commit 6e781e11 authored by unknown's avatar unknown
Browse files

A fix according to Monty's request:

"uint *errors" is now a non-optional parameter in String:copy()
and copy_and_convert().

parent fcb32227
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -531,7 +531,8 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs)
  /* Convert character set if the old one is multi byte */
  if (cs->mbmaxlen > 1)
  { 
    tmp.copy(from, len, cs, &my_charset_bin);
    uint dummy_errors;
    tmp.copy(from, len, cs, &my_charset_bin, &dummy_errors);
    from= tmp.ptr();
    len=  tmp.length();
  }
@@ -5502,7 +5503,8 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
  /* Convert character set if nesessary */
  if (String::needs_conversion(length, cs, field_charset, &not_used))
  { 
    tmpstr.copy(from, length, cs, field_charset);
    uint dummy_errors;
    tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
    from= tmpstr.ptr();
    length=  tmpstr.length();
  }
@@ -5650,10 +5652,11 @@ void Field_enum::sql_type(String &res) const
  bool flag=0;
  for (const char **pos= typelib->type_names; *pos; pos++)
  {
    uint dummy_errors;
    if (flag)
      res.append(',');
    /* convert to res.charset() == utf8, then quote */
    enum_item.copy(*pos, strlen(*pos), charset(), res.charset());
    enum_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors);
    append_unescaped(&res, enum_item.ptr(), enum_item.length());
    flag= 1;
  }
@@ -5684,7 +5687,8 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs)
  /* Convert character set if nesessary */
  if (String::needs_conversion(length, cs, field_charset, &not_used_offset))
  { 
    tmpstr.copy(from, length, cs, field_charset);
    uint dummy_errors;
    tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
    from= tmpstr.ptr();
    length=  tmpstr.length();
  }
@@ -5760,10 +5764,11 @@ void Field_set::sql_type(String &res) const
  bool flag=0;
  for (const char **pos= typelib->type_names; *pos; pos++)
  {
    uint dummy_errors;
    if (flag)
      res.append(',');
    /* convert to res.charset() == utf8, then quote */
    set_item.copy(*pos, strlen(*pos), charset(), res.charset());
    set_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors);
    append_unescaped(&res, set_item.ptr(), set_item.length());
    flag= 1;
  }
+3 −1
Original line number Diff line number Diff line
@@ -818,7 +818,9 @@ bool Item_param::set_str(const char *str, ulong length)
    Assign string with no conversion: data is converted only after it's
    been written to the binary log.
  */
  if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin))
  uint dummy_errors;
  if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin,
                     &dummy_errors))
    DBUG_RETURN(TRUE);
  state= STRING_VALUE;
  maybe_null= 0;
+2 −1
Original line number Diff line number Diff line
@@ -1832,8 +1832,9 @@ void Item_func_in::fix_length_and_dec()
        {
          Item_string *conv;
          String tmp, cstr, *ostr= arg[0]->val_str(&tmp);
          uint dummy_errors;
          cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(),
                    cmp_collation.collation);
                    cmp_collation.collation, &dummy_errors);
          conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(),
                                arg[0]->collation.derivation);
          conv->str_value.copy();
+4 −1
Original line number Diff line number Diff line
@@ -377,7 +377,10 @@ Item *create_func_space(Item *a)
  {
    sp= new Item_string("",0,cs);
    if (sp)
      sp->str_value.copy(" ",1,&my_charset_latin1,cs);
    {
      uint dummy_errors;
      sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors);
    }
  }
  else
  {
+2 −1
Original line number Diff line number Diff line
@@ -2906,8 +2906,9 @@ void Item_func_match::init_search(bool no_order)

  if (ft_tmp->charset() != cmp_collation.collation)
  {
    uint dummy_errors;
    search_value.copy(ft_tmp->ptr(), ft_tmp->length(), ft_tmp->charset(),
                      cmp_collation.collation);
                      cmp_collation.collation, &dummy_errors);
    ft_tmp= &search_value;
  }

Loading