~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.cc

  • Committer: Brian Aker
  • Date: 2010-12-25 00:44:06 UTC
  • mto: This revision was merged to the branch mainline in revision 2031.
  • Revision ID: brian@tangent.org-20101225004406-4xna6p795yqkaony
Second pass through function names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
bool Field_decimal::store_value(const my_decimal *decimal_value)
126
126
{
127
 
  int error= my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
 
127
  int error= class_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
128
128
                                         decimal_value, ptr, precision, dec);
129
129
  if (warn_if_overflow(error))
130
130
  {
132
132
    {
133
133
      my_decimal buff;
134
134
      set_value_on_overflow(&buff, decimal_value->sign());
135
 
      my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec);
 
135
      class_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec);
136
136
    }
137
137
    error= 1;
138
138
  }
148
148
 
149
149
  ASSERT_COLUMN_MARKED_FOR_WRITE;
150
150
 
151
 
  if ((err= str2my_decimal(E_DEC_FATAL_ERROR &
 
151
  if ((err= str2_class_decimal(E_DEC_FATAL_ERROR &
152
152
                           ~(E_DEC_OVERFLOW | E_DEC_BAD_NUM),
153
153
                           from, length, charset_arg,
154
154
                           &decimal_value)) &&
200
200
 
201
201
/**
202
202
  @todo
203
 
  Fix following when double2my_decimal when double2decimal
 
203
  Fix following when double2_class_decimal when double2decimal
204
204
  will return E_DEC_TRUNCATED always correctly
205
205
*/
206
206
 
211
211
 
212
212
  ASSERT_COLUMN_MARKED_FOR_WRITE;
213
213
 
214
 
  err= double2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, nr,
 
214
  err= double2_class_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, nr,
215
215
                         &decimal_value);
216
216
  if (err)
217
217
  {
235
235
 
236
236
  ASSERT_COLUMN_MARKED_FOR_WRITE;
237
237
 
238
 
  if ((err= int2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
 
238
  if ((err= int2_class_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
239
239
                           nr, unsigned_val, &decimal_value)))
240
240
  {
241
241
    if (check_overflow(err))
261
261
                              enum enum_drizzle_timestamp_type )
262
262
{
263
263
  my_decimal decimal_value;
264
 
  return store_value(date2my_decimal(ltime, &decimal_value));
 
264
  return store_value(date2_class_decimal(ltime, &decimal_value));
265
265
}
266
266
 
267
267
 
272
272
 
273
273
  ASSERT_COLUMN_MARKED_FOR_READ;
274
274
 
275
 
  my_decimal2double(E_DEC_FATAL_ERROR, val_decimal(&decimal_value), &dbl);
 
275
  class_decimal2double(E_DEC_FATAL_ERROR, val_decimal(&decimal_value), &dbl);
276
276
 
277
277
  return dbl;
278
278
}
285
285
 
286
286
  ASSERT_COLUMN_MARKED_FOR_READ;
287
287
 
288
 
  my_decimal2int(E_DEC_FATAL_ERROR, val_decimal(&decimal_value), false, &i);
 
288
  class_decimal2int(E_DEC_FATAL_ERROR, val_decimal(&decimal_value), false, &i);
289
289
 
290
290
  return i;
291
291
}
295
295
{
296
296
  ASSERT_COLUMN_MARKED_FOR_READ;
297
297
 
298
 
  binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
 
298
  binary2_class_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
299
299
                    precision, dec);
300
300
  return(decimal_value);
301
301
}
309
309
  ASSERT_COLUMN_MARKED_FOR_READ;
310
310
 
311
311
  uint32_t fixed_precision= decimal_precision ? precision : 0;
312
 
  my_decimal2string(E_DEC_FATAL_ERROR, val_decimal(&decimal_value),
 
312
  class_decimal2string(E_DEC_FATAL_ERROR, val_decimal(&decimal_value),
313
313
                    fixed_precision, dec, '0', val_buffer);
314
314
  return val_buffer;
315
315
}