diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-06-27 13:25:12 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-06-27 16:27:22 -0400 |
| commit | 401a2691fbeebd5a26341e732644584cb096bc58 (patch) | |
| tree | fe188b760decdc2abbf4f568c8b4a2508cd22805 /lib/sqlalchemy | |
| parent | ec2c32bf93cc6fd60db87009643ece32c7926021 (diff) | |
| download | sqlalchemy-401a2691fbeebd5a26341e732644584cb096bc58.tar.gz | |
Unwrap TIMESTAMP when doing an isinstance()
Fixed bug where the special logic to render "NULL" for the
:class:`.TIMESTAMP` datatype when ``nullable=True`` would not work if the
column's datatype were a :class:`.TypeDecorator` or a :class:`.Variant`.
The logic now ensures that it unwraps down to the original
:class:`.TIMESTAMP` so that this special case NULL keyword is correctly
rendered when requested.
Fixes: #4743
Change-Id: I02b22dfa3db06daea37b044e2206a8569e2e5d22
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index da76201f2..3c2e8e84b 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1501,7 +1501,10 @@ class MySQLDDLCompiler(compiler.DDLCompiler): ), ] - is_timestamp = isinstance(column.type, sqltypes.TIMESTAMP) + is_timestamp = isinstance( + column.type._unwrapped_dialect_impl(self.dialect), + sqltypes.TIMESTAMP, + ) if not column.nullable: colspec.append("NOT NULL") |
