[tracker/tracker-0.10] libtracker-data: Error when OFFSET, LIMIT, etc are used with ASK



commit 6f9ed5eb974de1971bdaa677f41143b9c06b9207
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Apr 11 14:03:19 2011 +0200

    libtracker-data: Error when OFFSET, LIMIT, etc are used with ASK

 src/libtracker-data/tracker-sparql-query.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index 397779e..79e8bcb 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -552,6 +552,11 @@ public class Tracker.Sparql.Query : Object {
 		sql.append (pattern_sql.str);
 		sql.append (" ) WHEN 1 THEN 'true' WHEN 0 THEN 'false' ELSE NULL END");
 
+		if (accept (SparqlTokenType.GROUP) || accept (SparqlTokenType.ORDER) ||
+		    accept (SparqlTokenType.OFFSET) || accept (SparqlTokenType.LIMIT)) {
+			throw get_error ("invalid use of %s in ASK".printf (last().to_string()));
+		}
+
 		context = context.parent_context;
 
 		return sql.str;



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