#32935: Test suite fails with sqlite 3.36 and spatialite 5.
-----------------------------------------+------------------------
Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
When looking at support for GDAL3.3 I was having issues getting the test
suite to pass. The table below shows the scenarios I tried, I was able to
get the suite to pass with spatialite 4.3 but unable to get it to pass
with 5.0 until I dropped the sqlite version.
||= Python =||= sqlite =|| spatialite || GDAL || GEOS || Proj || Tests ||
|| 3.8.10 || 3.36.0 || 4.3.0a || 3.1.2 || 3.8.1 || 7.1.0 || PASS ||
|| 3.9.6 || 3.36.0 || 5.0.1 || 3.2.0 || 3.8.1 || 7.1.1 || FAIL ||
|| 3.9.6 || 3.36.0 || 5.0.1 || 3.3.1 || 3.9.1 || 8.0.1 || FAIL ||
|| 3.8.10 || 3.36.0 || 5.0.1 || 3.3.0 || 3.9.1 || 8.0.1 || FAIL ||
|| 3.9.6 || 3.36.0 || 5.0.1 || 3.2.2 || 3.9.1 || 8.0.0 || FAIL ||
|| 3.8.10 || 3.36.0 || 5.0.1 || 3.2.2 || 3.9.1 || 8.0.0 || FAIL ||
|| 3.9.2 || 3.35.0 || 5.0.1 || 3.2.2 || 3.9.1 || 8.0.0 || PASS ||
The tests were failing not for a GIS test, but on databse setup. For
exampe I had the same failure when runing the tests for `admin_inlines`.
The tests fail when setting up the database with this error.
{{{
File "/workspaces/django/django/db/backends/sqlite3/base.py", line 417, in
execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: error in trigger
ISO_metadata_reference_row_id_value_insert: no such column: rowid
}}}
At this point of failure `query` is `ALTER TABLE "new__django_admin_log"
RENAME TO "django_admin_log"`
I found that if I changed this
[https://github.com/django/django/blame/a56531ab1b772ee4ae94dd805f168761887354c6/django/contrib/gis/db/backends/spatialite/base.py#L77
line] back to the same behaviour as spatialite 4x then the suite will
pass.
I note that the [https://www.sqlite.org/draft/releaselog/current.html
release notes] for sqlite 3.36 say the following, which I'm assuming is
the cause of the issue here.
> An error is raised on any attempt to access the rowid of a VIEW or
subquery.
--
Ticket URL: <https://code.djangoproject.com/ticket/32935>
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/051.d31fb1ab206266df8aac4c0b941afcda%40djangoproject.com.