~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

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
 
47
45
  max_length = args[0]->max_length*conv_charset->mbmaxlen;
48
46
}
49
47
 
50
 
void Item_func_conv_charset::print(String *str, enum_query_type query_type)
 
48
void Item_func_conv_charset::print(String *str)
51
49
{
52
50
  str->append(STRING_WITH_LEN("convert("));
53
 
  args[0]->print(str, query_type);
 
51
  args[0]->print(str);
54
52
  str->append(STRING_WITH_LEN(" using "));
55
53
  str->append(conv_charset->csname);
56
54
  str->append(')');