consider subquery aliases in Select.clean_solutions stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 09 Sep 2010 08:43:15 +0200
branchstable
changeset 580 6405b59a8355
parent 579 341c6980df52
child 581 b40a38e34bed
child 582 79a869714ae7
consider subquery aliases in Select.clean_solutions
ChangeLog
stmts.py
--- a/ChangeLog	Thu Sep 09 08:42:14 2010 +0200
+++ b/ChangeLog	Thu Sep 09 08:43:15 2010 +0200
@@ -11,6 +11,9 @@
     * fix subquery_selection_index responsability mess-up: it wasn't doing what
       it should have done (see cw.rset related_entity implementation)
 
+    * consider subquery aliases in Select.clean_solutions
+
+
 2010-08-02  --  0.26.5
     * fix solutions computation crash with some query using sub-queries (closes #37423)
 
--- a/stmts.py	Thu Sep 09 08:42:14 2010 +0200
+++ b/stmts.py	Thu Sep 09 08:43:15 2010 +0200
@@ -626,7 +626,7 @@
             solutions = self.solutions
         # this may occurs with rql optimization, for instance on
         # 'Any X WHERE X eid 12' query
-        if not self.defined_vars:
+        if not (self.defined_vars or self.aliases):
             self.solutions = [{}]
         else:
             newsolutions = []
@@ -634,6 +634,8 @@
                 asol = {}
                 for var in self.defined_vars:
                     asol[var] = origsol[var]
+                for var in self.aliases:
+                    asol[var] = origsol[var]
                 if not asol in newsolutions:
                     newsolutions.append(asol)
             self.solutions = newsolutions