~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/str.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
#include <drizzled/field/str.h>
24
24
#include <drizzled/error.h>
25
25
#include <drizzled/table.h>
26
26
#include <drizzled/session.h>
27
 
#include <drizzled/internal/m_string.h>
 
27
#include "drizzled/internal/m_string.h"
28
28
 
29
29
namespace drizzled
30
30
{
106
106
{
107
107
  char buff[DECIMAL_MAX_STR_LENGTH+1];
108
108
  String str(buff, sizeof(buff), &my_charset_bin);
109
 
  class_decimal2string(d, 0, &str);
 
109
  class_decimal2string(E_DEC_FATAL_ERROR, d, 0, 0, 0, &str);
110
110
  return store(str.ptr(), str.length(), str.charset());
111
111
}
112
112
 
113
 
type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value) const
 
113
type::Decimal *Field_str::val_decimal(type::Decimal *decimal_value)
114
114
{
115
115
  int64_t nr= val_int();
116
116
  int2_class_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value);
137
137
  length= internal::my_gcvt(nr, internal::MY_GCVT_ARG_DOUBLE, local_char_length, buff, &error);
138
138
  if (error)
139
139
  {
140
 
    if (getTable()->getSession()->abortOnWarning())
 
140
    if (getTable()->in_use->abort_on_warning)
141
141
    {
142
142
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
143
143
    }
199
199
  }
200
200
  *t= '\0';
201
201
  push_warning_printf(field->getTable()->in_use,
202
 
                      field->getTable()->in_use->abortOnWarning() ?
 
202
                      field->getTable()->in_use->abort_on_warning ?
203
203
                      DRIZZLE_ERROR::WARN_LEVEL_ERROR :
204
204
                      DRIZZLE_ERROR::WARN_LEVEL_WARN,
205
205
                      ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,