~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/str.cc

  • Committer: Patrick Crews
  • Date: 2010-12-07 20:02:50 UTC
  • Revision ID: gleebix@gmail.com-20101207200250-6a27jgqalgw5bsb5
Added disabled.def file to disable drizzleslap due to Bug#684269.  Need to skip for tarball release this round

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
    !=0  error
103
103
*/
104
104
 
105
 
int Field_str::store_decimal(const type::Decimal *d)
 
105
int Field_str::store_decimal(const my_decimal *d)
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
  my_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)
 
113
my_decimal *Field_str::val_decimal(my_decimal *decimal_value)
114
114
{
115
115
  int64_t nr= val_int();
116
 
  int2_class_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value);
 
116
  int2my_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value);
117
117
  return decimal_value;
118
118
}
119
119
 
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())
141
 
    {
 
140
    if (getTable()->in_use->abort_on_warning)
142
141
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
143
 
    }
144
142
    else
145
 
    {
146
143
      set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
147
 
    }
148
144
  }
149
145
  return store(buff, length, charset());
150
146
}
199
195
  }
200
196
  *t= '\0';
201
197
  push_warning_printf(field->getTable()->in_use,
202
 
                      field->getTable()->in_use->abortOnWarning() ?
 
198
                      field->getTable()->in_use->abort_on_warning ?
203
199
                      DRIZZLE_ERROR::WARN_LEVEL_ERROR :
204
200
                      DRIZZLE_ERROR::WARN_LEVEL_WARN,
205
201
                      ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,