[tracker] SPARQL: Fix INSERT/DELETE with WHERE pattern without variables



commit aacd5297a1c0ba92afe3169a71e1ba9f5e750d63
Author: Jürg Billeter <j bitron ch>
Date:   Wed Nov 24 09:53:01 2010 +0100

    SPARQL: Fix INSERT/DELETE with WHERE pattern without variables

 src/libtracker-data/tracker-sparql-query.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 5472d89..7e80770 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -645,6 +645,8 @@ public class Tracker.Sparql.Query : Object {
 			context = pattern.translate_group_graph_pattern (pattern_sql);
 		} else {
 			context = new Context (this);
+
+			pattern_sql.append ("SELECT 1");
 		}
 
 		var after_where = get_location ();
@@ -667,13 +669,13 @@ public class Tracker.Sparql.Query : Object {
 
 		if (first) {
 			sql.append ("1");
-		} else {
-			// select from results of WHERE clause
-			sql.append (" FROM (");
-			sql.append (pattern_sql.str);
-			sql.append (")");
 		}
 
+		// select from results of WHERE clause
+		sql.append (" FROM (");
+		sql.append (pattern_sql.str);
+		sql.append (")");
+
 		var result_set = exec_sql (sql.str);
 
 		this.delete_statements = delete_statements;



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