Accepting request 660015 from GNOME:Next
- Extend tracker-sqlte-3.25-rename-tables.patch with two more commits: + libtracker-data: Update FTS if base tables were altered + libtracker-data: Reset property table name on cardinality changes OBS-URL: https://build.opensuse.org/request/show/660015 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/tracker?expand=0&rev=165
This commit is contained in:
parent
83eaa504da
commit
fa878b00b9
@ -25,10 +25,10 @@ https://gitlab.gnome.org/GNOME/tracker/issues/40
|
||||
src/libtracker-fts/tracker-fts.h | 2 +
|
||||
5 files changed, 107 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
|
||||
index 4fab66824..87c9b486f 100644
|
||||
--- a/src/libtracker-data/tracker-data-manager.c
|
||||
+++ b/src/libtracker-data/tracker-data-manager.c
|
||||
Index: tracker-2.1.6/src/libtracker-data/tracker-data-manager.c
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-data/tracker-data-manager.c
|
||||
+++ tracker-2.1.6/src/libtracker-data/tracker-data-manager.c
|
||||
@@ -135,6 +135,12 @@ enum {
|
||||
N_PROPS
|
||||
};
|
||||
@ -42,7 +42,7 @@ index 4fab66824..87c9b486f 100644
|
||||
static void tracker_data_manager_initable_iface_init (GInitableIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (TrackerDataManager, tracker_data_manager, G_TYPE_OBJECT,
|
||||
@@ -3681,6 +3687,9 @@ tracker_data_ontology_import_into_db (TrackerDataManager *manager,
|
||||
@@ -3681,6 +3687,9 @@ tracker_data_ontology_import_into_db (Tr
|
||||
TrackerProperty **properties;
|
||||
guint i, n_props, n_classes;
|
||||
gboolean base_tables_altered = FALSE;
|
||||
@ -52,13 +52,13 @@ index 4fab66824..87c9b486f 100644
|
||||
|
||||
iface = tracker_db_manager_get_writable_db_interface (manager->db_manager);
|
||||
|
||||
@@ -3691,6 +3700,15 @@ tracker_data_ontology_import_into_db (TrackerDataManager *manager,
|
||||
@@ -3691,6 +3700,15 @@ tracker_data_ontology_import_into_db (Tr
|
||||
return;
|
||||
}
|
||||
|
||||
+#if HAVE_TRACKER_FTS
|
||||
+ if (in_update) {
|
||||
+ update_fts = tracker_data_manager_fts_changed (manager);
|
||||
+ if (base_tables_altered || in_update) {
|
||||
+ update_fts = base_tables_altered | tracker_data_manager_fts_changed (manager);
|
||||
+
|
||||
+ if (update_fts)
|
||||
+ tracker_db_interface_sqlite_fts_delete_table (iface);
|
||||
@ -68,7 +68,7 @@ index 4fab66824..87c9b486f 100644
|
||||
/* create tables */
|
||||
for (i = 0; i < n_classes; i++) {
|
||||
GError *internal_error = NULL;
|
||||
@@ -3740,6 +3758,14 @@ tracker_data_ontology_import_into_db (TrackerDataManager *manager,
|
||||
@@ -3740,6 +3758,14 @@ tracker_data_ontology_import_into_db (Tr
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -83,7 +83,7 @@ index 4fab66824..87c9b486f 100644
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -3942,13 +3968,44 @@ load_ontologies_gvdb (TrackerDataManager *manager,
|
||||
@@ -3942,13 +3968,44 @@ load_ontologies_gvdb (TrackerDataManager
|
||||
|
||||
#if HAVE_TRACKER_FTS
|
||||
static gboolean
|
||||
@ -130,7 +130,7 @@ index 4fab66824..87c9b486f 100644
|
||||
guint i, len;
|
||||
|
||||
properties = tracker_ontologies_get_properties (manager->ontologies, &len);
|
||||
@@ -3960,16 +4017,10 @@ ontology_get_fts_properties (TrackerDataManager *manager,
|
||||
@@ -3960,16 +4017,10 @@ ontology_get_fts_properties (TrackerData
|
||||
const gchar *name, *table_name;
|
||||
GList *list;
|
||||
|
||||
@ -147,7 +147,7 @@ index 4fab66824..87c9b486f 100644
|
||||
table_name = tracker_property_get_table_name (properties[i]);
|
||||
name = tracker_property_get_name (properties[i]);
|
||||
list = g_hash_table_lookup (*fts_properties, table_name);
|
||||
@@ -3986,8 +4037,6 @@ ontology_get_fts_properties (TrackerDataManager *manager,
|
||||
@@ -3986,8 +4037,6 @@ ontology_get_fts_properties (TrackerData
|
||||
list = g_list_append (list, (gpointer) name);
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ index 4fab66824..87c9b486f 100644
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4001,29 +4050,36 @@ rebuild_fts_tokens (TrackerDataManager *manager,
|
||||
@@ -4001,29 +4050,36 @@ rebuild_fts_tokens (TrackerDataManager *
|
||||
/* Update the stamp file */
|
||||
tracker_db_manager_tokenizer_update (manager->db_manager);
|
||||
}
|
||||
@ -200,7 +200,7 @@ index 4fab66824..87c9b486f 100644
|
||||
GFile *
|
||||
tracker_data_manager_get_cache_location (TrackerDataManager *manager)
|
||||
{
|
||||
@@ -4279,8 +4335,6 @@ tracker_data_manager_initable_init (GInitable *initable,
|
||||
@@ -4279,8 +4335,6 @@ tracker_data_manager_initable_init (GIni
|
||||
tracker_data_ontology_import_into_db (manager, FALSE,
|
||||
&internal_error);
|
||||
|
||||
@ -209,7 +209,7 @@ index 4fab66824..87c9b486f 100644
|
||||
if (internal_error) {
|
||||
g_propagate_error (error, internal_error);
|
||||
return FALSE;
|
||||
@@ -4371,7 +4425,9 @@ tracker_data_manager_initable_init (GInitable *initable,
|
||||
@@ -4371,7 +4425,9 @@ tracker_data_manager_initable_init (GIni
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ index 4fab66824..87c9b486f 100644
|
||||
}
|
||||
|
||||
if (!read_only) {
|
||||
@@ -4630,17 +4686,6 @@ tracker_data_manager_initable_init (GInitable *initable,
|
||||
@@ -4630,17 +4686,6 @@ tracker_data_manager_initable_init (GIni
|
||||
}
|
||||
|
||||
if (update_nao) {
|
||||
@ -237,15 +237,14 @@ index 4fab66824..87c9b486f 100644
|
||||
update_ontology_last_modified (manager, iface, ontology, &n_error);
|
||||
|
||||
if (n_error) {
|
||||
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
index dbecce9e5..9a8a5c302 100644
|
||||
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
@@ -1656,6 +1656,14 @@ tracker_db_interface_sqlite_fts_init (TrackerDBInterface *db_interface,
|
||||
|
||||
Index: tracker-2.1.6/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
+++ tracker-2.1.6/src/libtracker-data/tracker-db-interface-sqlite.c
|
||||
@@ -1648,6 +1648,14 @@ tracker_db_interface_sqlite_fts_init (Tr
|
||||
#if HAVE_TRACKER_FTS
|
||||
|
||||
+void
|
||||
void
|
||||
+tracker_db_interface_sqlite_fts_delete_table (TrackerDBInterface *db_interface)
|
||||
+{
|
||||
+ if (!tracker_fts_delete_table (db_interface->db, "fts5")) {
|
||||
@ -253,14 +252,15 @@ index dbecce9e5..9a8a5c302 100644
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
+void
|
||||
tracker_db_interface_sqlite_fts_alter_table (TrackerDBInterface *db_interface,
|
||||
GHashTable *properties,
|
||||
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.h b/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
index 8ae70fd42..45eb5fd7c 100644
|
||||
--- a/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
+++ b/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
@@ -61,6 +61,8 @@ gboolean tracker_db_interface_sqlite_wal_checkpoint (TrackerD
|
||||
GHashTable *multivalued)
|
||||
Index: tracker-2.1.6/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
+++ tracker-2.1.6/src/libtracker-data/tracker-db-interface-sqlite.h
|
||||
@@ -59,6 +59,8 @@ gboolean tracker_db_interface
|
||||
|
||||
|
||||
#if HAVE_TRACKER_FTS
|
||||
@ -269,15 +269,14 @@ index 8ae70fd42..45eb5fd7c 100644
|
||||
void tracker_db_interface_sqlite_fts_alter_table (TrackerDBInterface *interface,
|
||||
GHashTable *properties,
|
||||
GHashTable *multivalued);
|
||||
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
|
||||
index 3c550ca41..49ba4d362 100644
|
||||
--- a/src/libtracker-fts/tracker-fts.c
|
||||
+++ b/src/libtracker-fts/tracker-fts.c
|
||||
@@ -157,6 +157,26 @@ tracker_fts_create_table (sqlite3 *db,
|
||||
return (rc == SQLITE_OK);
|
||||
Index: tracker-2.1.6/src/libtracker-fts/tracker-fts.c
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-fts/tracker-fts.c
|
||||
+++ tracker-2.1.6/src/libtracker-fts/tracker-fts.c
|
||||
@@ -158,6 +158,26 @@ tracker_fts_create_table (sqlite3 *db
|
||||
}
|
||||
|
||||
+gboolean
|
||||
gboolean
|
||||
+tracker_fts_delete_table (sqlite3 *db,
|
||||
+ gchar *table_name)
|
||||
+{
|
||||
@ -297,9 +296,10 @@ index 3c550ca41..49ba4d362 100644
|
||||
+ return rc == SQLITE_OK;
|
||||
+}
|
||||
+
|
||||
gboolean
|
||||
+gboolean
|
||||
tracker_fts_alter_table (sqlite3 *db,
|
||||
gchar *table_name,
|
||||
GHashTable *tables,
|
||||
@@ -168,18 +188,6 @@ tracker_fts_alter_table (sqlite3 *db,
|
||||
|
||||
tmp_name = g_strdup_printf ("%s_TMP", table_name);
|
||||
@ -319,11 +319,11 @@ index 3c550ca41..49ba4d362 100644
|
||||
if (!tracker_fts_create_table (db, tmp_name, tables, grouped_columns)) {
|
||||
g_free (tmp_name);
|
||||
return FALSE;
|
||||
diff --git a/src/libtracker-fts/tracker-fts.h b/src/libtracker-fts/tracker-fts.h
|
||||
index 751014f38..3bda8cf98 100644
|
||||
--- a/src/libtracker-fts/tracker-fts.h
|
||||
+++ b/src/libtracker-fts/tracker-fts.h
|
||||
@@ -36,6 +36,8 @@ gboolean tracker_fts_create_table (sqlite3 *db,
|
||||
Index: tracker-2.1.6/src/libtracker-fts/tracker-fts.h
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-fts/tracker-fts.h
|
||||
+++ tracker-2.1.6/src/libtracker-fts/tracker-fts.h
|
||||
@@ -36,6 +36,8 @@ gboolean tracker_fts_create_table
|
||||
gchar *table_name,
|
||||
GHashTable *tables,
|
||||
GHashTable *grouped_columns);
|
||||
@ -332,7 +332,15 @@ index 751014f38..3bda8cf98 100644
|
||||
gboolean tracker_fts_alter_table (sqlite3 *db,
|
||||
gchar *table_name,
|
||||
GHashTable *tables,
|
||||
--
|
||||
2.18.1
|
||||
|
||||
|
||||
Index: tracker-2.1.6/src/libtracker-data/tracker-property.c
|
||||
===================================================================
|
||||
--- tracker-2.1.6.orig/src/libtracker-data/tracker-property.c
|
||||
+++ tracker-2.1.6/src/libtracker-data/tracker-property.c
|
||||
@@ -1050,6 +1050,7 @@ tracker_property_set_multiple_values (Tr
|
||||
priv = GET_PRIV (property);
|
||||
|
||||
priv->multiple_values = value;
|
||||
+ g_clear_pointer (&priv->table_name, g_free);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 19 13:27:05 UTC 2018 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
- Extend tracker-sqlte-3.25-rename-tables.patch with two more
|
||||
commits:
|
||||
+ libtracker-data: Update FTS if base tables were altered
|
||||
+ libtracker-data: Reset property table name on cardinality
|
||||
changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 8 14:13:28 UTC 2018 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user