[tracker] libtracker-data: Add support for the CONCAT() builtin function
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Add support for the CONCAT() builtin function
- Date: Mon, 19 Oct 2015 12:14:44 +0000 (UTC)
commit d48290f437ab00c2662d42c98cd549fac4023848
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 28 20:28:08 2015 +0200
libtracker-data: Add support for the CONCAT() builtin function
This function is defined in Sparql 1.1 query language recommendation,
http://www.w3.org/TR/sparql11-query/#func-concat
src/libtracker-data/tracker-sparql-expression.vala | 6 ++++++
src/libtracker-data/tracker-sparql-scanner.vala | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala
b/src/libtracker-data/tracker-sparql-expression.vala
index 8633b20..d9ca3b8 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -1172,6 +1172,12 @@ class Tracker.Sparql.Expression : Object {
var result = translate_function (sql, TRACKER_NS + "coalesce");
expect (SparqlTokenType.CLOSE_PARENS);
return result;
+ case SparqlTokenType.CONCAT:
+ next ();
+ expect (SparqlTokenType.OPEN_PARENS);
+ var result = translate_function (sql, FN_NS + "concat");
+ expect (SparqlTokenType.CLOSE_PARENS);
+ return result;
case SparqlTokenType.IF:
return translate_if_call (sql);
case SparqlTokenType.SAMETERM:
diff --git a/src/libtracker-data/tracker-sparql-scanner.vala b/src/libtracker-data/tracker-sparql-scanner.vala
index 7a52cdc..77983f4 100644
--- a/src/libtracker-data/tracker-sparql-scanner.vala
+++ b/src/libtracker-data/tracker-sparql-scanner.vala
@@ -256,6 +256,10 @@ public class Tracker.SparqlScanner : Object {
break;
case 6:
switch (begin[0]) {
+ case 'C':
+ case 'c':
+ if (matches (begin, "CONCAT")) return SparqlTokenType.CONCAT;
+ break;
case 'D':
case 'd':
if (matches (begin, "DELETE")) return SparqlTokenType.DELETE;
@@ -872,6 +876,7 @@ public enum Tracker.SparqlTokenType {
CLOSE_PARENS,
COALESCE,
COLON,
+ CONCAT,
COMMA,
CONSTRUCT,
COUNT,
@@ -972,6 +977,7 @@ public enum Tracker.SparqlTokenType {
case CLOSE_PARENS: return "`)'";
case COALESCE: return "`COALESCE'";
case COLON: return "`:'";
+ case CONCAT: return "`CONCAT'";
case COMMA: return "`,'";
case CONSTRUCT: return "`CONSTRUCT'";
case COUNT: return "`COUNT'";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]