diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-05-08 22:44:06 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-05-08 22:44:06 -0400 |
commit | 55eacc8dbea3c3f98197bde9034fd6558fb2bc09 (patch) | |
tree | f4fedb84a3cd05166f40c34f6b2e06e5839fa619 /test/sql/test_update.py | |
parent | c8873b31f0c87ba0d1a7518b36af7151dec34be4 (diff) | |
download | sqlalchemy-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_update.py')
-rw-r--r-- | test/sql/test_update.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/sql/test_update.py b/test/sql/test_update.py index 829739bcc..a08d5f672 100644 --- a/test/sql/test_update.py +++ b/test/sql/test_update.py @@ -177,6 +177,17 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL): 'mytable.myid = hoho(:hoho_1) AND ' 'mytable.name = :param_2 || mytable.name || :param_3') + def test_where_empty(self): + table1 = self.tables.mytable + self.assert_compile( + table1.update().where(and_()), + "UPDATE mytable SET myid=:myid, name=:name, description=:description" + ) + self.assert_compile( + table1.update().where(or_()), + "UPDATE mytable SET myid=:myid, name=:name, description=:description" + ) + def test_prefix_with(self): table1 = self.tables.mytable |