Loading mysql-test/r/type_decimal.result +6 −6 Original line number Diff line number Diff line Loading @@ -414,8 +414,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0 0 1 1 1 Loading @@ -430,8 +430,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0000000000 0000000000 0000000001 0000000001 0000000001 Loading @@ -446,8 +446,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0000000000 0000000000 0000000001 0000000001 0000000001 Loading mysql-test/r/type_newdecimal.result +19 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ a 99.99 99.99 99.99 99.99 0.00 0.00 0.00 0.00 Loading Loading @@ -891,3 +891,21 @@ NULL select abs(NULL); abs(NULL) NULL set @@sql_mode='traditional'; create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned); insert into t1 values(1,-1,-1); ERROR 22003: Out of range value adjusted for column 'd2' at row 1 drop table t1; set @@div_precision_increment=15; create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; col2/9999999999 0.000000000001234567890246913578 select 9999999999/col2 from t1 where col1=1; 9999999999/col2 810000007209.000065537105051 select 77777777/7777777; 77777777/7777777 10.000000900000090 drop table t1; mysql-test/t/type_newdecimal.test +21 −0 Original line number Diff line number Diff line Loading @@ -925,3 +925,24 @@ DROP TABLE t1; select abs(10/0); select abs(NULL); # # Bug #9894 (negative to unsigned column) # set @@sql_mode='traditional'; create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned); --error 1264 insert into t1 values(1,-1,-1); drop table t1; # # Bug #8425 (insufficient precision of the division) # set @@div_precision_increment=15; create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; select 9999999999/col2 from t1 where col1=1; select 77777777/7777777; drop table t1; sql/field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading Loading
mysql-test/r/type_decimal.result +6 −6 Original line number Diff line number Diff line Loading @@ -414,8 +414,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0 0 1 1 1 Loading @@ -430,8 +430,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0000000000 0000000000 0000000001 0000000001 0000000001 Loading @@ -446,8 +446,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a 9999999999 9999999999 0000000000 0000000000 0000000001 0000000001 0000000001 Loading
mysql-test/r/type_newdecimal.result +19 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ a 99.99 99.99 99.99 99.99 0.00 0.00 0.00 0.00 Loading Loading @@ -891,3 +891,21 @@ NULL select abs(NULL); abs(NULL) NULL set @@sql_mode='traditional'; create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned); insert into t1 values(1,-1,-1); ERROR 22003: Out of range value adjusted for column 'd2' at row 1 drop table t1; set @@div_precision_increment=15; create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; col2/9999999999 0.000000000001234567890246913578 select 9999999999/col2 from t1 where col1=1; 9999999999/col2 810000007209.000065537105051 select 77777777/7777777; 77777777/7777777 10.000000900000090 drop table t1;
mysql-test/t/type_newdecimal.test +21 −0 Original line number Diff line number Diff line Loading @@ -925,3 +925,24 @@ DROP TABLE t1; select abs(10/0); select abs(NULL); # # Bug #9894 (negative to unsigned column) # set @@sql_mode='traditional'; create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned); --error 1264 insert into t1 values(1,-1,-1); drop table t1; # # Bug #8425 (insufficient precision of the division) # set @@div_precision_increment=15; create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from t1 where col1=1; select 9999999999/col2 from t1 where col1=1; select 77777777/7777777; drop table t1;
sql/field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -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()); Loading