Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#26134 closed Cleanup/optimization (fixed)

Update MySQL GIS function names to OpenGIS standard.

Reported by: F. Malina Owned by: nobody
Component: GIS Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Fix MySQL deprecation warnings such as:
.../django/db/backends/mysql/base.py:112:
Warning: 'GEOMFROMTEXT' is deprecated and will be removed in a future release. Please use ST_GEOMFROMTEXT instead
...
Warning: 'ASTEXT' is deprecated and will be removed in a future release. Please use ST_ASTEXT instead

Change History (16)

comment:2 by Tim Graham, 9 years ago

Easy pickings: unset
Has patch: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:3 by Tim Graham, 9 years ago

As noted on the pull request, "The new GIS aliases exist from MySQL 5.6." While MySQL 5.5 doesn't reach end-of-life until Dec 2018, it might be okay to drop GIS support for MySQL 5.5 now -- especially because we're not testing that combination now. Any other opinions? Should we write to the geodjango mailing list about it?

comment:4 by Claude Paroz, 9 years ago

Patch needs improvement: set

A strong -1 from me to drop MySQL GIS for 5.5. Debian stable still has MySQL 5.5.
It might be possible to define the names as properties and set the value depending on the MySQL version.

comment:5 by F. Malina, 9 years ago

That's backwards.

comment:6 by Tim Graham, 9 years ago

I don't understand that last comment. Claude's proposal makes sense to me.

Alternatively, we wait until we can drop support for MySQL 5.5 -- as long as we don't have to support any new versions of MySQL that drop support for the old aliases -- and live with those warnings for now.

comment:7 by F. Malina, 9 years ago

Linking the file in question: https://github.com/django/django/blob/master/django/contrib/gis/db/backends/mysql/operations.py

There is already code checking self.connection.mysql_version. I see how @cached_property could be used to set value depending on MySQL version, but I don't have any need to support MySQL 5.5 myself and wouldn't want to encrust the code in barnacles.

comment:8 by Tim Graham, 9 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

PR from Claude looks good.

comment:9 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In c47364ef:

Fixed #26134 -- Used new OpenGIS names for recent MySQL

Thanks František Malina for the report.

comment:10 by Tim Graham, 9 years ago

Has patch: unset
Resolution: fixed
Status: closednew

I think this isn't complete. I still see warnings such as:

  • 'NUMPOINTS' is deprecated and will be removed in a future release. Please use ST_NUMPOINTS instead
  • 'NUMGEOMETRIES' is deprecated and will be removed in a future release. Please use ST_NUMGEOMETRIES instead
  • 'ENVELOPE' is deprecated and will be removed in a future release. Please use ST_ENVELOPE instead
  • 'CENTROID' is deprecated and will be removed in a future release. Please use ST_CENTROID instead
  • 'AREA' is deprecated and will be removed in a future release. Please use ST_AREA instead

This might not be a complete list of what needs to be fixed.

comment:11 by Tim Graham, 9 years ago

Has patch: set
Triage Stage: Ready for checkinAccepted

comment:12 by Tim Graham <timograham@…>, 9 years ago

In 92f8820:

Refs #26134 -- Updated deprecated MySQL GIS function names.

comment:13 by Tim Graham <timograham@…>, 9 years ago

In 734e2178:

[1.10.x] Refs #26134 -- Updated deprecated MySQL GIS function names.

Backport of 92f88206d0e05e9e833e6cd49f93cbd7b72b30ff from master

comment:14 by Tim Graham, 9 years ago

Resolution: fixed
Status: newclosed

comment:15 by Tim Graham <timograham@…>, 9 years ago

In 9c3fbf5:

Used SQL from DB backend in GeomValue.

This avoids the deprecated GeomFromText on MySQL (refs #26134).

Thanks Claude Paroz for the review.

comment:16 by Tim Graham <timograham@…>, 9 years ago

In f94f4db0:

[1.10.x] Used SQL from DB backend in GeomValue.

This avoids the deprecated GeomFromText on MySQL (refs #26134).

Thanks Claude Paroz for the review.

Backport of 9c3fbf5423367cdcf1a30a411793919d86f5288c from master

Note: See TracTickets for help on using tickets.
Back to Top