summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index a7465204a..cd01ea5e5 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1839,7 +1839,9 @@ class SQLCompiler(Compiled):
text += " " + extra_from_text
if update_stmt._whereclause is not None:
- text += " WHERE " + self.process(update_stmt._whereclause)
+ t = self.process(update_stmt._whereclause)
+ if t:
+ text += " WHERE " + t
limit_clause = self.update_limit_clause(update_stmt)
if limit_clause:
@@ -2261,8 +2263,9 @@ class SQLCompiler(Compiled):
delete_stmt, delete_stmt._returning)
if delete_stmt._whereclause is not None:
- text += " WHERE "
- text += delete_stmt._whereclause._compiler_dispatch(self)
+ t = delete_stmt._whereclause._compiler_dispatch(self)
+ if t:
+ text += " WHERE " + t
if self.returning and not self.returning_precedes_values:
text += " " + self.returning_clause(