summaryrefslogtreecommitdiff
path: root/test/sql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-05-08 22:44:06 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-05-08 22:44:06 -0400
commit55eacc8dbea3c3f98197bde9034fd6558fb2bc09 (patch)
treef4fedb84a3cd05166f40c34f6b2e06e5839fa619 /test/sql/test_compiler.py
parentc8873b31f0c87ba0d1a7518b36af7151dec34be4 (diff)
downloadsqlalchemy-55eacc8dbea3c3f98197bde9034fd6558fb2bc09.tar.gz
- Fixed bug where :meth:`.Table.update` and :meth:`.Table.delete`
would produce an empty WHERE clause when an empty :func:`.and_()` or :func:`.or_()` or other blank expression were applied. This is now consistent with that of :func:`.select`. fixes #3045
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r--test/sql/test_compiler.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 1be76c696..917c7d89d 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -962,6 +962,15 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
)
+ def test_where_empty(self):
+ self.assert_compile(
+ select([table1.c.myid]).where(and_()),
+ "SELECT mytable.myid FROM mytable"
+ )
+ self.assert_compile(
+ select([table1.c.myid]).where(or_()),
+ "SELECT mytable.myid FROM mytable"
+ )
def test_multiple_col_binds(self):
self.assert_compile(