summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2016-06-24 15:34:15 +0500
committerTim Graham <timograham@gmail.com>2016-07-28 17:12:57 -0400
commit9805726ddcdef22c471fd8cf39e77f19b6937c28 (patch)
tree84c17b9b9829cda6bb5268fa242b5a126b168e9f
parent7997c650191d8e398628b203d57084b0e482ab84 (diff)
[1.10.x] Fixed #26657 -- Made GeomValue omit SRID for MySQL.
This fixes some test failures on MySQL 5.7+. Backport of 9031a4c13bdb1ee4d0f1253fcfcad73d26c25740 from master
-rw-r--r--django/contrib/gis/db/models/functions.py3
-rw-r--r--docs/releases/1.9.9.txt2
2 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/gis/db/models/functions.py b/django/contrib/gis/db/models/functions.py
index b98a2e134b..1a21a5164c 100644
--- a/django/contrib/gis/db/models/functions.py
+++ b/django/contrib/gis/db/models/functions.py
@@ -74,6 +74,9 @@ class GeomValue(Value):
def as_sql(self, compiler, connection):
return '%s(%%s, %s)' % (connection.ops.from_text, self.srid), [connection.ops.Adapter(self.value)]
+ def as_mysql(self, compiler, connection):
+ return '%s(%%s)' % (connection.ops.from_text), [connection.ops.Adapter(self.value)]
+
def as_postgresql(self, compiler, connection):
if self.geography:
self.value = connection.ops.Adapter(self.value, geography=self.geography)
diff --git a/docs/releases/1.9.9.txt b/docs/releases/1.9.9.txt
index 8e90f6c8dd..a777b17021 100644
--- a/docs/releases/1.9.9.txt
+++ b/docs/releases/1.9.9.txt
@@ -11,3 +11,5 @@ Bugfixes
* Fixed invalid HTML in template postmortem on the debug page
(:ticket:`26938`).
+
+* Fixed some GIS database function crashes on MySQL 5.7 (:ticket:`26657`).