fix bug introduced by 524:60255eecf96c: we must properly skip the uid relation in the relation loop
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 08 Apr 2010 13:34:35 +0200
changeset 526 af6c6e952431
parent 525 9f9c98a219a5
child 527 70c8611957d5
fix bug introduced by 524:60255eecf96c: we must properly skip the uid relation in the relation loop
__init__.py
--- a/__init__.py	Wed Apr 07 13:51:37 2010 +0200
+++ b/__init__.py	Thu Apr 08 13:34:35 2010 +0200
@@ -159,6 +159,8 @@
                             rhs = copy_uid_node(select, rhs, vconsts)
                             select.groupby[select.groupby.index(vref)] = rhs
                             rhs.parent = select
+                    elif rel is uidrel:
+                        uidrel.parent.remove(uidrel)
                     elif rel.is_types_restriction():
                         stinfo['typerel'] = None
                         rel.parent.remove(rel)
@@ -166,7 +168,6 @@
                         rhs = copy_uid_node(select, rhs, vconsts)
                         vref.parent.replace(vref, rhs)
                 del select.defined_vars[var.name]
-                uidrel.parent.remove(uidrel)
                 stinfo['uidrel'] = None
                 rewritten = True
                 if vconsts: