Django

Code

Ticket #13967 (closed: fixed)

Opened 2 months ago

Last modified 2 months ago

GeoDjango always creates SPATIAL INDEXES when using MySQL

Reported by: sfllaw Assigned to: jbronn
Milestone: 1.3 Component: GIS
Version: 1.2 Keywords:
Cc: simon@akoha.com Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

If you are using MySQL, with the following model, GeoDjango will always create a spatial index for the point field:

from django.contrib.gis.db import models


class Places(models.Model):
    point = models.PointField(spatial_index=False)

This is because MySQLCreation.sql_indexes_for_field() does not check if it should do the work, unlike the other backends.

Included is a patch.

Attachments

mysql-spatial-index.patch (0.6 kB) - added by sfllaw on 07/20/10 10:41:58.

Change History

07/20/10 10:41:58 changed by sfllaw

  • attachment mysql-spatial-index.patch added.

07/20/10 13:34:18 changed by jbronn

  • status changed from new to assigned.
  • needs_better_patch changed.
  • needs_tests changed.
  • milestone set to 1.3.
  • owner changed from nobody to jbronn.
  • needs_docs changed.

07/21/10 10:23:19 changed by jbronn

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [13443]) Fixed #13967 -- MySQL spatial backend now respects when spatial_index=False. Thanks, Simon Law, for bug report and patch.

07/21/10 10:28:06 changed by jbronn

(In [13444]) [1.2.X] Fixed #13967 -- MySQL spatial backend now respects when spatial_index=False. Thanks, Simon Law, for bug report and patch.

Backport of r13443 from trunk.


Add/Change #13967 (GeoDjango always creates SPATIAL INDEXES when using MySQL)




Change Properties
Action