diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-12-07 17:24:09 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-12-07 17:24:09 -0500 |
| commit | 3f42743d6aa1326a80a0ed720a92266aa5fbf209 (patch) | |
| tree | 8f67c6c50753df23e759fdfee73c79072260718d /lib/sqlalchemy | |
| parent | d7eae8c95ca8c5963fc78fc997ed0f2da76aed31 (diff) | |
| download | sqlalchemy-3f42743d6aa1326a80a0ed720a92266aa5fbf209.tar.gz | |
- Fixed bug in MySQL reflection where the "fractional sections portion"
of the :class:`.mysql.DATETIME`, :class:`.mysql.TIMESTAMP` and
:class:`.mysql.TIME` types would be incorrectly placed into the
``timestamp`` attribute, which is unused by MySQL, instead of the
``fsp`` attribute.
fixes #3602
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index ad3ffa6f8..988746403 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -3094,6 +3094,11 @@ class MySQLTableDefinitionParser(object): # Column type keyword options type_kw = {} + + if issubclass(col_type, (DATETIME, TIME, TIMESTAMP)): + if type_args: + type_kw['fsp'] = type_args.pop(0) + for kw in ('unsigned', 'zerofill'): if spec.get(kw, False): type_kw[kw] = True |
