[Sqlalchemy-tickets] Issue #3224: Filtering on a union of join silently fails to filter. (zzzeek/sq
Brought to you by:
zzzeek
|
From: Christophe B. <iss...@bi...> - 2014-10-14 18:21:49
|
New issue 3224: Filtering on a union of join silently fails to filter. https://bitbucket.org/zzzeek/sqlalchemy/issue/3224/filtering-on-a-union-of-join-silently Christophe Biocca: I attached a reproduction of the bug. The important bit: ``` #!python # This doesn't filter both side of the union, and the generated sql looks really wrong. session.query(B).join(A).union(session.query(B).join(A)).filter(A.id == '2').count() ``` Simple workaround was to duplicate the filter call to each query before the union. To be honest, I'm not even sure the filter call is valid (but at least it should throw an error, not let everything go through). |