Bug 18620

Summary: strange values in float type columns
Product: [Retired] Red Hat Linux Reporter: Slawomir Bialek <civic>
Component: mysqlAssignee: Patrick Macdonald <patrickm>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: jakub
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-25 18:59:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 19604    
Bug Blocks:    

Description Slawomir Bialek 2000-10-07 22:46:32 UTC
mysql> create table test (col1 float8);
Query OK, 0 rows affected (0.00 sec)
 
mysql> insert into test values (0);
Query OK, 1 row affected (0.00 sec)
 
mysql> select * from test;
+-----------------------+
| col1                  |
+-----------------------+
| 2.18942949477526e-314 |
+-----------------------+
1 row in set (0.00 sec)
                                 
It could be glibc or gcc bug.

Comment 1 Trond Eivind Glomsrxd 2000-10-08 01:52:42 UTC
Hardly a bug... this is about as close to zero as you can get it. With floating
point arithmetic you don't get exact answers (you can't represent an infinite
amount of numbers in a finite numbers of bits). Granted, 0 can be represented
exactly... but any operation to it, or yielding such a number would probably
result in something similar to what you are seeing.

Comment 2 Trond Eivind Glomsrxd 2000-10-09 14:55:56 UTC
OK, it happens with other values (like "1") as well - they're also  the same
number according to mysql.  According to the reporter (private mail) the same
package  compiled on Red Hat Linux 6.2 also works (same mail). Jakub, could you
take a look at it?

Comment 3 Trond Eivind Glomsrxd 2000-10-18 20:57:47 UTC
Fixed in 3.23.26-1 which I plan on releasing as a bugfix update soonish - thanks
a lot for the report.

Comment 4 Trond Eivind Glomsrxd 2000-10-23 14:45:31 UTC
Sorry, not fixed in -1. Workaround is to compile with -O1 - we'll fix this after
fixing the bug in the compiler.

Comment 5 Trond Eivind Glomsrxd 2000-10-25 19:02:21 UTC
Fixed in 3.23.26-1.2, which includes the patch mentioned in bug #19604. It has
been upstreamed, and I expect to release an errata later.