The error in calculating the sum function of MySQL 4.0.18 for NT is found.
Mysql> Create Table CH3 (ID char (32), V decimal (18, 2 ));
Query OK, 0 rows affected (0.12 Sec)
Mysql> insert into CH3 select * From vc2;
Query OK, 8192 rows affected (1.24 Sec)
Records: 8192 duplicates: 0 Warnings: 0
Mysql> select max (v) from CH3;
+ ------------- +
| Max (v) |
+ ------------- +
| 1, 99999999.99 |
+ ------------- +
1 row in SET (1.17 Sec)
Mysql> select Min (v) from CH3;
+ ------------- +
| Min (v) |
+ ------------- +
| 1, 99999999.99 |
+ ------------- +
1 row in SET (1.17 Sec)
Mysql> select sum (v) from CH3;
+ ----------------- +
| Sum (v) |
+ ----------------- +
| 1, 819199999918.02 |
+ ----------------- +
1 row in SET (0.08 Sec)
MySQL & gt; update CH3 set V = 100000000;
Query OK, 8192 rows affected (0.12 Sec)
Rows matched: 8192 changed: 8192 Warnings: 0
Mysql> select sum (v) from CH3;
+ ----------------- +
| Sum (v) |
+ ----------------- +
| 1, 819200000000.00 |
+ ----------------- +
1 row in SET (0.06 Sec)
Mysql> Update CH3 set V = 100000000-0.01;
Query OK, 8192 rows affected (0.25 Sec)
Rows matched: 8192 changed: 8192 Warnings: 0
Mysql> select sum (v) from CH3;
+ ----------------- +
| Sum (v) |
+ ----------------- +
| 1, 819199999918.02 |
+ ----------------- +
1 row in SET (0.08 Sec)
Mysql> Update CH3 set V = 100000000 + 0.01;
Query OK, 8192 rows affected (0.23 Sec)
Rows matched: 8192 changed: 8192 Warnings: 0
Mysql> select sum (v) from CH3;
+ ----------------- +
| Sum (v) |
+ ----------------- +
| 1, 819200000081.98 |
+ ----------------- +
1 row in SET (0.09 Sec)
Mysql> select 99999999.99*8192;
+ ------------------ +
| 99999999.99*8192 |
+ ------------------ +
| 1, 819199999918.08 |
+ ------------------ +
1 row in SET (0.00 Sec)