Use double instead of float to store Float fields in MySQL
The precision of MySQL float is not enough to handle all Python floats. From http://docs.python.org/tutorial/floatingpoint.html: "...almost all platforms map Python floats to IEEE-754 “double precision”"
This commit is contained in:
1 parent
3537d7fc4e
commit
596c8fce39
2 files changed
+2
-2
No files matched your search
@@ -55,7 +55,7 @@ class Float(fields.Float):
|
||||
|
||||
@staticmethod
|
||||
def sql_type(field):
|
||||
return ('float', 'float')
|
||||
return ('double', 'double')
|
||||
|
||||
|
||||
class Numeric(fields.Numeric):
|
||||
|
||||
@@ -175,7 +175,7 @@ class TableHandler(TableHandlerInterface):
|
||||
('varchar', 'text'),
|
||||
('text', 'varchar'),
|
||||
('date', 'timestamp'),
|
||||
('bigint', 'float'),
|
||||
('bigint', 'double'),
|
||||
('int', 'bigint'),
|
||||
('tinyint', 'bool'),
|
||||
('decimal', 'numeric'),
|
||||
|
||||
Reference in new issue
Block a user