~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.cc

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include <config.h>
 
22
#include "config.h"
23
23
 
24
24
#include <float.h>
25
25
#include <math.h>
30
30
#include <drizzled/error.h>
31
31
#include <drizzled/table.h>
32
32
#include <drizzled/session.h>
33
 
#include <drizzled/current_session.h>
34
 
#include <drizzled/internal/m_string.h>
 
33
#include "drizzled/internal/m_string.h"
35
34
 
36
35
using namespace std;
37
36
 
84
83
                             (double) nr);
85
84
}
86
85
 
87
 
double Field_double::val_real(void) const
 
86
double Field_double::val_real(void)
88
87
{
89
88
  double j;
90
89
 
101
100
  return j;
102
101
}
103
102
 
104
 
int64_t Field_double::val_int(void) const
 
103
int64_t Field_double::val_int(void)
105
104
{
106
105
  double j;
107
106
  int64_t res;
134
133
    char buf[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
135
134
    String tmp(buf, sizeof(buf), &my_charset_utf8_general_ci), *str;
136
135
    str= val_str(&tmp, &tmp);
137
 
    Session *session= getTable() ? getTable()->in_use : current_session;
138
 
    push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
136
    push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
139
137
                        ER_TRUNCATED_WRONG_VALUE,
140
138
                        ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
141
139
                        str->c_ptr());
144
142
}
145
143
 
146
144
 
147
 
String *Field_double::val_str(String *val_buffer, String *) const
 
145
String *Field_double::val_str(String *val_buffer,
 
146
                              String *)
148
147
{
149
148
  double nr;
150
149