[tracker/subqueries] SPARQL: Fix literal bindings in select expressions



commit 8773515ae2379347775aade4b77f9aa66ccf2617
Author: Jürg Billeter <j bitron ch>
Date:   Fri Dec 4 19:08:08 2009 +0100

    SPARQL: Fix literal bindings in select expressions

 src/libtracker-data/tracker-sparql-query.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 2049ae9..cb73a55 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -736,6 +736,8 @@ public class Tracker.SparqlQuery : Object {
 				}
 			}
 		} else {
+			var old_bindings = (owned) bindings;
+
 			while (true) {
 				if (!first) {
 					sql.append (", ");
@@ -760,6 +762,11 @@ public class Tracker.SparqlQuery : Object {
 				}
 				break;
 			}
+
+			// literals in select expressions need to be bound before literals in the where clause
+			foreach (var binding in old_bindings) {
+				bindings.append (binding);
+			}
 		}
 
 		// select from results of WHERE clause



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