~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/conv_charset.h

  • Committer: Mark Atwood
  • Date: 2011-05-09 00:03:05 UTC
  • mfrom: (2281.4.17 prune2)
  • Revision ID: me@mark.atwood.name-20110509000305-dilr9ms7n7p1dmnk
merge lp:~olafvdspek/drizzle/prune remove tztime

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <drizzled/function/str/strfunc.h>
23
23
 
24
 
namespace drizzled
25
 
{
 
24
namespace drizzled {
26
25
 
27
26
class Item_func_conv_charset :public Item_str_func
28
27
{
41
40
    {
42
41
      size_t errors= 0;
43
42
      String tmp, *str= args[0]->val_str(&tmp);
44
 
      if (!str || str_value.copy(str->ptr(), str->length(),
45
 
                                 str->charset(), conv_charset, &errors))
 
43
      if (!str)
46
44
        null_value= 1;
 
45
      else
 
46
        str_value.copy(str->ptr(), str->length(), str->charset(), conv_charset, &errors);
47
47
      use_cached_value= 1;
48
48
      str_value.mark_as_const();
49
49
      safe= (errors == 0);
50
50
    }
51
51
    else
52
52
    {
53
 
      use_cached_value= 0;
 
53
      use_cached_value= false;
54
54
      /*
55
55
        Conversion from and to "binary" is safe.
56
56
        Conversion to Unicode is safe.