[tracker/wip/carlosg/fix-minus: 1/4] libtracker-data: Shuffle and rename function
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/fix-minus: 1/4] libtracker-data: Shuffle and rename function
- Date: Sat, 7 Mar 2020 15:18:48 +0000 (UTC)
commit 8229da03272ecfa827a2bb1f4e14db3a5c996d9e
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Mar 6 19:18:49 2020 +0100
libtracker-data: Shuffle and rename function
We want this used on MINUS support, in addition to UNION. Rename
the function, and move it a little bit upwards so we don't have to
declare it.
src/libtracker-data/tracker-sparql.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index 988e94930..bcdcd52e7 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -4977,24 +4977,10 @@ translate_DataBlockValue (TrackerSparql *sparql,
return TRUE;
}
-static gboolean
-translate_MinusGraphPattern (TrackerSparql *sparql,
- GError **error)
-{
- /* MinusGraphPattern ::= 'MINUS' GroupGraphPattern
- */
- _expect (sparql, RULE_TYPE_LITERAL, LITERAL_MINUS);
- _prepend_string (sparql, "SELECT * FROM (");
- _append_string (sparql, ") EXCEPT ");
- _call_rule (sparql, NAMED_RULE_GroupGraphPattern, error);
-
- return TRUE;
-}
-
static void
-append_union_select_vars (TrackerSparql *sparql,
- TrackerContext *context,
- GList *vars)
+append_subquery_select_vars (TrackerSparql *sparql,
+ TrackerContext *context,
+ GList *vars)
{
GList *l;
@@ -5019,6 +5005,20 @@ append_union_select_vars (TrackerSparql *sparql,
_append_string (sparql, "FROM (");
}
+static gboolean
+translate_MinusGraphPattern (TrackerSparql *sparql,
+ GError **error)
+{
+ /* MinusGraphPattern ::= 'MINUS' GroupGraphPattern
+ */
+ _expect (sparql, RULE_TYPE_LITERAL, LITERAL_MINUS);
+ _prepend_string (sparql, "SELECT * FROM (");
+ _append_string (sparql, ") EXCEPT ");
+ _call_rule (sparql, NAMED_RULE_GroupGraphPattern, error);
+
+ return TRUE;
+}
+
static gboolean
translate_GroupOrUnionGraphPattern (TrackerSparql *sparql,
GError **error)
@@ -5072,7 +5072,7 @@ translate_GroupOrUnionGraphPattern (TrackerSparql *sparql,
if (c != context->children)
_append_string (sparql, ") UNION ALL ");
- append_union_select_vars (sparql, c->data, vars);
+ append_subquery_select_vars (sparql, c->data, vars);
tracker_sparql_swap_builder (sparql, old);
idx++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]