[tracker/property-functions: 1/2] SPARQL: Small refactoring of property function support
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/property-functions: 1/2] SPARQL: Small refactoring of property function support
- Date: Wed, 22 Dec 2010 15:08:18 +0000 (UTC)
commit 398a2c060ee3928e401a20d7f419390cf053e285
Author: Jürg Billeter <j bitron ch>
Date: Mon Dec 20 16:10:46 2010 +0100
SPARQL: Small refactoring of property function support
Prepares extended property function support.
src/libtracker-data/tracker-sparql-expression.vala | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala b/src/libtracker-data/tracker-sparql-expression.vala
index 2ad1406..f082d6e 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -665,20 +665,19 @@ class Tracker.Sparql.Expression : Object {
throw get_error ("Unknown function");
}
+ var expr = new StringBuilder ();
+ translate_expression (expr);
+
if (prop.multiple_values) {
sql.append ("(SELECT GROUP_CONCAT(");
long begin = sql.len;
sql.append_printf ("\"%s\"", prop.name);
convert_expression_to_string (sql, prop.data_type, begin);
- sql.append_printf (",',') FROM \"%s\" WHERE ID = ", prop.table_name);
- translate_expression (sql);
- sql.append (")");
+ sql.append_printf (",',') FROM \"%s\" WHERE ID = %s)", prop.table_name, expr.str);
return PropertyType.STRING;
} else {
- sql.append_printf ("(SELECT \"%s\" FROM \"%s\" WHERE ID = ", prop.name, prop.table_name);
- translate_expression (sql);
- sql.append (")");
+ sql.append_printf ("(SELECT \"%s\" FROM \"%s\" WHERE ID = %s)", prop.name, prop.table_name, expr.str);
if (prop.data_type == PropertyType.STRING) {
append_collate (sql);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]