From c92c8f8dab8486955cb46048f065bc86f3bb3085 Mon Sep 17 00:00:00 2001 From: Gerben Jan Dijkman Date: Sun, 9 Jan 2022 14:15:31 +0100 Subject: [PATCH] Trying to patch --- .../files/2.3.6-sqlite-3.34-compat.patch | 45 +++++++++++++++++++ app-misc/tracker/tracker-3.2.1.ebuild | 1 + 2 files changed, 46 insertions(+) create mode 100644 app-misc/tracker/files/2.3.6-sqlite-3.34-compat.patch diff --git a/app-misc/tracker/files/2.3.6-sqlite-3.34-compat.patch b/app-misc/tracker/files/2.3.6-sqlite-3.34-compat.patch new file mode 100644 index 0000000..cdbfe2f --- /dev/null +++ b/app-misc/tracker/files/2.3.6-sqlite-3.34-compat.patch @@ -0,0 +1,45 @@ +From 29a6650f698bbd449e11fc0481269cd8f0593f27 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Thu, 10 Dec 2020 03:55:08 +0100 +Subject: [PATCH] libtracker-data: Avoid deletion of empty rows in FTS table + +Starting with SQLite 3.34.0, this turns into a consistency error. Ensure +rows being deleted have actually some content before proceeding to deletion, +and ensure we don't process individual properties one by one in the course +of a whole rdfs:Resource deletion. + +Fixes: https://bugs.archlinux.org/task/68903 +--- + src/libtracker-data/tracker-data-update.c | 1 + + src/libtracker-data/tracker-db-interface-sqlite.c | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c +index e2f46685e..19cae25f9 100644 +--- a/src/libtracker-data/tracker-data-update.c ++++ b/src/libtracker-data/tracker-data-update.c +@@ -2244,6 +2244,7 @@ cache_delete_resource_type_full (TrackerData *data, + g_hash_table_size (data->resource_buffer->tables) == 0) { + #if HAVE_TRACKER_FTS + tracker_db_interface_sqlite_fts_delete_id (iface, data->resource_buffer->id); ++ data->resource_buffer->fts_updated = TRUE; + #endif + /* skip subclass query when deleting whole resource + to improve performance */ +diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c +index da88080ed..cdeb960e7 100644 +--- a/src/libtracker-data/tracker-db-interface-sqlite.c ++++ b/src/libtracker-data/tracker-db-interface-sqlite.c +@@ -1770,7 +1770,8 @@ tracker_db_interface_sqlite_fts_create_delete_all_query (TrackerDBInterface *db_ + g_string_append_printf (insert_str, + "INSERT INTO fts5 (fts5, rowid %s) " + "SELECT 'delete', rowid %s FROM fts_view " +- "WHERE rowid = ?", ++ "WHERE rowid = ? AND COALESCE(NULL %s) IS NOT NULL", ++ db_interface->fts_properties, + db_interface->fts_properties, + db_interface->fts_properties); + return g_string_free (insert_str, FALSE); +-- +2.32.0 + diff --git a/app-misc/tracker/tracker-3.2.1.ebuild b/app-misc/tracker/tracker-3.2.1.ebuild index f19bea1..696e03b 100644 --- a/app-misc/tracker/tracker-3.2.1.ebuild +++ b/app-misc/tracker/tracker-3.2.1.ebuild @@ -51,6 +51,7 @@ PDEPEND="miners? ( >=app-misc/tracker-miners-${PV_SERIES} )" PATCHES=( "${FILESDIR}"/${PN}-3.1.1-Fix-asciidoc-manpage.xsl-location.patch + "${FILESDIR}"/2.3.6-sqlite-3.34-compat.patch ) function inotify_enabled() {