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
6e4e0f4c
Kaydet (Commit)
6e4e0f4c
authored
Eyl 29, 2016
tarafından
Mariusz Felisiak
Kaydeden (comit)
Tim Graham
Eki 01, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #26541 -- Allowed MySQL transaction detection to work without table creation.
üst
fa2f55cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
features.py
django/db/backends/mysql/features.py
+7
-0
test_features.py
tests/backends/test_features.py
+18
-1
No files found.
django/db/backends/mysql/features.py
Dosyayı görüntüle @
6e4e0f4c
...
@@ -78,3 +78,10 @@ class DatabaseFeatures(BaseDatabaseFeatures):
...
@@ -78,3 +78,10 @@ class DatabaseFeatures(BaseDatabaseFeatures):
cursor
.
execute
(
'SELECT @@SQL_AUTO_IS_NULL'
)
cursor
.
execute
(
'SELECT @@SQL_AUTO_IS_NULL'
)
result
=
cursor
.
fetchone
()
result
=
cursor
.
fetchone
()
return
result
and
result
[
0
]
==
1
return
result
and
result
[
0
]
==
1
@cached_property
def
supports_transactions
(
self
):
"""
All storage engines except MyISAM support transactions.
"""
return
self
.
_mysql_storage_engine
!=
'MyISAM'
tests/backends/test_features.py
Dosyayı görüntüle @
6e4e0f4c
from
unittest
import
skipUnless
from
django.db
import
connection
from
django.db
import
connection
from
django.test
import
TestCase
from
django.test
import
TestCase
,
mock
class
TestDatabaseFeatures
(
TestCase
):
class
TestDatabaseFeatures
(
TestCase
):
def
test_nonexistent_feature
(
self
):
def
test_nonexistent_feature
(
self
):
self
.
assertFalse
(
hasattr
(
connection
.
features
,
'nonexistent'
))
self
.
assertFalse
(
hasattr
(
connection
.
features
,
'nonexistent'
))
@skipUnless
(
connection
.
vendor
==
'mysql'
,
'MySQL backend tests'
)
class
TestMySQLFeatures
(
TestCase
):
def
test_mysql_supports_transactions
(
self
):
"""
All storage engines except MyISAM support transactions.
"""
with
mock
.
patch
(
'django.db.connection.features._mysql_storage_engine'
,
'InnoDB'
):
self
.
assertTrue
(
connection
.
features
.
supports_transactions
)
del
connection
.
features
.
supports_transactions
with
mock
.
patch
(
'django.db.connection.features._mysql_storage_engine'
,
'MyISAM'
):
self
.
assertFalse
(
connection
.
features
.
supports_transactions
)
del
connection
.
features
.
supports_transactions
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