[tracker/wip/carlosg/grilo-fixes: 2/5] libtracker-data: Don't add select variable unless on topmost select



commit a6c4aa9cf606c7947dfe2b3d095dd3eaadc5cb59
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun May 24 12:26:06 2020 +0200

    libtracker-data: Don't add select variable unless on topmost select
    
    This is done in every other path that adds the mapping between a variable
    and its name/type for upper TrackerSparqlCursor operations. We simply
    shouldn't propagate the variable here if we are not in the topmost SELECT.

 src/libtracker-data/tracker-sparql.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index 83d57ba6b..f42a84caa 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -2522,7 +2522,10 @@ translate_SelectClause (TrackerSparql  *sparql,
                                if (_accept (sparql, RULE_TYPE_LITERAL, LITERAL_AS)) {
                                        if (!handle_as (sparql, sparql->current_state.expression_type, error))
                                                return FALSE;
-                               } else {
+                               } else if (sparql->current_state.select_context == sparql->context) {
+                                       /* This is only allowed on the topmost context, an
+                                        * expression without AS in a subselect is meaningless
+                                        */
                                        tracker_sparql_add_select_var (sparql, "", 
sparql->current_state.expression_type);
                                }
 


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