From: Mike Bayer Date: Tue, 26 Apr 2022 19:02:37 +0000 (-0400) Subject: repair fetch_setting call in mysql pyodbc dialect X-Git-Tag: rel_1_4_36~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0653db2583b7a4bac1b50021c0956dcec740780;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 (cherry picked from commit 3deff88fe12adc470792f71da7b9c54a5438638f) --- diff --git a/doc/build/changelog/unreleased_14/7871.rst b/doc/build/changelog/unreleased_14/7871.rst new file mode 100644 index 0000000000..e2b8e9769f --- /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 22d60bd153..aa2190bf46 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: