[server/rql2sql] use VariableRef.is_equivalent explicitly instead of relying on __eq__
What we want to compare is the variable referenced by the VariableRef,
we should make that explicit.
Closes #6694406
--- a/server/sources/rql2sql.py Mon Oct 12 10:53:35 2015 +0200
+++ b/server/sources/rql2sql.py Tue Sep 08 13:43:57 2015 +0200
@@ -259,7 +259,7 @@
append(term)
if groups:
for vref in term.iget_nodes(VariableRef):
- if not vref in groups:
+ if not any(vref.is_equivalent(g) for g in groups):
groups.append(vref)
def fix_selection_and_group(rqlst, needwrap, selectsortterms,
@@ -275,7 +275,7 @@
(isinstance(term, Function) and
get_func_descr(term.name).aggregat)):
for vref in term.iget_nodes(VariableRef):
- if not vref in groupvrefs:
+ if not any(vref.is_equivalent(group) for group in groupvrefs):
groups.append(vref)
groupvrefs.append(vref)
if needwrap and (groups or having):