#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.121bbca56edd1ebca83d267c0bdc88ef%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to