summaryrefslogtreecommitdiff
path: root/app-misc/tracker/files/3.6.0-sqlite-3.45.3-compat.patch
blob: 72e37c83068cbec490f13bf90d48b6e7d5f385c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 0c576af6df5af2f1b8df9841fbb566fa52a4e382 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 18 Apr 2024 14:18:08 +0200
Subject: [PATCH] core: Fix incompatibility introduced by SQLite 3.45.3

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: https://gitlab.gnome.org/GNOME/tracker/-/issues/435
---
 src/libtracker-sparql/core/tracker-fts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libtracker-sparql/core/tracker-fts.c b/src/libtracker-sparql/core/tracker-fts.c
index 1171dc11a8..99600820bd 100644
--- a/src/libtracker-sparql/core/tracker-fts.c
+++ b/src/libtracker-sparql/core/tracker-fts.c
@@ -112,7 +112,7 @@ tracker_fts_create_table (sqlite3            *db,
 
 	g_string_append_printf (from, "WHERE COALESCE (%s NULL) IS NOT NULL ",
 	                        column_names->str);
-	g_string_append (from, "GROUP BY ROWID");
+	g_string_append (from, "GROUP BY \"rdfs:Resource\".ID");
 	g_string_append (str, from->str);
 	g_string_free (from, TRUE);
 
-- 
GitLab