diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-17 01:18:54 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-17 01:18:54 +0000 |
commit | 5f83c55fc7710ad495e64268627949ca91a66c72 (patch) | |
tree | 4f4f4f3b10f856051e481324ca6415dfd7e7f4cf /lib/sqlalchemy | |
parent | 67f020f69cbca55150c2d793ba3f9fcb95749838 (diff) | |
download | sqlalchemy-5f83c55fc7710ad495e64268627949ca91a66c72.tar.gz |
- fixed oracle list of binary types to check for their presence in the module (such as BFILE not in all versions of cx_Oracle)
- removed oracle-handicap from binary unit test to test [ticket:435] fix, added an extra row containing None
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/databases/oracle.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/databases/oracle.py b/lib/sqlalchemy/databases/oracle.py index e1c82450f..8f6ce4772 100644 --- a/lib/sqlalchemy/databases/oracle.py +++ b/lib/sqlalchemy/databases/oracle.py @@ -20,6 +20,9 @@ try: import cx_Oracle except: cx_Oracle = None + +ORACLE_BINARY_TYPES = [getattr(cx_Oracle, k) for k in ["BFILE", "CLOB", "NCLOB", "BLOB", "LONG_BINARY", "LONG_STRING"] if hasattr(cx_Oracle, k)] + class OracleNumeric(sqltypes.Numeric): def get_col_spec(self): @@ -326,8 +329,7 @@ class OracleDialect(ansisql.ANSIDialect): if cursor and cursor.description: for column in cursor.description: type_code = column[1] - if type_code in (cx_Oracle.BFILE, cx_Oracle.CLOB, cx_Oracle.NCLOB, - cx_Oracle.BLOB, cx_Oracle.LONG_BINARY, cx_Oracle.LONG_STRING): + if type_code in ORACLE_BINARY_TYPES: args['should_prefetch'] = True break return args |