]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- The "asdecimal" flag used with the :class:`.Float` type will now
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 27 Dec 2013 18:16:48 +0000 (13:16 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 27 Dec 2013 18:16:48 +0000 (13:16 -0500)
work with Firebird dialects; previously the decimal conversion was
not occurring.
- scale back some firebird FP numeric tests

doc/build/changelog/changelog_08.rst
lib/sqlalchemy/dialects/firebird/kinterbasdb.py
test/requirements.py

index 0f3737d534081dc1d9f6521d2cfff8eb3abea9fc..5dd7ca92742939a8e83de41b2f1fe3f45a6e66a7 100644 (file)
 .. changelog::
     :version: 0.8.5
 
+    .. change::
+        :tags: bug, firebird
+        :versions: 0.9.0b2
+
+        The "asdecimal" flag used with the :class:`.Float` type will now
+        work with Firebird dialects; previously the decimal conversion was
+        not occurring.
+
     .. change::
         :tags: bug, mssql, pymssql
         :versions: 0.9.0b2
index c8d8e986f5c5eba461358daa10379c371786c246..4b083deeb1c05c81c586fc694d16b7d8db713ec0 100644 (file)
@@ -42,7 +42,7 @@ from re import match
 import decimal
 
 
-class _FBNumeric_kinterbasdb(sqltypes.Numeric):
+class _kinterbasdb_numeric(object):
     def bind_processor(self, dialect):
         def process(value):
             if isinstance(value, decimal.Decimal):
@@ -51,6 +51,12 @@ class _FBNumeric_kinterbasdb(sqltypes.Numeric):
                 return value
         return process
 
+class _FBNumeric_kinterbasdb(_kinterbasdb_numeric, sqltypes.Numeric):
+    pass
+
+class _FBFloat_kinterbasdb(_kinterbasdb_numeric, sqltypes.Float):
+    pass
+
 
 class FBExecutionContext_kinterbasdb(FBExecutionContext):
     @property
@@ -74,6 +80,7 @@ class FBDialect_kinterbasdb(FBDialect):
         FBDialect.colspecs,
         {
             sqltypes.Numeric: _FBNumeric_kinterbasdb,
+            sqltypes.Float: _FBFloat_kinterbasdb,
         }
 
     )
index f7b53d8dfe3b1f59f1d7c9bde0c80dc89c0df527..b90591a802adc78091c2bbc95d517322cf1d6de2 100644 (file)
@@ -557,11 +557,21 @@ class DefaultRequirements(SuiteRequirements):
         """target backend will return native floating point numbers with at
         least seven decimal places when using the generic Float type."""
 
-        return fails_if('mysql', 'mysql FLOAT type only returns 4 decimals')
+        return fails_if([
+                    ('mysql', None, None,
+                                'mysql FLOAT type only returns 4 decimals'),
+                    ('firebird', None, None,
+                                "firebird FLOAT type isn't high precision"),
+                ])
 
     @property
     def floats_to_four_decimals(self):
-        return fails_if("mysql+oursql", "Floating point error")
+        return fails_if([
+                    ("mysql+oursql", None, None, "Floating point error"),
+                    ("firebird", None, None,
+                        "Firebird still has FP inaccuracy even "
+                        "with only four decimal places")
+                ])
 
     @property
     def python2(self):