My favorites | Sign in
Google
                
Search
for
Updated Aug 19, 2008 by mdcallag
LosslessFloatDump  
Dump and restore float and double columns without loss of precision

Introduction

Math is hard. Floating point math is even harder.

Alas, MySQL has changed things in MySQL 5.0 that make lossless conversions impossible. See Bug36829 for details. This will not be fixed until 5.1.

Details

To use this feature, invoke mysqldump with the --lossless-fp option. When this is used, columns with type float and double are converted to a decimal string with 17 digits of precision. This is done because conversions from double to decimal and then back to double are lossless (the initial double value is equal to the final double value) when the double to decimal conversion generates 17 digits of precision. This is generally true. There are some values for float and double for which this is not true (subnormal).

mysqldump --lossless-fp my_database my_table > my_table.dump

Comment by jolzer, Sep 25, 2007

which version of mysql? does not work here :-(


Sign in to add a comment