Skip to content

Commit 3a104b6

Browse files
authored
Merge pull request #580 from Sergei-Rudenkov/issue-579
issue #579. @@tx_isolation is deprecated since MYSQL 5.7.20
2 parents ae23b51 + 24aa68d commit 3a104b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

djcelery/managers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ def store_result(self, task_id, result, status,
189189
def warn_if_repeatable_read(self):
190190
if 'mysql' in self.current_engine().lower():
191191
cursor = self.connection_for_read().cursor()
192-
if cursor.execute('SELECT @@tx_isolation'):
192+
if self._is_mysql and self.server_version_info >= (5, 7, 20):
193+
ti = cursor.execute("SELECT @@transaction_isolation")
194+
else:
195+
ti = cursor.execute("SELECT @@tx_isolation")
196+
if ti:
193197
isolation = cursor.fetchone()[0]
194198
if isolation == 'REPEATABLE-READ':
195199
warnings.warn(TxIsolationWarning(

0 commit comments

Comments
 (0)