Opened 5 years ago

Closed 4 years ago

Last modified 4 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: master
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 Changed 5 years ago by Tim Graham

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

comment:3 Changed 5 years ago by Tim Graham

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 Changed 5 years ago by Claude Paroz

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 Changed 5 years ago by F. Malina

That's backwards.

comment:6 Changed 5 years ago by Tim Graham

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 Changed 5 years ago by F. Malina

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 Changed 5 years ago by Tim Graham

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

PR from Claude looks good.

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

Resolution: fixed
Status: newclosed

In c47364ef:

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

Thanks František Malina for the report.

comment:10 Changed 4 years ago by Tim Graham

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 Changed 4 years ago by Tim Graham

Has patch: set
Triage Stage: Ready for checkinAccepted

comment:12 Changed 4 years ago by Tim Graham <timograham@…>

In 92f8820:

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

comment:13 Changed 4 years ago by Tim Graham <timograham@…>

In 734e2178:

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

Backport of 92f88206d0e05e9e833e6cd49f93cbd7b72b30ff from master

comment:14 Changed 4 years ago by Tim Graham

Resolution: fixed
Status: newclosed

comment:15 Changed 4 years ago by Tim Graham <timograham@…>

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 Changed 4 years ago by Tim Graham <timograham@…>

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