[Django] #27964: on MySQL geometry with other SRID is saved silently in DB

27 views
Skip to first unread message

Django

unread,
Mar 20, 2017, 9:01:13 AM3/20/17
to django-...@googlegroups.com
#27964: on MySQL geometry with other SRID is saved silently in DB
-------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
models.py:
{{{
class City(models.Model):
point = models.PointField(srid=4326)
}}}

on PostGIS:
{{{
In [1]: from test_app.models import City
In [2]: from django.contrib.gis.geos import Point
In [3]: c = City.objects.create(point=Point(1, 1, srid=3857))
In [7]: c.refresh_from_db()
In [9]: print(c.point)
SRID=4326;POINT (8.983152841195214e-06 8.983152840993819e-06)
}}}

on MySQL:
{{{
In [1]: from test_app.models import City
In [2]: from django.contrib.gis.geos import Point
In [3]: c = City.objects.create(point=Point(1, 1, srid=3857))
In [4]: c.refresh_from_db()
In [5]: print(c.point)
SRID=4326;POINT (1 1)
}}}

I think that more appropriate behavior is to raise some error.

--
Ticket URL: <https://code.djangoproject.com/ticket/27964>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 20, 2017, 9:01:21 AM3/20/17
to django-...@googlegroups.com
#27964: on MySQL geometry with other SRID is saved silently in DB
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
| Fedoseev
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* owner: nobody => Sergey Fedoseev
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27964#comment:1>

Django

unread,
Mar 20, 2017, 11:54:06 AM3/20/17
to django-...@googlegroups.com
#27964: Raise an error if a MySQL geometry with an unsupported SRID is saved to the
database

-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted
* type: Bug => Cleanup/optimization


Comment:

Probably a mention in the backwards incompatible changes section of the
release notes would be a good idea.

--
Ticket URL: <https://code.djangoproject.com/ticket/27964#comment:2>

Django

unread,
Jun 26, 2017, 8:07:28 AM6/26/17
to django-...@googlegroups.com
#27964: Raise an error if a MySQL geometry with an unsupported SRID is saved to the
database
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: GIS | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/8676 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/27964#comment:3>

Django

unread,
Jun 26, 2017, 3:32:08 PM6/26/17
to django-...@googlegroups.com
#27964: Raise an error if a MySQL geometry with an unsupported SRID is saved to the
database
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: closed
Component: GIS | Version: 1.8
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"44a7b98abbec02f1a4f35662040f602fd616d0cd" 44a7b98a]:
{{{
#!CommitTicketReference repository=""
revision="44a7b98abbec02f1a4f35662040f602fd616d0cd"
Fixed #27964 -- Made MySQL backend raise exception if spatial
transformation is needed for query.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27964#comment:4>

Reply all
Reply to author
Forward
0 new messages