summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-04-26 15:02:37 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-04-26 15:02:37 -0400
commit3deff88fe12adc470792f71da7b9c54a5438638f (patch)
tree1517cee1b10f6ee233e52efdd7e8d8291d036df3
parent3da3322ec4f42b58ec8b07108f2dacd33044c73d (diff)
downloadsqlalchemy-3deff88fe12adc470792f71da7b9c54a5438638f.tar.gz
repair fetch_setting call in mysql pyodbc dialect
Fixed a regression in the untested MySQL PyODBC dialect caused by the fix for :ticket:`7518` in version 1.4.32 where an argument was being propagated incorrectly upon first connect, leading to a ``TypeError``. Fixes: #7871 Change-Id: I37f8ca8e83cb352ee2a2336b52863858259b1d77
-rw-r--r--doc/build/changelog/unreleased_14/7871.rst7
-rw-r--r--lib/sqlalchemy/dialects/mysql/pyodbc.py2
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_14/7871.rst b/doc/build/changelog/unreleased_14/7871.rst
new file mode 100644
index 000000000..e2b8e9769
--- /dev/null
+++ b/doc/build/changelog/unreleased_14/7871.rst
@@ -0,0 +1,7 @@
+.. change::
+ :tags: bug, mysql, regression
+ :tickets: 7871
+
+ Fixed a regression in the untested MySQL PyODBC dialect caused by the fix
+ for :ticket:`7518` in version 1.4.32 where an argument was being propagated
+ incorrectly upon first connect, leading to a ``TypeError``.
diff --git a/lib/sqlalchemy/dialects/mysql/pyodbc.py b/lib/sqlalchemy/dialects/mysql/pyodbc.py
index 22d60bd15..aa2190bf4 100644
--- a/lib/sqlalchemy/dialects/mysql/pyodbc.py
+++ b/lib/sqlalchemy/dialects/mysql/pyodbc.py
@@ -89,7 +89,7 @@ class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect):
# If it's decided that issuing that sort of SQL leaves you SOL, then
# this can prefer the driver value.
try:
- value = self._fetch_setting("character_set_client")
+ value = self._fetch_setting(connection, "character_set_client")
if value:
return value
except exc.DBAPIError: