~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/float.cc

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
merge lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <config.h>
21
21
 
22
22
#include <math.h>
23
23
 
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
{
121
120
}
122
121
 
123
122
 
124
 
void Item_float::print(String *str, enum_query_type)
 
123
void Item_float::print(String *str)
125
124
{
126
125
  if (presentation)
127
126
  {
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->ptr(), s->length(), s->charset());
 
162
  conv->str_value.copy();
 
163
  conv->str_value.mark_as_const();
169
164
  return conv;
170
165
}
171
166