#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:1 by , 9 years ago
comment:2 by , 9 years ago
Easy pickings: | unset |
---|---|
Has patch: | set |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 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 , 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:6 by , 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 , 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 , 9 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
PR from Claude looks good.
comment:10 by , 8 years ago
Has patch: | unset |
---|---|
Resolution: | fixed |
Status: | closed → new |
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:14 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
PR https://github.com/django/django/pull/6038