[tracker/wip/carlosg/sparql1.1: 61/113] libtracker-data: Raise parser error on DISTINCT in ArgList



commit 73be103a90a49e45d8315fe9060595e7a204988b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jun 19 01:04:09 2019 +0200

    libtracker-data: Raise parser error on DISTINCT in ArgList
    
    This is meant for custom aggregate functions, but we offer none.

 src/libtracker-data/tracker-sparql.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index dffae5b5e..0689f81e9 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -4526,7 +4526,13 @@ translate_ArgList (TrackerSparql  *sparql,
                        _raise (PARSE, "Recursive ArgList is not allowed", "ArgList");
 
                if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_DISTINCT)) {
-                       _unimplemented ("DISTINCT in ArgList");
+                       /* This path is only for custom aggregate function, as per
+                        * the SPARQL recommendation, note 15 in grammar section:
+                        * "Only custom aggregate functions use the DISTINCT keyword in a function call."
+                        *
+                        * But we have none, so it's fine to bail out here.
+                        */
+                       _raise (PARSE, "DISTINCT is not allowed in non-aggregate function", "ArgList");
                }
 
                _call_rule (sparql, NAMED_RULE_Expression, error);


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