.. changelog::
:version: 0.8.2
+ .. change::
+ :tags: bug, firebird
+ :tickets: 2757
+
+ Type lookup when reflecting the Firebird types LONG and
+ INT64 has been fixed so that LONG is treated as INTEGER,
+ INT64 treated as BIGINT, unless the type has a "precision"
+ in which case it's treated as NUMERIC. Patch courtesy
+ Russell Stuart.
+
.. change::
:tags: bug, postgresql
:tickets: 2766
from sqlalchemy.sql import compiler
-from sqlalchemy.types import (BIGINT, BLOB, BOOLEAN, DATE,
- FLOAT, INTEGER, NUMERIC, SMALLINT,
- TEXT, TIME, TIMESTAMP)
+from sqlalchemy.types import (BIGINT, BLOB, DATE, FLOAT, INTEGER, NUMERIC,
+ SMALLINT, TEXT, TIME, TIMESTAMP, Integer)
RESERVED_WORDS = set([
ischema_names = {
'SHORT': SMALLINT,
- 'LONG': BIGINT,
+ 'LONG': INTEGER,
'QUAD': FLOAT,
'FLOAT': FLOAT,
'DATE': DATE,
'TIME': TIME,
'TEXT': TEXT,
- 'INT64': NUMERIC,
+ 'INT64': BIGINT,
'DOUBLE': FLOAT,
'TIMESTAMP': TIMESTAMP,
'VARYING': VARCHAR,
util.warn("Did not recognize type '%s' of column '%s'" %
(colspec, name))
coltype = sqltypes.NULLTYPE
- elif colspec == 'INT64':
- coltype = coltype(
+ elif issubclass(coltype, Integer) and row['fprec'] != 0:
+ coltype = NUMERIC(
precision=row['fprec'],
scale=row['fscale'] * -1)
elif colspec in ('VARYING', 'CSTRING'):