[tracker/ontology-cope] libtracker-data: Bugfixes coping with ontology changes in journal replay



commit 074b08746099dcc70d56731ae8f1a5bf0ca0e828
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Mar 22 14:37:13 2010 +0100

    libtracker-data: Bugfixes coping with ontology changes in journal replay

 src/libtracker-data/tracker-data-manager.c |   21 +++++++++++++++++----
 src/libtracker-data/tracker-data-update.c  |    2 +-
 2 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index c521be1..e68bbd8 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1349,9 +1349,23 @@ create_decomposed_transient_metadata_tables (TrackerDBInterface *iface)
 static void
 create_fts_table (TrackerDBInterface *iface)
 {
+	GError *error = NULL;
 	gchar *query = tracker_fts_get_create_fts_table_query ();
 
-	tracker_db_interface_execute_query (iface, NULL, "%s", query);
+	tracker_db_interface_execute_query (iface, &error, "%s", query);
+
+	if (error != NULL) {
+		g_critical ("%s", error->message);
+		g_clear_error (&error);
+	}
+
+	/* ensure FTS is fully initialized */
+	tracker_db_interface_execute_query (iface, &error, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
+
+	if (error != NULL) {
+		g_critical ("%s", error->message);
+		g_clear_error (&error);
+	}
 
 	g_free (query);
 }
@@ -1397,6 +1411,8 @@ tracker_data_ontology_import_into_db (gboolean is_new)
 
 	if (!is_new)
 		create_fts_table (iface);
+	else
+		tracker_db_interface_execute_query (iface, NULL, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
 
 	/* insert classes into rdfs:Resource table and set all classes to not new */
 	for (i = 0; i < n_classes; i++) {
@@ -1554,9 +1570,6 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		/* load ontology from journal into memory */
 		load_ontology_from_journal (&classes, &properties, &id_uri_map);
 
-		/* ensure FTS is fully initialized */
-		tracker_db_interface_execute_query (iface, NULL, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
-
 		tracker_data_begin_db_transaction_for_replay (tracker_db_journal_reader_get_time ());
 		tracker_data_ontology_import_into_db (FALSE);
 		tracker_data_commit_db_transaction ();
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index c83c012..02de762 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2286,7 +2286,7 @@ ontology_transaction_end (GList *ontology_queue)
 		                                         queued->predicate, 
 		                                         queued->object, 
 		                                         queued->is_uri, 
-		                                         FALSE, TRUE);
+		                                         TRUE, TRUE);
 
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]