# HG changeset patch # User Sylvain Thénault # Date 1299514627 -3600 # Node ID 8bcf33c493f86d43d37810d809602ec7b18ae5b1 # Parent 5a6fd60f76170785d6d125b5fcbf1f760fc6bac5 [sql generation] fix exists table scope pb: when iterating other solutions inner to an EXISTS subquery, we should reset variables which have this exists node as scope diff -r 5a6fd60f7617 -r 8bcf33c493f8 server/sources/rql2sql.py --- a/server/sources/rql2sql.py Mon Mar 07 17:15:06 2011 +0100 +++ b/server/sources/rql2sql.py Mon Mar 07 17:17:07 2011 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -365,6 +365,11 @@ yield 1 return thisexistssols, thisexistsvars = self.existssols[exists] + # when iterating other solutions inner to an EXISTS subquery, we should + # reset variables which have this exists node as scope at each iteration + for var in exists.stmt.defined_vars.itervalues(): + if var.scope is exists: + thisexistsvars.add(var.name) origsol = self.solution origtables = self.tables done = self.done