The column type "FLOAT" seems to be flaky in MySQL 2.23.24-beta. I wouldn't mind if it 
was a rounding issue but the value 666666.66 becomes 666666.69 and 777777.77 becomes 
777777.75!
To reproduce the problem follow the steps below:


Step 1: Creat Table

create table TestAmt
(
  id int(8) not null auto_increment
,  amt_dec decimal(9,2) not null
,  amt_float float(9,2) not null
,  primary key (id)
)
type=MyISAM

Step 2: Insert values:

insert into TestAmt set amt_dec=111111.11,amt_float=111111.11
insert into TestAmt set amt_dec=222222.22,amt_float=222222.22
insert into TestAmt set amt_dec=333333.33,amt_float=333333.33
insert into TestAmt set amt_dec=444444.44,amt_float=444444.44
insert into TestAmt set amt_dec=555555.55,amt_float=555555.55
insert into TestAmt set amt_dec=666666.66,amt_float=666666.66
insert into TestAmt set amt_dec=777777.77,amt_float=777777.77
insert into TestAmt set amt_dec=888888.88,amt_float=888888.88
insert into TestAmt set amt_dec=999999.99,amt_float=999999.99

Step:3 Look at results:

mysql> select * from TestAmt;   
+----+-----------+------------+ 
| id | amt_dec   | amt_float  | 
+----+-----------+------------+ 
|  1 | 111111.11 |  111111.11 | 
|  2 | 222222.22 |  222222.22 | 
|  3 | 333333.33 |  333333.34 | 
|  4 | 444444.44 |  444444.44 | 
|  5 | 555555.55 |  555555.56 | 
|  6 | 666666.66 |  666666.69 | 
|  7 | 777777.77 |  777777.75 | 
|  8 | 888888.88 |  888888.88 | 
|  9 | 999999.99 | 1000000.00 | 
+----+-----------+------------+ 
9 rows in set (0.00 sec)        


Reply via email to