~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:28:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2031.
  • Revision ID: brian@tangent.org-20101225002849-g73mg6ihulajis0o
First pass in refactoring of the name of my_decimal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
           dec_arg, zero_arg,
53
53
           unsigned_arg)
54
54
{
55
 
  precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
 
55
  precision= class_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
56
56
  set_if_smaller(precision, (uint32_t)DECIMAL_MAX_PRECISION);
57
57
  assert((precision <= DECIMAL_MAX_PRECISION) &&
58
58
         (dec <= DECIMAL_MAX_SCALE));
59
 
  bin_size= my_decimal_get_binary_size(precision, dec);
 
59
  bin_size= class_decimal_get_binary_size(precision, dec);
60
60
}
61
61
 
62
62
Field_decimal::Field_decimal(uint32_t len_arg,
74
74
           0,
75
75
           unsigned_arg)
76
76
{
77
 
  precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
 
77
  precision= class_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
78
78
  set_if_smaller(precision, (uint32_t)DECIMAL_MAX_PRECISION);
79
79
  assert((precision <= DECIMAL_MAX_PRECISION) &&
80
80
         (dec <= DECIMAL_MAX_SCALE));
81
 
  bin_size= my_decimal_get_binary_size(precision, dec);
 
81
  bin_size= class_decimal_get_binary_size(precision, dec);
82
82
}
83
83
 
84
84
 
187
187
                          ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
188
188
                          "decimal", from_as_str.c_ptr(), field_name,
189
189
                          (uint32_t) getTable()->in_use->row_count);
190
 
      my_decimal_set_zero(&decimal_value);
 
190
      class_decimal_set_zero(&decimal_value);
191
191
 
192
192
      break;
193
193
    }
352
352
{
353
353
  uint32_t const source_precision= (field_metadata >> 8U) & 0x00ff;
354
354
  uint32_t const source_decimal= field_metadata & 0x00ff;
355
 
  uint32_t const source_size= my_decimal_get_binary_size(source_precision,
 
355
  uint32_t const source_size= class_decimal_get_binary_size(source_precision,
356
356
                                                         source_decimal);
357
357
  return (source_size);
358
358
}
394
394
  uint32_t from_precision= (param_data & 0xff00) >> 8U;
395
395
  uint32_t from_decimal= param_data & 0x00ff;
396
396
  uint32_t length=pack_length();
397
 
  uint32_t from_pack_len= my_decimal_get_binary_size(from_precision, from_decimal);
 
397
  uint32_t from_pack_len= class_decimal_get_binary_size(from_precision, from_decimal);
398
398
  uint32_t len= (param_data && (from_pack_len < length)) ?
399
399
    from_pack_len : length;
400
400
  if ((from_pack_len && (from_pack_len < length)) ||