[tracker] SPARQL: Fix multiple updates with WHERE clause in single query
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] SPARQL: Fix multiple updates with WHERE clause in single query
- Date: Thu, 10 Sep 2009 11:14:26 +0000 (UTC)
commit 756d5bfea95afaf5ac318c31e5fd1512b77c5bac
Author: Jürg Billeter <j bitron ch>
Date: Thu Sep 10 13:05:34 2009 +0200
SPARQL: Fix multiple updates with WHERE clause in single query
src/libtracker-data/libtracker-data.vapi | 1 +
src/libtracker-data/tracker-data-update.c | 2 +-
src/libtracker-data/tracker-data-update.h | 1 +
src/libtracker-data/tracker-sparql-query.vala | 4 ++++
4 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index 0f39712..c04d30b 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -35,6 +35,7 @@ namespace Tracker {
public void insert_statement_with_uri (string subject, string predicate, string object) throws DataError;
public void insert_statement_with_string (string subject, string predicate, string object) throws DataError;
public void delete_resource_description (string uri);
+ public void update_buffer_flush ();
}
}
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 46f810e..f21d1fe 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -331,7 +331,7 @@ statement_bind_gvalue (TrackerDBStatement *stmt,
}
}
-static void
+void
tracker_data_update_buffer_flush (void)
{
TrackerDBInterface *iface;
diff --git a/src/libtracker-data/tracker-data-update.h b/src/libtracker-data/tracker-data-update.h
index bd713f5..9bd06e8 100644
--- a/src/libtracker-data/tracker-data-update.h
+++ b/src/libtracker-data/tracker-data-update.h
@@ -69,6 +69,7 @@ void tracker_data_commit_transaction (void);
void tracker_data_update_sparql (const gchar *update,
GError **error);
+void tracker_data_update_buffer_flush (void);
/* Volume handling */
void tracker_data_update_enable_volume (const gchar *udi,
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index b300c41..67db012 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -868,6 +868,10 @@ public class Tracker.SparqlQuery : Object {
// reset location to the end of the update
set_location (after_where);
+
+ // ensure possible WHERE clause in next part gets the correct results
+ Data.update_buffer_flush ();
+ bindings = null;
}
void execute_drop_graph () throws Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]