~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/decimal.cc

  • Committer: Brian Aker
  • Date: 2010-10-21 17:41:40 UTC
  • mfrom: (1865.1.2 trunk-bug-662980)
  • Revision ID: brian@tangent.org-20101021174140-m1jk977sz1r39i6u
Merge in fix for Andrew.

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= 0;
128
 
 
129
 
  if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
130
 
                                         decimal_value, ptr, precision, dec)))
 
127
  int error= my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
 
128
                                         decimal_value, ptr, precision, dec);
 
129
  if (warn_if_overflow(error))
131
130
  {
132
 
    my_decimal buff;
133
 
    set_value_on_overflow(&buff, decimal_value->sign());
134
 
    my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec);
 
131
    if (error != E_DEC_TRUNCATED)
 
132
    {
 
133
      my_decimal buff;
 
134
      set_value_on_overflow(&buff, decimal_value->sign());
 
135
      my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec);
 
136
    }
135
137
    error= 1;
136
138
  }
137
139
  return(error);