[tracker/tracker-0.10] libtracker-data: Check for domain in support for REPLACE
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] libtracker-data: Check for domain in support for REPLACE
- Date: Wed, 30 Mar 2011 16:06:18 +0000 (UTC)
commit f7064afbe6d43850f933acfb23dad40e247324dd
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Mar 10 17:52:07 2011 +0100
libtracker-data: Check for domain in support for REPLACE
src/libtracker-data/tracker-data-update.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 6a31624..f1a2f21 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2659,6 +2659,14 @@ tracker_data_update_statement_with_uri (const gchar *graph,
gboolean multiple_values;
GError *new_error = NULL;
+ if (!check_property_domain (property)) {
+ g_set_error (error, TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_CONSTRAINT,
+ "Subject `%s' is not in domain `%s' of property `%s'",
+ resource_buffer->subject,
+ tracker_class_get_name (tracker_property_get_domain (property)),
+ tracker_property_get_name (property));
+ }
+
multiple_values = tracker_property_get_multiple_values (property);
/* We can disable correct object-id for deletes array here */
@@ -2777,6 +2785,14 @@ tracker_data_update_statement_with_string (const gchar *graph,
return;
}
+ if (!check_property_domain (property)) {
+ g_set_error (error, TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_CONSTRAINT,
+ "Subject `%s' is not in domain `%s' of property `%s'",
+ resource_buffer->subject,
+ tracker_class_get_name (tracker_property_get_domain (property)),
+ tracker_property_get_name (property));
+ }
+
/* add or update value to metadata database */
change = cache_update_metadata_decomposed (property, object, 0, graph, 0, &actual_error);
if (actual_error) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]