Bug #9862 | Double field outputs zero insted of the stored value. | ||
---|---|---|---|
Submitted: | 13 Apr 2005 7:41 | Modified: | 13 Apr 2005 21:54 |
Reporter: | Uzi Klein | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.10a | OS: | FreeBSD (FreeBSD 5.3-RELEASE-p6) |
Assigned to: | CPU Architecture: | Any |
[13 Apr 2005 7:41]
Uzi Klein
[13 Apr 2005 21:53]
Jorge del Conde
Tested w/4.1.11 from bk: mysql> CREATE TABLE Test (`ID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `Field` -> DOUBLE UNSIGNED, PRIMARY KEY ID(ID)); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO Test (Field) VALUES (123.234); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM Test; +----+---------+ | ID | Field | +----+---------+ | 1 | 123.234 | +----+---------+ 1 row in set (0.00 sec)
[3 Dec 2005 16:31]
Andrey Chesnackov
We are also occasionally experiencing this issue on two of our servers. It's hard to reproduce because problem is appear suddenly only after some server uptime. For the first time problem appears twice (3 and 2 weeks ago) with our MySQL 4.0.25 (or maybe earlier - can't remember) under FreeBSD 5.4. I have upgraded it to latest 4.0.26 - problem didn't appeared anymore for a while. Today we found same problem on another server with MySQL 4.1.15 under FreeBSD 5.4. (MySQL Uptime: ~ 6 days, Questions: 15273459) Command: $ mysql stats_test -e 'CREATE TABLE Test (`ID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `Field` DOUBLE UNSIGNED, PRIMARY KEY ID(ID)); INSERT INTO Test (Field) VALUES (123.234); SELECT * FROM Test; DROP TABLE Test;' Result: +----+-------+ | ID | Field | +----+-------+ | 1 | 000 | +----+-------+ After mysql server restart all returned to normal. Result: +----+---------+ | ID | Field | +----+---------+ | 1 | 123.234 | +----+---------+ I'm totally confused and didn't know how we can try to determine the source of this bug... :(
[13 Nov 2006 7:17]
Oleg Petrachev
The issue appears to be existing. I may repeat it on my mysql 4.1.21 under FreeBSD rel 6.1-p10 (\s:) Ver 14.7 Distrib 4.1.21, for portbld-freebsd6.1 (i386) using 5.0 Mysql output for DOUBLE values becomes incorrect after some server uptime (probably after some query or other circumstances). We have several Mysql 4.1.21 servers under FreeBSD-STABLE/RELEASE/PRERELEASE 6.1-6.2 - they have this bug. We also have more Mysql 4.1.21 servers (and other versions) that do not show this bug. We also have Mysql 4.1.18 server under Linux 2.4 with heavy load anv long uptime (200 days) that does not show this issue. I tried to move binary package of mysql41-server from a free-of-bug server to buggy on, but this does not help. Probably that free-of-bug server is buggy too, but the bug is just sleeping. Mysql is compiled statically. Steps to represent: (FreeBSD PREPRELEASE 6.2 - it is easier to meet this bug here). 1. Start mysql and wait for 2-3 days of medium load (sometimes 12h is enough). 2. create database a; use a; create table b (d double); insert into b values (1), (0.1), (0.01), (0.001), (0.0001); mysql> select * from b; +----------------+ | d | +----------------+ | 1 | | 0.1 | | 0.01 | | 0.001 | | 0.0007HHKHMLNL | +----------------+ 5 rows in set (0.01 sec) mysql> alter table b change d d float unsigned; Query OK, 5 rows affected (0.16 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> select * from b; +--------+ | d | +--------+ | 1 | | 0.1 | | 0.01 | | 0.001 | | 0.0001 | +--------+ 5 rows in set (0.00 sec) mysql> alter table b change d d double unsigned; Query OK, 5 rows affected (0.00 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> select * from b; +-------+ | d | +-------+ | 1 | | 0.1 | | 0.01 | | 0.000 | | | +-------+ 5 rows in set (0.00 sec)