From 7127eb287fb08b89a31bc97097a1fb6b08ada463 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Sat, 31 Oct 2015 08:02:19 +0500 Subject: Fixed #25659 -- Added missing support for MySQL 5.6.1 GIS functions Added support for ST_Difference/ST_Intersection/ST_SymDifference. --- django/contrib/gis/db/backends/mysql/operations.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'django') diff --git a/django/contrib/gis/db/backends/mysql/operations.py b/django/contrib/gis/db/backends/mysql/operations.py index cfd780022f..de64bc95db 100644 --- a/django/contrib/gis/db/backends/mysql/operations.py +++ b/django/contrib/gis/db/backends/mysql/operations.py @@ -34,8 +34,11 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations): } function_names = { + 'Difference': 'ST_Difference', 'Distance': 'ST_Distance', + 'Intersection': 'ST_Intersection', 'Length': 'GLength', + 'SymDifference': 'ST_SymDifference', 'Union': 'ST_Union', } @@ -48,12 +51,12 @@ class MySQLOperations(BaseSpatialOperations, DatabaseOperations): def unsupported_functions(self): unsupported = { 'AsGeoJSON', 'AsGML', 'AsKML', 'AsSVG', 'BoundingCircle', - 'Difference', 'ForceRHR', 'GeoHash', 'Intersection', 'MemSize', + 'ForceRHR', 'GeoHash', 'MemSize', 'Perimeter', 'PointOnSurface', 'Reverse', 'Scale', 'SnapToGrid', - 'SymDifference', 'Transform', 'Translate', + 'Transform', 'Translate', } if self.connection.mysql_version < (5, 6, 1): - unsupported.update({'Distance', 'Union'}) + unsupported.update({'Difference', 'Distance', 'Intersection', 'SymDifference', 'Union'}) return unsupported def geo_db_type(self, f): -- cgit v1.3