[tracker/tracker-0.8] SPARQL: Fix generated SQL when not retrieving actual data
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] SPARQL: Fix generated SQL when not retrieving actual data
- Date: Thu, 19 Aug 2010 16:12:26 +0000 (UTC)
commit f1374c7cbfbbc96234c9a705af81710a4430ad54
Author: Jürg Billeter <j bitron ch>
Date: Mon Jul 12 12:27:35 2010 +0200
SPARQL: Fix generated SQL when not retrieving actual data
src/libtracker-data/tracker-sparql-pattern.vala | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-pattern.vala b/src/libtracker-data/tracker-sparql-pattern.vala
index cb35cf3..69bba63 100644
--- a/src/libtracker-data/tracker-sparql-pattern.vala
+++ b/src/libtracker-data/tracker-sparql-pattern.vala
@@ -1158,6 +1158,8 @@ class Tracker.Sparql.Pattern : Object {
}
void parse_object (StringBuilder sql, bool in_simple_optional = false) throws SparqlError {
+ long begin_sql_len = sql.len;
+
bool object_is_var;
string object = parse_var_or_term (sql, out object_is_var);
@@ -1397,10 +1399,9 @@ class Tracker.Sparql.Pattern : Object {
}
}
- if (!current_subject_is_var &&
- !current_predicate_is_var &&
- !object_is_var) {
- // no variables involved, add dummy expression to SQL
+ if (sql.len == begin_sql_len) {
+ // no SELECT expression was added, add dummy expression
+ // this is required in cases where no values need to be retrieved
sql.append ("1, ");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]