From 6ec0f97e37140666a929c36de45802c12a0f76a5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 2 Mar 2018 15:08:08 -0500 Subject: Get MySQL version info from @@version MySQL dialects now query the server version using ``SELECT @@version`` explicitly to the server to ensure we are getting the correct version information back. Proxy servers like MaxScale interfere with the value that is passed to the DBAPI's connection.server_version value so this is no longer reliable. Change-Id: Iafd39be8c9bf1982d58b34cc997ae1016ad6c48c Fixes: #4205 (cherry picked from commit 9ba77e8d3b682bff89fdab5e80271a96a52fe8c8) (cherry picked from commit 5c1ebbc3706c810f936d9e252ee5d16800e561ea) --- lib/sqlalchemy/dialects/mysql/mysqldb.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'lib/sqlalchemy/dialects/mysql/mysqldb.py') diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index 33cbd8f3a..3da64a491 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -173,17 +173,6 @@ class MySQLDialect_mysqldb(MySQLDialect): opts['client_flag'] = client_flag return [[], opts] - def _get_server_version_info(self, connection): - dbapi_con = connection.connection - version = [] - r = re.compile(r'[.\-]') - for n in r.split(dbapi_con.get_server_info()): - try: - version.append(int(n)) - except ValueError: - version.append(n) - return tuple(version) - def _extract_error_code(self, exception): return exception.args[0] -- cgit v1.2.1