Loading mysql-test/r/type_newdecimal.result +3 −0 Original line number Diff line number Diff line Loading @@ -1468,4 +1468,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r create table t1 (s varchar(100)); insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875); drop table t1; SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; a b 0.9999999999999800000000000000 0.9999999999999800000000000000 End of 5.0 tests mysql-test/t/type_newdecimal.test +5 −0 Original line number Diff line number Diff line Loading @@ -1157,4 +1157,9 @@ create table t1 (s varchar(100)); insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875); drop table t1; # # Bug #27984 Long Decimal Maths produces truncated results # SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; --echo End of 5.0 tests strings/decimal.c +2 −1 Original line number Diff line number Diff line Loading @@ -1517,9 +1517,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale, dec1 *p0= buf0+intg0+max(frac1, frac0); dec1 *p1= buf1+intg1+max(frac1, frac0); to->buf[0]= 0; while (buf0 < p0) *(--p1) = *(--p0); if (unlikely(intg1 > intg0)) to->buf[0]= 0; intg0= intg1; buf0=to->buf; Loading Loading
mysql-test/r/type_newdecimal.result +3 −0 Original line number Diff line number Diff line Loading @@ -1468,4 +1468,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r create table t1 (s varchar(100)); insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875); drop table t1; SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; a b 0.9999999999999800000000000000 0.9999999999999800000000000000 End of 5.0 tests
mysql-test/t/type_newdecimal.test +5 −0 Original line number Diff line number Diff line Loading @@ -1157,4 +1157,9 @@ create table t1 (s varchar(100)); insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875); drop table t1; # # Bug #27984 Long Decimal Maths produces truncated results # SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; --echo End of 5.0 tests
strings/decimal.c +2 −1 Original line number Diff line number Diff line Loading @@ -1517,9 +1517,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale, dec1 *p0= buf0+intg0+max(frac1, frac0); dec1 *p1= buf1+intg1+max(frac1, frac0); to->buf[0]= 0; while (buf0 < p0) *(--p1) = *(--p0); if (unlikely(intg1 > intg0)) to->buf[0]= 0; intg0= intg1; buf0=to->buf; Loading