Bug #34015 | Problems with float fields using federated tables | ||
---|---|---|---|
Submitted: | 23 Jan 2008 18:02 | Modified: | 11 Feb 2008 21:00 |
Reporter: | Rodrigo Serratto | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Federated storage engine | Severity: | S1 (Critical) |
Version: | 5.0.54 | OS: | Linux |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
Tags: | federated, FLOAT, problem |
[23 Jan 2008 18:02]
Rodrigo Serratto
[24 Jan 2008 14:55]
Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.45 at least, and inform about the results.
[29 Jan 2008 18:05]
Rodrigo Serratto
I tested with 5.0.45. The problem still happens.
[30 Jan 2008 0:55]
Rodrigo Serratto
i changeg all float fiels to decimal. it works
[31 Jan 2008 18:50]
Valeriy Kravchuk
Verified just as described with 5.0.54: C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -proot test -P3308 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.54-enterprise-gpl-nt-log MySQL Enterprise Server (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> CREATE DATABASE test_federated; Query OK, 1 row affected (0.02 sec) mysql> USE test_federated; Database changed mysql> CREATE TABLE IF NOT EXISTS `test` ( `one` float(6,2) default NULL, `two ` float(6,2) -> default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general _ci; Query OK, 0 rows affected (0.08 sec) mysql> CREATE TABLE IF NOT EXISTS `test_fed` ( `one` float(6,2) default NULL, `two` float(6,2) -> default NULL) ENGINE=FEDERATED DEFAULT CHARSET=latin1 COLLATE=latin1_gene ral_ci -> CONNECTION='mysql://root:root@localhost:3308/test_federated/test'; Query OK, 0 rows affected (0.06 sec) mysql> insert into test_fed values (1,2); Query OK, 1 row affected (0.08 sec) mysql> insert into test_fed values (3,4); Query OK, 1 row affected (0.00 sec) mysql> insert into test_fed values (5.1,6.1); Query OK, 1 row affected (0.00 sec) mysql> insert into test_fed values (7,8); Query OK, 1 row affected (0.00 sec) mysql> insert into test_fed values ('9,1','10,1'); ERROR 1265 (01000): Data truncated for column 'one' at row 1 mysql> insert into test_fed values ('9.1','10.1'); Query OK, 1 row affected (0.00 sec) mysql> select * from test_fed; +------+-------+ | one | two | +------+-------+ | 1.00 | 2.00 | | 3.00 | 4.00 | | 5.10 | 6.10 | | 7.00 | 8.00 | | 9.10 | 10.10 | +------+-------+ 5 rows in set (0.00 sec) mysql> update test_fed set one=10; Query OK, 5 rows affected (0.03 sec) Rows matched: 5 Changed: 5 Warnings: 0 mysql> select * from test_fed; +-------+-------+ | one | two | +-------+-------+ | 10.00 | 2.00 | | 10.00 | 4.00 | | 5.10 | 6.10 | | 10.00 | 8.00 | | 9.10 | 10.10 | +-------+-------+ 5 rows in set (0.00 sec)
[5 Feb 2008 17:22]
Omer Barnir
workaround: use decimal instead of float
[11 Feb 2008 8:21]
Lars Thalmann
This is fixed in MySQL 6.0 (with dtoa).
[11 Feb 2008 21:00]
Paul DuBois
Noted in 6.0.5 changelog. Updates of floating-point columns in FEDERATED tables could produce incorrect results.