test Informix dialect against an actual Informix database
This is a follow on ticket to #1645.
The informix visit_clauselist() implementation seems to be broken:
411 def visit_clauselist(self, list, **kwargs):
412 return ', '.join([for s in [self.process(c) for c in list.clauses](s) if s is not None])
As far as I can tell, this causes WHERE
clause elements to get joined together with commas rather than AND
. Simply removing this method from InfoCompiler
allows me to construct valid queries using the sql expression language.
Also, I noticed that constructing tables using e.g. sqlalchemy.Column('x', sqlalchemy.types.Float)
results in a CREATE TABLE
statement with column x
of type NUMERIC(10,2)
: I was expecting a FLOAT
column that wouldn't suffer from loss of precision due to rounding.
Attached is a patch against 0.5.7 that adds InfoFloat
(mapped to sqlalchemy.types.Float
) and InfoSmallFloat
(for reflecting Informix tables containing SMALLFLOAT
columns) column types, and removes visit_clauselist()
from InfoCompiler
.
Informix FLOAT/InfoFloat
supports a precision argument; the database expects it to be between 1 and 14. It's not clear to me exactly what it it specifies and in any case is ignored by the database server - an IEEE 754 double is stored regardless. It's also not clear from the sqlalchemy documentation whether there is some cross-database interpretation of precision that I should be mapping to a database specific precision (MySQL seems to interpret the precision passed to FLOAT as the desired number of mantissa bits). Since I wasn't sure what to do about this, the patch just passes the user specified precision to Informix with no modifications.
For reference, here are links to the Informix IDS 11.50 documentation for built-in data types.
Comments (6)
-
repo owner -
Account Deleted I'd be more than happy to switch to 0.6 - you can reach me at
smm [at](at) ipac {dot} caltech <period> edu
-
repo owner the latest trunk has an updated informix dialect, not tested, but includes most of the changes we've talked about. the NUMERIC/FLOAT distinction goes into the InfoTypeCompiler.
-
repo owner - changed milestone to 0.6.xx
-
repo owner - changed milestone to blue sky
- changed title to test Informix dialect against an actual Informix database
not clear on the status here so would need an Informix tester.
-
repo owner - changed status to wontfix
informix is moved out to an experimental dialect, and production level informix support is now available via http://code.google.com/p/ibm-db/.
- Log in to comment
two things -