~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <drizzled/function/str/conv_charset.h>
23
23
 
24
 
namespace drizzled
25
 
{
 
24
namespace drizzled {
26
25
 
27
26
String *Item_func_conv_charset::val_str(String *str)
28
27
{
30
29
  if (use_cached_value)
31
30
    return null_value ? 0 : &str_value;
32
31
  String *arg= args[0]->val_str(str);
33
 
  size_t dummy_errors;
34
32
  if (!arg)
35
33
  {
36
34
    null_value=1;
37
35
    return 0;
38
36
  }
39
 
  null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(),
40
 
                             conv_charset, &dummy_errors);
 
37
  null_value= false;
 
38
  str_value.copy(arg->ptr(),arg->length(), conv_charset);
41
39
  return null_value ? 0 : check_well_formed_result(&str_value);
42
40
}
43
41
 
52
50
  str->append(STRING_WITH_LEN("convert("));
53
51
  args[0]->print(str);
54
52
  str->append(STRING_WITH_LEN(" using "));
55
 
  str->append(conv_charset->csname);
 
53
  str->append(conv_charset->csname, strlen(conv_charset->csname));
56
54
  str->append(')');
57
55
}
58
56