Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#26657 closed Bug (fixed)

MySQL 5.7 GIS test failures: InterfaceError: (-1, 'error totally whack')

Reported by: Tim Graham Owned by: Sergey Fedoseev
Component: GIS Version: 1.9
Severity: Normal Keywords:
Cc: Claude Paroz Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Not sure if it's a Django issue, but the following tests fail with InterfaceError: (-1, 'error totally whack'). The commonality seems to be that these are all new functions in MySQL 5.6.

gis_tests.distapp.tests.DistanceFunctionsTests.test_distance_simple
gis_tests.distapp.tests.DistanceFunctionsTests.test_distance_order_by
gis_tests.geoapp.test_functions.GISFunctionsTests.test_union
gis_tests.geoapp.test_functions.GISFunctionsTests.test_sym_difference
gis_tests.geoapp.test_functions.GISFunctionsTests.test_intersection
gis_tests.geoapp.test_functions.GISFunctionsTests.test_difference
gis_tests.geoapp.test_functions.GISFunctionsTests.test_diff_intersection_union

Change History (14)

comment:1 Changed 7 years ago by Tim Graham

Cc: Claude Paroz added

From the MySQL 5.7 release notes:

The ST_Buffer(), ST_Difference(), ST_Distance(), ST_Intersection(), ST_IsSimple(), ST_SymDifference(), and ST_Union() functions have been reimplemented to use the functionality available in Boost.Geometry. The functions may raise an exception for invalid geometry argument values when the previous implementation may not have.

An example failing query from gis_tests.geoapp.test_functions.GISFunctionsTests.test_union:

SELECT geoapp_city.id, geoapp_city.name,
AsText(geoapp_city.point),
AsText(ST_Union(geoapp_city.point, GeomFromText('POINT (-95.3631510000000020 29.7633739999999989)', 4326))) AS union
FROM geoapp_city
WHERE geoapp_city.name = 'Dallas'

A minimal query to reproduce is:

SELECT ST_Union(geoapp_city.point, ST_GeomFromText('POINT (-95.3631510 29.763373999)', 4326)) FROM geoapp_city

Any advice, Claude?

comment:2 Changed 7 years ago by Claude Paroz

Sorry, no clue :-(

comment:3 Changed 7 years ago by Sergey Fedoseev

SRID of geometry from the table is 0, SRID of the given point is 4326, MySQL requires arguments to have the same SRID.

comment:4 Changed 7 years ago by Tim Graham

Not sure I understand. For the union test, City.objects.get(name='Dallas').point.srid gives 4326 which is the same as the Point in the test. If you are able, feel free to send a patch, Sergey.

comment:5 Changed 7 years ago by Sergey Fedoseev

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:6 Changed 7 years ago by Sergey Fedoseev

Has patch: set

PR contains only the partial solution because existing geometries have SRID 0 and will cause a crash.

Last edited 7 years ago by Sergey Fedoseev (previous) (diff)

comment:7 Changed 7 years ago by Sergey Fedoseev

Has patch: unset

It seems that I figure out a better solution to the problem.

Last edited 7 years ago by Sergey Fedoseev (previous) (diff)

comment:8 Changed 7 years ago by Sergey Fedoseev

Has patch: set

comment:9 Changed 7 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:10 Changed 7 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 9031a4c1:

Fixed #26657 -- Made GeomValue omit SRID for MySQL.

This fixes some test failures on MySQL 5.7+.

comment:11 Changed 7 years ago by Tim Graham <timograham@…>

In 9805726:

[1.10.x] Fixed #26657 -- Made GeomValue omit SRID for MySQL.

This fixes some test failures on MySQL 5.7+.

Backport of 9031a4c13bdb1ee4d0f1253fcfcad73d26c25740 from master

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

In 4178488:

Refs #26657 -- Fixed a crash induced by invalid WKT returned by MySQL 5.7.5+.

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

In 3771019d:

[1.9.x] Fixed #26657 -- Made GeomValue omit SRID for MySQL.

This fixes some test failures on MySQL 5.7+.

Backport of 9031a4c13bdb1ee4d0f1253fcfcad73d26c25740 from master

comment:14 Changed 7 years ago by Tim Graham <timograham@…>

In 25581e6:

[1.10.x] Refs #26657 -- Fixed a crash induced by invalid WKT returned by MySQL 5.7.5+.

Backport of 4178488881f4e703c4e47ea78720dd61e0230ce5 from master

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