diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-22 17:56:35 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-22 17:56:35 -0500 |
commit | 467784e89c0817a74df32db4b12bd8b3e28a05df (patch) | |
tree | 2caf44efac58105c35a2e7954520c356c90684e4 /lib | |
parent | 6661cba88d14ecba88ae905e1852bac3f084966d (diff) | |
download | sqlalchemy-467784e89c0817a74df32db4b12bd8b3e28a05df.tar.gz |
Fixed bug where Oracle ``VARCHAR`` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar. [ticket:2870]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqlalchemy/dialects/oracle/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 1f5e05cba..e7263ba52 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -398,7 +398,9 @@ class OracleTypeCompiler(compiler.GenericTypeCompiler): return self._visit_varchar(type_, '', '') def _visit_varchar(self, type_, n, num): - if not n and self.dialect._supports_char_length: + if not type_.length: + return "%(n)sVARCHAR%(two)s" % {'two': num, 'n': n} + elif not n and self.dialect._supports_char_length: varchar = "VARCHAR%(two)s(%(length)s CHAR)" return varchar % {'length': type_.length, 'two': num} else: |