backport stable

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset4a0bbee051e0
branchdefault
phasepublic
hiddenno
parent revision#e359c3e27b9d Added tag rql-debian-version-0.30.1-1 for changeset 13cd741f8e14, #8828046c2d3b closes #78681: stcheck don't crash on column aliases used in outer join
child revision#b2e231cbd9da [rql] HAVING support in write queries (INSERT,SET,DELETE). Closes #81394
files modified by this revision
ChangeLog
stcheck.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1319212049 -7200
# Fri Oct 21 17:47:29 2011 +0200
# Node ID 4a0bbee051e0deab54e231f9ecae55672bd43692
# Parent e359c3e27b9d9b457d2a7222be62c7284fa38e3a
# Parent 8828046c2d3b47371f6659430d4492b2bcaf1f68
backport stable

diff --git a/ChangeLog b/ChangeLog
@@ -1,10 +1,16 @@
1  ChangeLog for RQL
2  =================
3 
4 +--
5 +    * #78681: don't crash on column aliases used in outer join
6 +
7 +
8  2011-09-07  --  0.30.1
9 -    * #74727: allow entity types to end with a capitalized letter provided they contain a lower-cased letter
10 +
11 +    * #74727: allow entity types to end with a capitalized letter
12 +      provided they contain a lower-cased letter
13 
14 
15 
16  2011-08-05  --  0.30.0
17      * #72295: add some missing operators:
diff --git a/stcheck.py b/stcheck.py
@@ -544,16 +544,18 @@
18                              if v1 != v2:
19                                  vargraph.setdefault(v1, []).append(v2)
20                                  vargraph.setdefault(v2, []).append(v1)
21                  if term.optional in ('left', 'both'):
22                      for var in lhsvariables:
23 -                        optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
24 -                        optcomps.add(term)
25 +                        if var.stinfo['attrvar'] is not None:
26 +                            optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
27 +                            optcomps.add(term)
28                  if term.optional in ('right', 'both'):
29                      for var in rhsvariables:
30 -                        optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
31 -                        optcomps.add(term)
32 +                        if var.stinfo['attrvar'] is not None:
33 +                            optcomps = var.stinfo['attrvar'].stinfo.setdefault('optcomparisons', set())
34 +                            optcomps.add(term)
35 
36      def rewrite_shared_optional(self, exists, var, identity_rel_scope=None):
37          """if variable is shared across multiple scopes, need some tree
38          rewriting
39          """