[tracker/sparql-update] libtracker-data: No support for REPLACE with multi value properties for now
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/sparql-update] libtracker-data: No support for REPLACE with multi value properties for now
- Date: Wed, 9 Mar 2011 12:58:35 +0000 (UTC)
commit c222b2b72f8a151d61ec0e964f9f11c935d8856b
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Mar 9 13:58:09 2011 +0100
libtracker-data: No support for REPLACE with multi value properties for now
src/libtracker-data/tracker-data-update.c | 57 ++---------------------------
1 files changed, 3 insertions(+), 54 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 98309aa..f95723e 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -775,63 +775,12 @@ tracker_data_resource_buffer_flush (GError **error)
if (table->update_value) {
- g_critical ("Unimplemented feature, SPARQL REPLACE for multi-value");
+ g_set_error (error, TRACKER_SPARQL_ERROR, TRACKER_SPARQL_ERROR_UNSUPPORTED,
+ "REPLACE used with multi value property `%s'",
+ property->name);
return;
- stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE, &actual_error,
- "DELETE FROM \"%s\" WHERE ID = ?",
- table_name);
-
- param = 0;
- tracker_db_statement_bind_int (stmt, param++, resource_buffer->id);
-
- tracker_db_statement_execute (stmt, &actual_error);
- g_object_unref (stmt);
-
- if (actual_error) {
- g_propagate_error (error, actual_error);
- return;
- }
-
- /* TODO: loop over set */
- for (y = 0; y < 0; y++) {
- if (property->date_time) {
- stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE, &actual_error,
- "INSERT OR IGNORE INTO \"%s\" (ID, \"%s\", \"%s:localDate\", \"%s:localTime\", \"%s:graph\") VALUES (?, ?, ?, ?, ?)",
- table_name,
- property->name,
- property->name,
- property->name,
- property->name);
- } else {
- stmt = tracker_db_interface_create_statement (iface, TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE, &actual_error,
- "INSERT OR IGNORE INTO \"%s\" (ID, \"%s\", \"%s:graph\") VALUES (?, ?, ?)",
- table_name,
- property->name,
- property->name);
- }
-
- param = 0;
-
- tracker_db_statement_bind_int (stmt, param++, resource_buffer->id);
- /* TODO: add values[i]
- statement_bind_gvalue (stmt, ¶m, &property->values[i]); */
-
- if (property->graph != 0) {
- tracker_db_statement_bind_int (stmt, param++, property->graph);
- } else {
- tracker_db_statement_bind_null (stmt, param++);
- }
-
- tracker_db_statement_execute (stmt, &actual_error);
- g_object_unref (stmt);
-
- if (actual_error) {
- g_propagate_error (error, actual_error);
- return;
- }
- }
} else {
if (table->delete_value) {
/* delete rows for multiple value properties */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]