Fix for bug #9894 (Negative numbers are allowed to 'unsigned' column)

mysql-test/r/type_decimal.result:
  test result fixed
mysql-test/r/type_newdecimal.result:
  test result fixed
mysql-test/t/type_newdecimal.test:
  test case added
sql/field.cc:
  We need to refuse negative integers when 'unsigned'
This commit is contained in:
unknown 2005-06-08 12:25:57 +05:00
commit 54ea60189d
4 changed files with 22 additions and 8 deletions

View file

@ -2446,7 +2446,7 @@ int Field_new_decimal::store(longlong nr)
int err;
if ((err= int2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
nr, unsigned_flag, &decimal_value)))
nr, false, &decimal_value)))
{
if (check_overflow(err))
set_value_on_overflow(&decimal_value, decimal_value.sign());