summaryrefslogtreecommitdiff
path: root/src/libtracker-data
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2015-07-20 00:36:01 +0200
committerCarlos Garnacho <carlosg@gnome.org>2015-07-21 23:09:06 +0200
commitae3ab553d0e5faf0dadc85586dac0c0ee4443394 (patch)
tree58f86c471f4f6a4befbe366fb8b2dbe56cceac78 /src/libtracker-data
parent3eecd6f1bcadd7b9d46220ca111e91e8daf83822 (diff)
downloadtracker-ae3ab553d0e5faf0dadc85586dac0c0ee4443394.tar.gz
libtracker-data: delete elements from the Resource table
On deletion, items with an specific row ID are removed from all tables but the Resources one, which holds the urn:uuid:... mappings. The deletion of that table lead to confusions in the fts_view view and ultimately the FTS table, as both will indirectly depend on the elements stored there, so the deleted rows still had FTS representation, just filled with nulls. This looks like was just forgotten, if it was there to cover constraint errors, it'll be better to just open the pandora box, and fix the bugs we receive. Anyhow, from testing most common scenarios it works alright.
Diffstat (limited to 'src/libtracker-data')
-rw-r--r--src/libtracker-data/tracker-data-update.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index a83036bc1..6779ebf3b 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2213,6 +2213,10 @@ cache_delete_resource_type_full (TrackerClass *class,
/* delete row from class table */
db_delete_row (iface, tracker_class_get_name (class), resource_buffer->id);
+ if (strcmp (tracker_class_get_uri (class), TRACKER_PREFIX_RDFS "Resource") == 0) {
+ db_delete_row (iface, "Resource", resource_buffer->id);
+ }
+
if (!single_type) {
/* delete row from rdfs:Resource_rdf:type table */
/* this is not necessary when deleting the whole resource