[tracker] libtracker-data: Cope for cardinality changes overwriting indices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Cope for cardinality changes overwriting indices
- Date: Sun, 26 Jul 2015 14:23:06 +0000 (UTC)
commit f013f61e05f4bc422a65782808c8aceacab0bd8e
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jul 26 13:30:04 2015 +0200
libtracker-data: Cope for cardinality changes overwriting indices
There's otherwise name collision between the old single-valued index
and the new multivalued table. The index for the multivalued table
will be created afterwards.
src/libtracker-data/tracker-data-manager.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 6a74f5f..4d7fb1f 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2625,6 +2625,12 @@ create_decomposed_metadata_property_table (TrackerDBInterface *iface,
g_propagate_error (error, internal_error);
goto error_out;
}
+ } else if (in_change && tracker_property_get_cardinality_changed (property)) {
+ /* We should be dropping all indices colliding with the new table name */
+ tracker_db_interface_execute_query (iface, &internal_error,
+ "DROP INDEX IF EXISTS \"%s_%s\"",
+ service_name,
+ field_name);
}
sql = g_string_new ("");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]