--- /dev/null
+.. change::
+ :tags: bug, mysql
+ :tickets: 4120
+ :versions: 1.2.0b4
+
+ MySQL 5.7.20 now warns for use of the @tx_isolation variable; a version
+ check is now performed and uses @transaction_isolation instead
+ to prevent this warning.
def get_isolation_level(self, connection):
cursor = connection.cursor()
- cursor.execute('SELECT @@tx_isolation')
+ if self._is_mysql and self.server_version_info >= (5, 7, 20):
+ cursor.execute('SELECT @@transaction_isolation')
+ else:
+ cursor.execute('SELECT @@tx_isolation')
val = cursor.fetchone()[0]
cursor.close()
if util.py3k and isinstance(val, bytes):
def _is_mariadb(self):
return 'MariaDB' in self.server_version_info
+ @property
+ def _is_mysql(self):
+ return 'MariaDB' not in self.server_version_info
+
@property
def _is_mariadb_102(self):
return self._is_mariadb and \