summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-04-10 13:28:49 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-04-10 13:28:49 +0200
commitd7401d0319ff5b557be1e6878d29402622f8cfd2 (patch)
treedb8234b08757e92df316cf1cb348bc40cad4ed81
parentbceb66782e8289971cfe13c940b29d9eeb52a5c1 (diff)
downloadtracker-d7401d0319ff5b557be1e6878d29402622f8cfd2.tar.gz
libtracker-fts: Be lenient to non-existing fts tables when deleting them
A funny thing of moving the nao ontology is that we no longer define FTS properties in the core protocol, so it may be the case that simple ontologies built on top won't have that table de-facto anymore. This triggers errors on our ontology change tests, which does attempt to define FTS properties in an ontology update. This now fails because the tables weren't created in the first place, so attempting to drop and rebuild those fails on the first step.
-rw-r--r--src/libtracker-fts/tracker-fts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index 15743b00e..e470be4fe 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -177,14 +177,14 @@ tracker_fts_delete_table (sqlite3 *db,
gchar *query;
int rc;
- query = g_strdup_printf ("DROP VIEW fts_view");
+ query = g_strdup_printf ("DROP VIEW IF EXISTS fts_view");
rc = sqlite3_exec (db, query, NULL, NULL, NULL);
g_free (query);
if (rc == SQLITE_OK) {
- query = g_strdup_printf ("DROP TABLE \"%s\".%s",
+ query = g_strdup_printf ("DROP TABLE IF EXISTS \"%s\".%s",
database, table_name);
- sqlite3_exec (db, query, NULL, NULL, NULL);
+ rc = sqlite3_exec (db, query, NULL, NULL, NULL);
g_free (query);
}