#33047: CheckConstraint crashes with GIS lookup and PostGIS backend.
-------------------------------------+-------------------------------------
Reporter: Daniel Swain | Owner: Arsalan
| Ghassemi
Type: Bug | Status: assigned
Component: GIS | Version: 3.2
Severity: Normal | Resolution:
Keywords: constraint, | Triage Stage: Accepted
postgres, postgis, geos, |
attributeerror, migration, |
schema_editor, getquoted, |
quote_value |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Arsalan Ghassemi):
PR (work in progress) : https://github.com/django/django/pull/15130
With current changes the build fails on mysql_gis :
database=mysql_gis,label=mariadb,python=python3.10
Error :
MySQLdb._exceptions.OperationalError: (1583, "Incorrect parameters in the
call to native function 'ST_GeomFromText'")
database=mysql_gis,label=bionic-pr,python=python3.10
database=mysql_gis,label=bionic-pr,python=python3.8
database=mysql_gis,label=bionic-pr,python=python3.9
Error :
MySQLdb._exceptions.OperationalError: (1583, "Incorrect parameters in the
call to native function 'st_geometryfromtext'")
It seems like the parameter given to the function
"ST_GeomFromText"/"st_geometryfromtext" is invalid. I looked at the
Polygon assertions in the MySQL documentation and the values I've put in
the regression test migration seems not to be a valid Polygon for MySQL :
Polygon Assertions
The boundary of a Polygon consists of a set of LinearRing objects
(that is, LineString objects that are both simple and closed) that make up
its exterior and interior boundaries.
A Polygon has no rings that cross. The rings in the boundary of a
Polygon may intersect at a Point, but only as a tangent.
A Polygon has no lines, spikes, or punctures.
A Polygon has an interior that is a connected point set.
A Polygon may have holes. The exterior of a Polygon with holes is not
connected. Each hole defines a connected component of the exterior.
I think I'm not testing the patch correctly but I'm not sure how to do a
regression test for it (since adding the new test migration was making the
test fail before the patch). Any help would be appreciated :)
--
Ticket URL: <https://code.djangoproject.com/ticket/33047#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.828f161386649a8180d9841a0d3865e0%40djangoproject.com.