Opened 9 years ago

Closed 8 years ago

Last modified 8 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 by Tim Graham, 9 years ago

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 by Claude Paroz, 9 years ago

Sorry, no clue :-(

comment:3 by Sergey Fedoseev, 9 years ago

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 by Tim Graham, 9 years ago

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 by Sergey Fedoseev, 9 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:6 by Sergey Fedoseev, 9 years ago

Has patch: set

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

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

comment:7 by Sergey Fedoseev, 8 years ago

Has patch: unset

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

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

comment:8 by Sergey Fedoseev, 8 years ago

Has patch: set

comment:9 by Tim Graham, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:10 by Tim Graham <timograham@…>, 8 years ago

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

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

In 4178488:

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

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

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

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