closes #78681: stcheck don't crash on column aliases used in outer join stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Oct 2011 14:14:44 +0200
branchstable
changeset 666 8828046c2d3b
parent 665 446b635cb163
child 667 4a0bbee051e0
child 677 31130f18a5ef
child 678 a031d85966f1
closes #78681: stcheck don't crash on column aliases used in outer join
ChangeLog
stcheck.py
--- a/ChangeLog	Thu Sep 08 18:13:58 2011 +0200
+++ b/ChangeLog	Tue Oct 11 14:14:44 2011 +0200
@@ -1,8 +1,14 @@
 ChangeLog for RQL
 =================
 
+--
+    * #78681: don't crash on column aliases used in outer join
+
+
 2011-09-07  --  0.30.1
-    * #74727: allow entity types to end with a capitalized letter provided they contain a lower-cased letter
+
+    * #74727: allow entity types to end with a capitalized letter
+      provided they contain a lower-cased letter
 
 
 
--- a/stcheck.py	Thu Sep 08 18:13:58 2011 +0200
+++ b/stcheck.py	Tue Oct 11 14:14:44 2011 +0200
@@ -546,12 +546,14 @@
                                 vargraph.setdefault(v2, []).append(v1)
                 if term.optional in ('left', 'both'):
                     for var in lhsvariables:
-                        optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
-                        optcomps.add(term)
+                        if var.stinfo['attrvar'] is not None:
+                            optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
+                            optcomps.add(term)
                 if term.optional in ('right', 'both'):
                     for var in rhsvariables:
-                        optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
-                        optcomps.add(term)
+                        if var.stinfo['attrvar'] is not None:
+                            optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
+                            optcomps.add(term)
 
     def rewrite_shared_optional(self, exists, var, identity_rel_scope=None):
         """if variable is shared across multiple scopes, need some tree