~clint-fewbar/drizzle/regex-policy-cache-limiter

« back to all changes in this revision

Viewing changes to drizzled/item/num.cc

  • Committer: Clint Byrum
  • Date: 2012-03-15 18:05:43 UTC
  • mfrom: (2224.1.302 workspace)
  • Revision ID: clint@ubuntu.com-20120315180543-9jxxm4q10k3np2ws
merging with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/item/string.h>
25
25
#include <drizzled/item/decimal.h>
26
26
 
27
 
namespace drizzled
28
 
{
 
27
namespace drizzled {
29
28
 
30
29
/**
31
30
  @details
38
37
  the latter returns a non-fixed Item, so val_str() crashes afterwards.
39
38
  Override Item_num method, to return a fixed item.
40
39
*/
41
 
Item *Item_num::safe_charset_converter(const CHARSET_INFO * const)
 
40
Item *Item_num::safe_charset_converter(const charset_info_st*)
42
41
{
43
 
  Item_string *conv;
44
42
  char buf[64];
45
 
  String *s, tmp(buf, sizeof(buf), &my_charset_bin);
46
 
  s= val_str(&tmp);
47
 
  if ((conv= new Item_string(s->ptr(), s->length(), s->charset())))
48
 
  {
49
 
    conv->str_value.copy();
50
 
    conv->str_value.mark_as_const();
51
 
  }
 
43
  String tmp(buf, sizeof(buf), &my_charset_bin);
 
44
  String* s= val_str(&tmp);
 
45
  Item_string* conv= new Item_string(s->ptr(), s->length(), s->charset());
 
46
  conv->str_value.copy();
 
47
  conv->str_value.mark_as_const();
52
48
  return conv;
53
49
}
54
50