Skip to content

core: Fix incompatibility introduced by SQLite 3.45.3

Carlos Garnacho requested to merge carlosg/tracker:wip/fix-sqlite-3.45.3 into master

For the umpteenth time, SQLite introduced behavioral changes that we need to adapt to. This time, version 3.45.3 "fixed" at https://github.com/sqlite/sqlite/commit/74851f66811854c772a9b2d0a13f1e9e82b69c25 their SQLITE_ALLOW_ROWID_IN_VIEW build-time option which controls the behavior of views having an implicit ROWID column vs not.

This broke our view used to proxy data to the content-less FTS5 table, since the SELECT query it translates to used a naked reference to ROWID that is now deemed "ambiguous" by SQLite engine, this results in the following errors:

Tracker:ERROR:../tests/core/tracker-ontology-test.c:231:test_query: assertion failed (error == NULL): ambiguous column name: ROWID (tracker-db-interface-error-quark, 0)

We are actually referencing data inside the SELECT query, so fix this ambiguity by stating clearly the table/column that we are referring to within the SELECT query clause. This is backwards compatible with older versions of SQLite.

Closes: #435 (closed)

Merge request reports