diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-09 20:43:28 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-09 20:43:28 -0500 |
| commit | af4239874242000f0dd38252ef0d35550d7bd21a (patch) | |
| tree | baf257145a2a9aa41e843764e68a3a15b9f3b003 /lib/sqlalchemy/dialects/mysql/base.py | |
| parent | 0843bbcfbb4ab57253e8de424b7b1b7538ba0781 (diff) | |
| download | sqlalchemy-af4239874242000f0dd38252ef0d35550d7bd21a.tar.gz | |
- The MySQL dialect now supports CAST on types that are constructed
as :class:`.TypeDecorator` objects.
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 0a999a85f..0d2c36189 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1683,9 +1683,12 @@ class MySQLCompiler(compiler.SQLCompiler): def get_from_hint_text(self, table, text): return text - def visit_typeclause(self, typeclause): - type_ = typeclause.type.dialect_impl(self.dialect) - if isinstance(type_, sqltypes.Integer): + def visit_typeclause(self, typeclause, type_=None): + if type_ is None: + type_ = typeclause.type.dialect_impl(self.dialect) + if isinstance(type_, sqltypes.TypeDecorator): + return self.visit_typeclause(typeclause, type_.impl) + elif isinstance(type_, sqltypes.Integer): if getattr(type_, 'unsigned', False): return 'UNSIGNED INTEGER' else: |
