we may have to cleanup solutions when we've no rewritten const (that doesn't mean nothing changed...) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 04 Mar 2010 12:11:28 +0100
branchstable
changeset 497 c0461bf2bf24
parent 496 3d89e70448af
child 498 9c06e009010b
we may have to cleanup solutions when we've no rewritten const (that doesn't mean nothing changed...)
__init__.py
--- a/__init__.py	Mon Feb 22 18:46:41 2010 +0100
+++ b/__init__.py	Thu Mar 04 12:11:28 2010 +0100
@@ -128,6 +128,7 @@
         for subquery in select.with_:
             for select in subquery.query.children:
                 self._simplify(select)
+        rewritten = False
         for var in select.defined_vars.values():
             stinfo = var.stinfo
             if stinfo['constnode'] and not stinfo['blocsimplification']:
@@ -176,9 +177,10 @@
                         rhs = copy_uid_node(select, rhs, vconsts)
                         vref.parent.replace(vref, rhs)
                 del select.defined_vars[var.name]
+                rewritten = True
                 if vconsts:
                     select.stinfo['rewritten'][var.name] = vconsts
-        if select.stinfo['rewritten'] and select.solutions:
+        if rewritten and select.solutions:
             select.clean_solutions()
 
     def compare(self, rqlstring1, rqlstring2):