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:
parent
f6098ce17c
commit
efc7b7cc6d
1 changed files with 6 additions and 4 deletions
|
@ -41,9 +41,9 @@ 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)
|
||||
return SQLCompiler.visit_select(self, select, **kwargs)
|
||||
|
||||
|
@ -59,8 +59,10 @@ class SQLBase7Compiler(SQLCompiler):
|
|||
for f in froms:
|
||||
if isinstance(f, Join):
|
||||
visit_join(f)
|
||||
|
||||
return and_(*clauses)
|
||||
|
||||
if clauses:
|
||||
return and_(*clauses)
|
||||
return None
|
||||
|
||||
def visit_ilike_op(self, binary, **kw):
|
||||
escape = binary.modifiers.get("escape", None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue