diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-02-11 09:07:03 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-02-11 09:11:37 -0500 |
| commit | 49197c7b36573d91b015019d4635071f9da1c216 (patch) | |
| tree | 1c23029bfc9532fb3f8655eca74a6db225e758fa /lib/sqlalchemy | |
| parent | 833583458c69e24e797c300c934da0ff04348db5 (diff) | |
| download | sqlalchemy-49197c7b36573d91b015019d4635071f9da1c216.tar.gz | |
Add complete coverage and fix lower() for MySQL 88718 workaround
Fixed a second regression caused by :ticket:`4344` (the first was
:ticket:`4361`), which works around MySQL issue 88718, where the lower
casing function used was not correct for Python 2 with OSX/Windows casing
conventions, which would then raise ``TypeError``. Full coverage has been
added to this logic so that every codepath is exercised in a mock style for
all three casing conventions on all versions of Python. MySQL 8.0 has
meanwhile fixed issue 88718 so the workaround is only applies to a
particular span of MySQL 8.0 versions.
Fixes: #4492
Change-Id: I14e7237e0be4a9c21c58c921066304ae99ac4dc6
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 76b52e0d7..1b89a3ac6 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2543,8 +2543,10 @@ class MySQLDialect(default.DefaultDialect): # preserves the original table/schema casing, but SHOW CREATE # TABLE does not. this problem is not in lower_case_table_names=1, # but use case-insensitive matching for these two modes in any case. + if self._casing in (1, 2): - lower = str.lower + def lower(s): + return s.lower() else: # if on case sensitive, there can be two tables referenced # with the same name different casing, so we need to use |
