[tracker] SPARQL: Always generate SELECT around group graph pattern



commit 30e6dfe0594e6b080cb32a9b4e11953e10a34c63
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jun 8 15:41:55 2010 +0200

    SPARQL: Always generate SELECT around group graph pattern
    
    Without extra SELECT, invalid SQL may be generated for certain FILTER
    clauses.

 src/libtracker-data/tracker-sparql-pattern.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-pattern.vala b/src/libtracker-data/tracker-sparql-pattern.vala
index 008faf0..810b76d 100644
--- a/src/libtracker-data/tracker-sparql-pattern.vala
+++ b/src/libtracker-data/tracker-sparql-pattern.vala
@@ -944,7 +944,10 @@ class Tracker.Sparql.Pattern : Object {
 
 				if (!in_triples_block && !in_group_graph_pattern) {
 					in_group_graph_pattern = true;
+
+					sql.insert (group_graph_pattern_start, "SELECT * FROM (");
 					translate_group_or_union_graph_pattern (sql);
+					sql.append (")");
 				} else {
 					if (in_triples_block) {
 						end_triples_block (sql, ref first_where, in_group_graph_pattern);
@@ -965,7 +968,10 @@ class Tracker.Sparql.Pattern : Object {
 			} else if (current () == SparqlTokenType.OPEN_BRACE) {
 				if (!in_triples_block && !in_group_graph_pattern) {
 					in_group_graph_pattern = true;
+
+					sql.insert (group_graph_pattern_start, "SELECT * FROM (");
 					translate_group_or_union_graph_pattern (sql);
+					sql.append (")");
 				} else {
 					if (in_triples_block) {
 						end_triples_block (sql, ref first_where, in_group_graph_pattern);



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