summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-11-22 17:56:35 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-11-22 17:56:35 -0500
commit467784e89c0817a74df32db4b12bd8b3e28a05df (patch)
tree2caf44efac58105c35a2e7954520c356c90684e4 /lib/sqlalchemy
parent6661cba88d14ecba88ae905e1852bac3f084966d (diff)
downloadsqlalchemy-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/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/oracle/base.py4
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: