[tracker/wip/carlosg/tracker-3.0-api-breaks: 98/100] libtracker-data: Remove unneeded DB consistency check
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/tracker-3.0-api-breaks: 98/100] libtracker-data: Remove unneeded DB consistency check
- Date: Mon, 17 Feb 2020 18:17:03 +0000 (UTC)
commit 278d61d6fca0730639364b66a562305fc358de10
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Feb 17 16:20:15 2020 +0100
libtracker-data: Remove unneeded DB consistency check
This check was added in place to detect refcounting issues (due to
past database bugs) and trigger a reindex if needed. Those issues
were already fixed, and a reindex is definitely coming, so this
DB consistency check is no longer useful.
src/libtracker-data/tracker-data-manager.c | 36 ------------------------------
1 file changed, 36 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 7a71922c7..fe653b4a8 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -4121,32 +4121,6 @@ update_interface_cb (TrackerDBManager *db_manager,
}
}
-static gboolean
-check_db_consistency (TrackerDBInterface *iface)
-{
- TrackerDBStatement *stmt;
- TrackerDBCursor *cursor = NULL;
- gboolean is_inconsistent = FALSE;
-
- stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_SELECT, NULL,
- "SELECT ID FROM \"rdfs:Resource\" "
- "EXCEPT "
- "SELECT ID FROM Resource "
- "LIMIT 1");
-
- if (stmt) {
- cursor = tracker_db_statement_start_cursor (stmt, NULL);
- g_object_unref (stmt);
- }
-
- if (cursor) {
- is_inconsistent = tracker_db_cursor_iter_next (cursor, NULL, NULL);
- g_object_unref (cursor);
- }
-
- return !is_inconsistent;
-}
-
static gboolean
tracker_data_manager_initable_init (GInitable *initable,
GCancellable *cancellable,
@@ -4210,16 +4184,6 @@ tracker_data_manager_initable_init (GInitable *initable,
iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
- if (!read_only && !check_db_consistency (iface)) {
- g_set_error (error,
- TRACKER_DATA_ONTOLOGY_ERROR,
- TRACKER_DATA_UNSUPPORTED_LOCATION,
- "Database is inconsistent, reindexing from scratch");
-
- tracker_db_manager_remove_all (manager->db_manager);
- return FALSE;
- }
-
if (manager->ontology_location &&
g_file_query_file_type (manager->ontology_location, G_FILE_QUERY_INFO_NONE, NULL) !=
G_FILE_TYPE_DIRECTORY) {
gchar *uri;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]