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

« back to all changes in this revision

Viewing changes to drizzled/item/float.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:
27
27
#include <drizzled/item/num.h>
28
28
#include <drizzled/item/string.h>
29
29
 
30
 
namespace drizzled
31
 
{
 
30
namespace drizzled {
32
31
 
33
 
extern const CHARSET_INFO *system_charset_info;
 
32
extern const charset_info_st *system_charset_info;
34
33
 
35
34
static uint32_t nr_of_decimals(const char *str, const char *end)
36
35
{
47
46
      break;
48
47
  }
49
48
  decimal_point= str;
50
 
  for (; my_isdigit(system_charset_info, *str) ; str++)
 
49
  for (; system_charset_info->isdigit(*str) ; str++)
51
50
    ;
52
51
  if (*str == 'e' || *str == 'E')
53
52
    return NOT_FIXED_DEC;
125
124
{
126
125
  if (presentation)
127
126
  {
128
 
    str->append(presentation);
 
127
    str->append(presentation, strlen(presentation));
129
128
    return;
130
129
  }
131
130
  char buffer[20];
154
153
  return false;
155
154
}
156
155
 
157
 
Item *Item_static_float_func::safe_charset_converter(const CHARSET_INFO * const)
 
156
Item *Item_static_float_func::safe_charset_converter(const charset_info_st*)
158
157
{
159
 
  Item_string *conv;
160
158
  char buf[64];
161
 
  String *s, tmp(buf, sizeof(buf), &my_charset_bin);
162
 
  s= val_str(&tmp);
163
 
  if ((conv= new Item_static_string_func(func_name, s->ptr(), s->length(),
164
 
                                         s->charset())))
165
 
  {
166
 
    conv->str_value.copy();
167
 
    conv->str_value.mark_as_const();
168
 
  }
 
159
  String tmp(buf, sizeof(buf), &my_charset_bin);
 
160
  String* s= val_str(&tmp);
 
161
  Item_string* conv= new Item_static_string_func(func_name, *s, s->charset());
 
162
  conv->str_value.copy();
 
163
  conv->str_value.mark_as_const();
169
164
  return conv;
170
165
}
171
166