Fixed an issue with the dialect's _get_join_whereclause method, where it was causing a dangling "AND" to show up in the resultant query.

This commit is contained in:
Lance Edgar 2010-04-21 16:58:14 -05:00
parent f6098ce17c
commit efc7b7cc6d

View file

@ -41,7 +41,7 @@ class SQLBase7Compiler(SQLCompiler):
def visit_select(self, select, **kwargs):
froms = select._get_display_froms()
whereclause = self._get_join_whereclause(froms)
if whereclause is not None:
if whereclause:
select = select.where(whereclause)
kwargs['iswrapper'] = getattr(select, '_is_wrapper', False)
@ -60,7 +60,9 @@ class SQLBase7Compiler(SQLCompiler):
if isinstance(f, Join):
visit_join(f)
if clauses:
return and_(*clauses)
return None
def visit_ilike_op(self, binary, **kw):
escape = binary.modifiers.get("escape", None)