~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.cc

  • Committer: Jay Pipes
  • Date: 2009-02-04 15:44:25 UTC
  • mfrom: (829 drizzle)
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090204154425-th8xfk2ujz2y8xwg
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
             unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg)
43
43
{
44
44
  precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
45
 
  set_if_smaller(precision, (uint32_t)DECIMAL_MAX_PRECISION);
 
45
  set_if_smaller(precision, DECIMAL_MAX_PRECISION);
46
46
  assert((precision <= DECIMAL_MAX_PRECISION) &&
47
47
              (dec <= DECIMAL_MAX_SCALE));
48
48
  bin_size= my_decimal_get_binary_size(precision, dec);
59
59
             NONE, name, dec_arg, 0, unsigned_arg)
60
60
{
61
61
  precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
62
 
  set_if_smaller(precision, (uint32_t)DECIMAL_MAX_PRECISION);
 
62
  set_if_smaller(precision, DECIMAL_MAX_PRECISION);
63
63
  assert((precision <= DECIMAL_MAX_PRECISION) &&
64
64
              (dec <= DECIMAL_MAX_SCALE));
65
65
  bin_size= my_decimal_get_binary_size(precision, dec);
149
149
 
150
150
  switch (err) {
151
151
  case E_DEC_TRUNCATED:
152
 
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
153
 
    set_value_on_overflow(&decimal_value, decimal_value.sign());
 
152
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_WARN_DATA_TRUNCATED, 1);
154
153
    break;
155
154
  case E_DEC_OVERFLOW:
156
155
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);