# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1270577412 -7200 # Node ID a19f22bacedc62221afa4c4663325d141e42042d # Parent 27d4cab5db03a9e3c47d05ccc08d0c92f4d68559 [ms] fix planning bug introduced with recent rql refactoring for queries with only eids (fix unittest_multisources.test_in_eid) diff -r 27d4cab5db03 -r a19f22bacedc server/msplanner.py --- a/server/msplanner.py Tue Apr 06 19:58:04 2010 +0200 +++ b/server/msplanner.py Tue Apr 06 20:10:12 2010 +0200 @@ -312,11 +312,15 @@ # NOTE: use uidrel and not constnode to deal with "X eid IN(1,2,3,4)" if varobj.stinfo['uidrel'] is not None: rel = varobj.stinfo['uidrel'] + hasrel = len(varobj.stinfo['relations']) > 1 for const in rel.children[1].get_nodes(Constant): eid = const.eval(self.plan.args) source = self._session.source_from_eid(eid) - if not any(source.support_relation(r.r_type) - for r in varobj.stinfo['relations'] if not r is rel): + if (source is self.system_source + or (hasrel and + not any(source.support_relation(r.r_type) + for r in varobj.stinfo['relations'] + if not r is rel))): self._set_source_for_term(self.system_source, varobj) else: self._set_source_for_term(source, varobj)