Bug #7681 precision error on double fields
Submitted: 5 Jan 2005 10:05 Modified: 5 Jan 2005 10:45
Reporter: Sean Liang Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S1 (Critical)
Version: OS:
Assigned to: CPU Architecture:Any

[5 Jan 2005 10:05] Sean Liang
The number of resultset is incorrect when running the attached script in first two environments:

host1: Windows XP
mysql  Ver 14.6 Distrib 4.1.4-gamma, for Win95/Win98 (i32)

host2: FreeBSD 5.2.1
mysql  Ver 14.7 Distrib 4.1.7, for portbld-freebsd5.2.1 (i386)

host3: FreeBSD 5.2.1
mysql  Ver 13.5 Distrib 4.1.0-alpha, for portbld-freebsd5.1 (i386)

How to repeat:
drop table if exists test;

create table test (
id int(11) unsigned not null auto_increment,
value double(8,2) unsigned default 0,
primary key  (id),
unique key id (id)

insert into test (value) values (28.15), (30);

select * from test where value in (28.15, 30);
[5 Jan 2005 10:45] MySQL Verification Team

Thank you for the report, but this is really not a bug.
You can read more about problems with floating point numbers at: