[tracker] SPARQL: Fix queries with triples without variables
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker] SPARQL: Fix queries with triples without variables
- Date: Mon, 29 Jun 2009 12:45:47 +0000 (UTC)
commit 6459741d5c7ecc9697b28a8ba0849fdfa40b2908
Author: Jürg Billeter <j bitron ch>
Date: Mon Jun 29 14:37:03 2009 +0200
SPARQL: Fix queries with triples without variables
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 a3cd944..fc558cd 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -1029,6 +1029,13 @@ public class Tracker.SparqlQuery : Object {
bindings.append (binding);
}
}
+
+ if (triple.subject.type != Rasqal.Literal.Type.VARIABLE &&
+ triple.predicate.type != Rasqal.Literal.Type.VARIABLE &&
+ triple.object.type != Rasqal.Literal.Type.VARIABLE) {
+ // no variables involved, add dummy expression to SQL
+ pattern_sql.append ("1, ");
+ }
}
DataTable get_table (string subject, string db_table, bool share_table, out bool newtable) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]