fix potential key error stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 16 Nov 2009 18:36:31 +0100
branchstable
changeset 3866 2783c166ad1a
parent 3865 f9778a00e47f
child 3867 06ac8f00a99f
fix potential key error
server/sources/rql2sql.py
--- a/server/sources/rql2sql.py	Mon Nov 16 18:10:51 2009 +0100
+++ b/server/sources/rql2sql.py	Mon Nov 16 18:36:31 2009 +0100
@@ -171,8 +171,11 @@
             for invvar, vartype in invariants[id(sol)].iteritems():
                 sol[invvar] = vartype
         for sol in existssols:
-            for invvar, vartype in invariants[id(sol)].iteritems():
-                sol[invvar] = vartype
+            try:
+                for invvar, vartype in invariants[id(sol)].iteritems():
+                    sol[invvar] = vartype
+            except KeyError:
+                continue
     if len(newsols) > 1:
         if rewrite_unstable_outer_join(rqlst, newsols, unstable, schema):
             # remove variables extracted to subqueries from solutions