[tracker/ontology-cope] libtracker-data: Deal with cruel SQLite FTS



commit 837cca30522dd41fa268095e2e7b9a1e26dc0018
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Mar 22 15:41:33 2010 +0100

    libtracker-data: Deal with cruel SQLite FTS

 src/libtracker-data/tracker-data-manager.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index a06408a..30e4a55 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1397,6 +1397,7 @@ tracker_data_ontology_import_into_db (gboolean is_new)
 	TrackerClass **classes;
 	TrackerProperty **properties;
 	gint i, n_props, n_classes;
+	GError *error = NULL;
 
 	iface = tracker_db_manager_get_db_interface ();
 
@@ -1417,13 +1418,24 @@ tracker_data_ontology_import_into_db (gboolean is_new)
 	 * on the next sqlite3_step call. As we do not use the SQL layer for FTS
 	 * updates, we need to ensure that the virtual table is initialized */
 
-	tracker_db_interface_execute_query (iface, NULL, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
+	tracker_db_interface_execute_query (iface, &error, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
+
+	if (error) {
+		g_critical ("%s", error->message);
+		g_clear_error (&error);
+	}
 
 	/* insert classes into rdfs:Resource table */
 	for (i = 0; i < n_classes; i++) {
 		if (tracker_class_get_is_new (classes[i]) == is_new) {
 			insert_uri_in_resource_table (iface, tracker_class_get_uri (classes[i]),
 			                              tracker_class_get_id (classes[i]));
+			tracker_db_interface_execute_query (iface, &error, "SELECT 1 FROM fulltext.fts WHERE rowid = 0");
+
+			if (error) {
+				g_critical ("%s", error->message);
+				g_clear_error (&error);
+			}
 		}
 	}
 



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