那么如果使用浮点数据保存了精度大于其范围的数据其会使用四舍五入的方法截断。 MYSQL如下: mysql> create table dname(id1 float,id2 double,name varchar(20)); Query OK, 0 rows affected (0.08 sec) mysql> insert into dname values(1234567.123,1234567.123,'gaopeng'); Query OK, 1 row affected (0.00 sec) mysql> commit; Query OK, 0 rows affected (0.00 sec) mysql> select * from dname; +---------+-------------+---------+ | id1 | id2 | name | +---------+-------------+---------+ | 1234570 | 1234567.123 | gaopeng | +---------+-------------+---------+ 1 row in set (0.00 sec) 虽然进行了四舍五入,但是不会有任何报错和警告,这是其标准决定的而不是数据库本生。 可以看到1234567.123在FLOAT下被四舍五入为1234570,而DOUBLE类型没有问题,那么我们 直接从数据文件中提取数据。 我还是使用了自己写的小工具BCVIEW [root@hadoop1 test]# bcview dname.ibd 16 127 40 ****************************************************************** This Tool Is Uesed For Find The Data In Binary format(Hexadecimal) Usage:./bcview file blocksize offset cnt-bytes! file: Is Your File Will To Find Data! blocksize: Is N kb Block.Eg: 8 Is 8 Kb Blocksize(Oracle)! Eg: 16 Is 16 Kb Blocksize(Innodb)! offset:Is Every Block Offset Your Want Start! cnt-bytes:Is After Offset,How Bytes Your Want Gets! Edtor QQ:22389860! Used gcc version 4.1.2 20080704 (Red Hat 4.1.2-46) ****************************************************************** ----Current file size is :0.093750 Mb ----Current use set blockszie is 16 Kb current block:00000000--Offset:00127--cnt bytes:40--data is:00ffffffff0000000000010000000200260000000200260000000000000000ffffffff0000ffffff current block:00000001--Offset:00127--cnt bytes:40--data is:00000000000000000000000000000000000000000000000000000000000000000000000000000000 current block:00000002--Offset:00127--cnt bytes:40--data is:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff current block:00000003--Offset:00127--cnt bytes:40--data is:000001cc6d090000002d5679ab00000d0c011039b4964991ed7c1f87d6324167616f70656e670000 current block:00000004--Offset:00127--cnt bytes:40--data is:00000000000000000000000000000000000000000000000000000000000000000000000000000000 current block:00000005--Offset:00127--cnt bytes:40--data is:00000000000000000000000000000000000000000000000000000000000000000000000000000000