when using a non-period-decimal-point NLS_LANG setting.
[ticket:1953].
+- firebird
+ - Firebird numeric type now checks for Decimal explicitly,
+ lets float() pass right through, thereby allowing
+ special values such as float('inf'). [ticket:2012]
+
- declarative
- An error is raised if __table_args__ is not in tuple
or dict format, and is not None. [ticket:1972]
else:
coltype = BLOB()
else:
- coltype = coltype(row)
+ coltype = coltype()
# does it have a default value?
defvalue = None
from sqlalchemy.dialects.firebird.base import FBDialect, \
FBCompiler, FBExecutionContext
from sqlalchemy import util, types as sqltypes
+from sqlalchemy.util.compat import decimal
class _FBNumeric_kinterbasdb(sqltypes.Numeric):
def bind_processor(self, dialect):
def process(value):
- if value is not None:
+ if isinstance(value, decimal.Decimal):
return str(value)
else:
return value
colspecs = util.update_copy(
FBDialect.colspecs,
{
- sqltypes.Numeric:_FBNumeric_kinterbasdb
+ sqltypes.Numeric:_FBNumeric_kinterbasdb,
}
)
for type_, args, kw, res in columns:
self.assert_compile(type_(*args, **kw), res)
+class TypesTest(TestBase):
+ __only_on__ = 'firebird'
+
+ @testing.provide_metadata
+ def test_infinite_float(self):
+ t = Table('t', metadata,
+ Column('data', Float)
+ )
+ metadata.create_all()
+ t.insert().execute(data=float('inf'))
+ eq_(t.select().execute().fetchall(),
+ [(float('inf'),)]
+ )
+
class MiscTest(TestBase):
__only_on__ = 'firebird'