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
c28bf990
Kaydet (Commit)
c28bf990
authored
Kas 18, 2017
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #29548 -- Fixed GIS tests on MariaDB
üst
a07a49ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
introspection.py
django/contrib/gis/db/backends/mysql/introspection.py
+6
-5
operations.py
django/contrib/gis/db/backends/mysql/operations.py
+8
-6
tests.py
tests/gis_tests/inspectapp/tests.py
+4
-2
No files found.
django/contrib/gis/db/backends/mysql/introspection.py
Dosyayı görüntüle @
c28bf990
...
...
@@ -29,9 +29,10 @@ class MySQLIntrospection(DatabaseIntrospection):
return
field_type
,
field_params
def
supports_spatial_index
(
self
,
cursor
,
table_name
):
# Supported with MyISAM
, or InnoDB on MySQL 5.7.5
+
# Supported with MyISAM
/Aria, or InnoDB on MySQL 5.7.5+/MariaDB 10.2.2
+
storage_engine
=
self
.
get_storage_engine
(
cursor
,
table_name
)
return
(
(
storage_engine
==
'InnoDB'
and
self
.
connection
.
mysql_version
>=
(
5
,
7
,
5
))
or
storage_engine
==
'MyISAM'
)
if
storage_engine
==
'InnoDB'
:
return
self
.
connection
.
mysql_version
>=
(
(
10
,
2
,
2
)
if
self
.
connection
.
mysql_is_mariadb
else
(
5
,
7
,
5
)
)
return
storage_engine
in
(
'MyISAM'
,
'Aria'
)
django/contrib/gis/db/backends/mysql/operations.py
Dosyayı görüntüle @
c28bf990
...
...
@@ -19,10 +19,6 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
Adapter
=
WKTAdapter
@cached_property
def
is_mysql_5_6
(
self
):
return
self
.
connection
.
mysql_version
<
(
5
,
7
,
6
)
@cached_property
def
select
(
self
):
return
self
.
geom_func_prefix
+
'AsBinary(
%
s)'
...
...
@@ -33,7 +29,9 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
@cached_property
def
gis_operators
(
self
):
MBREquals
=
'MBREqual'
if
self
.
is_mysql_5_6
else
'MBREquals'
MBREquals
=
'MBREqual'
if
(
self
.
connection
.
mysql_is_mariadb
or
self
.
connection
.
mysql_version
<
(
5
,
7
,
6
)
)
else
'MBREquals'
return
{
'bbcontains'
:
SpatialOperator
(
func
=
'MBRContains'
),
# For consistency w/PostGIS API
'bboverlaps'
:
SpatialOperator
(
func
=
'MBROverlaps'
),
# ...
...
...
@@ -62,7 +60,11 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
'MemSize'
,
'Perimeter'
,
'PointOnSurface'
,
'Reverse'
,
'Scale'
,
'SnapToGrid'
,
'Transform'
,
'Translate'
,
}
if
self
.
connection
.
mysql_version
<
(
5
,
7
,
5
):
if
self
.
connection
.
mysql_is_mariadb
:
unsupported
.
update
({
'GeoHash'
,
'IsValid'
})
if
self
.
connection
.
mysql_version
<
(
10
,
2
,
4
):
unsupported
.
add
(
'AsGeoJSON'
)
elif
self
.
connection
.
mysql_version
<
(
5
,
7
,
5
):
unsupported
.
update
({
'AsGeoJSON'
,
'GeoHash'
,
'IsValid'
})
return
unsupported
...
...
tests/gis_tests/inspectapp/tests.py
Dosyayı görüntüle @
c28bf990
...
...
@@ -141,8 +141,10 @@ class OGRInspectTest(TestCase):
else
:
self
.
assertIn
(
' f_decimal = models.DecimalField(max_digits=0, decimal_places=0)'
,
model_def
)
self
.
assertIn
(
' f_int = models.IntegerField()'
,
model_def
)
self
.
assertIn
(
' f_datetime = models.DateTimeField()'
,
model_def
)
self
.
assertIn
(
' f_time = models.TimeField()'
,
model_def
)
if
connection
.
vendor
!=
'mysql'
or
not
connection
.
mysql_is_mariadb
:
# Probably a bug between GDAL and MariaDB on time fields.
self
.
assertIn
(
' f_datetime = models.DateTimeField()'
,
model_def
)
self
.
assertIn
(
' f_time = models.TimeField()'
,
model_def
)
if
connection
.
vendor
==
'sqlite'
:
self
.
assertIn
(
' f_float = models.CharField(max_length=0)'
,
model_def
)
else
:
...
...
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