[tracker/IorR-null-support] libtracker-data: Allow null upfront a new set for multivalue properties



commit c1bf8369f38fc45c302024d8f8df8fe40b44acaf
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Aug 10 10:45:45 2011 +0200

    libtracker-data: Allow null upfront a new set for multivalue properties
    
    When null deletes a set of a multivalue property, then the buffer must
    be flushed. Else the merging in the buffer might make things go wrong.

 src/libtracker-data/tracker-data-update.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 20836a8..314222c 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -3072,7 +3072,7 @@ tracker_data_update_statement (const gchar            *graph,
 	property = tracker_ontologies_get_property_by_uri (predicate);
 	if (property != NULL) {
 		if (object == NULL) {
-			
+			GError *new_error = NULL;
 			if (property == tracker_ontologies_get_rdf_type ()) {
 				g_set_error (error, TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_UNSUPPORTED,
 				             "Using 'null' with '%s' is not supported", predicate);
@@ -3080,6 +3080,10 @@ tracker_data_update_statement (const gchar            *graph,
 			}
 
 			delete_all_objects (graph, subject, predicate, error);
+			tracker_data_update_buffer_flush (&new_error);
+			if (new_error) {
+				g_propagate_error (error, new_error);
+			}
 		} else {
 			if (tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_RESOURCE) {
 				tracker_data_update_statement_with_uri (graph, subject, predicate, object, error);



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