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
(cherry picked from commit
49197c7b36573d91b015019d4635071f9da1c216)