diff options
| author | Tim Graham <timograham@gmail.com> | 2020-11-14 09:08:30 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-13 09:22:44 +0100 |
| commit | e3ece0144a988bc522c4bd551baecaf2139ce4ed (patch) | |
| tree | 03d6fdb1099fccfa0663c358cdd4955a74fec434 /django | |
| parent | 9f91122ed85c07247038c3d6cbc1a1c3fd909ed6 (diff) | |
Removed redundant database vendor helpers in gis_tests/utils.py.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/db/backends/base/operations.py | 1 | ||||
| -rw-r--r-- | django/contrib/gis/db/backends/mysql/operations.py | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/django/contrib/gis/db/backends/base/operations.py b/django/contrib/gis/db/backends/base/operations.py index 2956fa3c9a..84b1785a1c 100644 --- a/django/contrib/gis/db/backends/base/operations.py +++ b/django/contrib/gis/db/backends/base/operations.py @@ -12,6 +12,7 @@ class BaseSpatialOperations: # an attribute for the spatial database version tuple (if applicable) postgis = False spatialite = False + mariadb = False mysql = False oracle = False spatial_version = None diff --git a/django/contrib/gis/db/backends/mysql/operations.py b/django/contrib/gis/db/backends/mysql/operations.py index e5000e99fa..3ca609f6c4 100644 --- a/django/contrib/gis/db/backends/mysql/operations.py +++ b/django/contrib/gis/db/backends/mysql/operations.py @@ -12,14 +12,20 @@ from django.utils.functional import cached_property class MySQLOperations(BaseSpatialOperations, DatabaseOperations): - - mysql = True name = 'mysql' geom_func_prefix = 'ST_' Adapter = WKTAdapter @cached_property + def mariadb(self): + return self.connection.mysql_is_mariadb + + @cached_property + def mysql(self): + return not self.connection.mysql_is_mariadb + + @cached_property def select(self): return self.geom_func_prefix + 'AsBinary(%s)' |
