Skip to content

Commit

Permalink
Merge pull request #580 from Sergei-Rudenkov/issue-579
Browse files Browse the repository at this point in the history
issue #579. @@tx_isolation is deprecated since MYSQL 5.7.20
  • Loading branch information
liquidpele authored Aug 12, 2019
2 parents ae23b51 + 24aa68d commit 3a104b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion djcelery/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def store_result(self, task_id, result, status,
def warn_if_repeatable_read(self):
if 'mysql' in self.current_engine().lower():
cursor = self.connection_for_read().cursor()
if cursor.execute('SELECT @@tx_isolation'):
if self._is_mysql and self.server_version_info >= (5, 7, 20):
ti = cursor.execute("SELECT @@transaction_isolation")
else:
ti = cursor.execute("SELECT @@tx_isolation")
if ti:
isolation = cursor.fetchone()[0]
if isolation == 'REPEATABLE-READ':
warnings.warn(TxIsolationWarning(
Expand Down

0 comments on commit 3a104b6

Please sign in to comment.