1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[2.0.x] Fixed #28804 -- Fixed "Unknown system variable 'transaction_isolation'" on MariaDB.

Regression in 967450a3bf.

Backport of e3c852cbd6 from master
This commit is contained in:
Tim Graham
2017-11-18 07:43:58 -05:00
parent 385e06d8c0
commit 205290f510
2 changed files with 6 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ class IsolationLevelTests(TestCase):
read_committed = 'read committed'
repeatable_read = 'repeatable read'
isolation_values = {
level: level.replace(' ', '-').upper()
level: level.upper()
for level in (read_committed, repeatable_read)
}
@@ -38,8 +38,8 @@ class IsolationLevelTests(TestCase):
@staticmethod
def get_isolation_level(connection):
with connection.cursor() as cursor:
cursor.execute("SELECT @@session.%s" % connection.transaction_isolation_variable)
return cursor.fetchone()[0]
cursor.execute("SHOW VARIABLES WHERE variable_name IN ('transaction_isolation', 'tx_isolation')")
return cursor.fetchone()[1].replace('-', ' ')
def test_auto_is_null_auto_config(self):
query = 'set sql_auto_is_null = 0'