Bug #9528 Precision Math: Select query doesnt return result when clause uses float type.
Submitted: 31 Mar 2005 15:35 Modified: 31 Mar 2005 15:45
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3 - Beta OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[31 Mar 2005 15:35] Disha
Description:
1. Create a table with decimal datatype.
2. Insert some decimal values in the table.
3. Select the output of table specifying the decimal value in the where clause.

This can be reproduced using MyISAM as well as Innodb.

How to repeat:
1. Delimiter //
2. Drop table if exists t111//
3. Create table t111 (f1 int, f2 float)//
4. Insert into t111 values (11, 21)//
5. Insert into t111 values (12, 23.245)//
6. Select * from t111 where f2 = 23.245//

Actual Results:
The Select query returns an empty result set.
	Empty set (0.00 sec)

Expected Results: 	
The result should display the appropriate row that exists in the table. In this case:-

			+------+--------+
			| f1   | f2           |
			+------+--------+
			|   12 | 23.245    |
			+------+--------+
[31 Mar 2005 15:45] MySQL Verification Team
This should be an expected behavior when doing float-pointing comparing.
This is explained in the Manual:

http://dev.mysql.com/doc/mysql/en/problems-with-float.html