Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e3c852cb
Unverified
Kaydet (Commit)
e3c852cb
authored
Kas 20, 2017
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Kas 20, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28804 -- Fixed "Unknown system variable 'transaction_isolation'" on MariaDB.
Regression in
967450a3
.
üst
244cc401
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
base.py
django/db/backends/mysql/base.py
+3
-10
tests.py
tests/backends/mysql/tests.py
+3
-3
No files found.
django/db/backends/mysql/base.py
Dosyayı görüntüle @
e3c852cb
...
...
@@ -221,9 +221,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
isolation_level
,
', '
.
join
(
"'
%
s'"
%
s
for
s
in
sorted
(
self
.
isolation_levels
))
))
# The variable assignment form of setting transaction isolation
# levels will be used, e.g. "set transaction_isolation='repeatable-read'".
isolation_level
=
isolation_level
.
replace
(
' '
,
'-'
)
self
.
isolation_level
=
isolation_level
kwargs
.
update
(
options
)
return
kwargs
...
...
@@ -231,10 +228,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
def
get_new_connection
(
self
,
conn_params
):
return
Database
.
connect
(
**
conn_params
)
@cached_property
def
transaction_isolation_variable
(
self
):
return
'tx_isolation'
if
self
.
mysql_version
<
(
5
,
7
,
20
)
else
'transaction_isolation'
def
init_connection_state
(
self
):
assignments
=
[]
if
self
.
features
.
is_sql_auto_is_null_enabled
:
...
...
@@ -242,14 +235,14 @@ class DatabaseWrapper(BaseDatabaseWrapper):
# a recently inserted row will return when the field is tested
# for NULL. Disabling this brings this aspect of MySQL in line
# with SQL standards.
assignments
.
append
(
'SQL_AUTO_IS_NULL = 0'
)
assignments
.
append
(
'S
ET S
QL_AUTO_IS_NULL = 0'
)
if
self
.
isolation_level
:
assignments
.
append
(
"
%
s = '
%
s'"
%
(
self
.
transaction_isolation_variable
,
self
.
isolation_level
))
assignments
.
append
(
'SET SESSION TRANSACTION ISOLATION LEVEL
%
s'
%
self
.
isolation_level
.
upper
(
))
if
assignments
:
with
self
.
cursor
()
as
cursor
:
cursor
.
execute
(
'
SET '
+
',
'
.
join
(
assignments
))
cursor
.
execute
(
'
;
'
.
join
(
assignments
))
def
create_cursor
(
self
,
name
=
None
):
cursor
=
self
.
connection
.
cursor
()
...
...
tests/backends/mysql/tests.py
Dosyayı görüntüle @
e3c852cb
...
...
@@ -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
(
"S
ELECT @@session.
%
s"
%
connection
.
transaction_isolation_variable
)
return
cursor
.
fetchone
()[
0
]
cursor
.
execute
(
"S
HOW 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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment