~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

  • Committer: Brian Aker
  • Date: 2009-04-07 20:09:30 UTC
  • mfrom: (971.1.17 mordred)
  • Revision ID: brian@gaz-20090407200930-27jkul7lkwkjs2to
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
763
763
  @param op_result  decimal library return code (E_DEC_* see include/decimal.h)
764
764
 
765
765
  @retval
766
 
    1  there was overflow
 
766
    E_DEC_OVERFLOW   there was overflow
 
767
    E_DEC_TRUNCATED  there was truncation
767
768
  @retval
768
 
    0  no error or some other errors except overflow
 
769
    0  no error or there was some other error except overflow or truncation
769
770
*/
770
771
 
771
772
int Field::warn_if_overflow(int op_result)
773
774
  if (op_result == E_DEC_OVERFLOW)
774
775
  {
775
776
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
776
 
    return 1;
 
777
    return E_DEC_OVERFLOW;
777
778
  }
778
779
  if (op_result == E_DEC_TRUNCATED)
779
780
  {
780
 
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_NOTE, ER_WARN_DATA_TRUNCATED, 1);
781
 
    /* We return 0 here as this is not a critical issue */
 
781
    set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
 
782
    return E_DEC_TRUNCATED;
782
783
  }
783
784
  return 0;
784
785
}