summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorNicolas Rolin <nicolas.rolin@cubber.com>2018-05-25 13:27:22 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-08-07 17:04:10 -0400
commitb17fa2513e412b8f9aa1f62c0acc7fa3805e632b (patch)
treee0b565bbdb40394a1a55f10db63dd5408ee97822 /test/sql
parentabeea1d82db34232bbef01e98fa4d1de0f583eb6 (diff)
downloadsqlalchemy-b17fa2513e412b8f9aa1f62c0acc7fa3805e632b.tar.gz
Add support of empty list in exanding of bindparam
Added new logic to the "expanding IN" bound parameter feature whereby if the given list is empty, a special "empty set" expression that is specific to different backends is generated, thus allowing IN expressions to be fully dynamic including empty IN expressions. Fixes: #4271 Change-Id: Icc3c73bbd6005206b9d06baaeb14a097af5edd36 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/432
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_query.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 74efbf9a4..1d562c2db 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -455,11 +455,9 @@ class QueryTest(fixtures.TestBase):
[(7, 'jack'), (8, 'fred')]
)
- assert_raises_message(
- exc.StatementError,
- "'expanding' parameters can't be used with an empty list",
- conn.execute,
- stmt, {"uname": []}
+ eq_(
+ conn.execute(stmt, {"uname": []}).fetchall(),
+ []
)
assert_raises_message(