From 9805726ddcdef22c471fd8cf39e77f19b6937c28 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 24 Jun 2016 15:34:15 +0500 Subject: [PATCH] [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 --- django/contrib/gis/db/models/functions.py | 3 +++ docs/releases/1.9.9.txt | 2 ++ 2 files changed, 5 insertions(+) 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`).