~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

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