Bug 18620 - strange values in float type columns
Summary: strange values in float type columns
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mysql
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Patrick Macdonald
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On: 19604
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-07 22:46 UTC by Slawomir Bialek
Modified: 2007-04-18 16:29 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-10-25 18:59:28 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2000:133 0 normal SHIPPED_LIVE Updated mysql packages available for Red Hat Linux 7 2000-12-19 05:00:00 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.