Skip to content

Commit 3448d4b

Browse files
committed
fix SQL generation for empty WHERE clause.
1 parent 994ead2 commit 3448d4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

roundup/backends/rdbms_common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,11 @@ def filter(self, search_matches, filterspec, sort=[], group=[]):
22302230
elif k == 'id':
22312231
if p.sort_type < 2:
22322232
if isinstance(v, type([])):
2233+
# If there are no permitted values, then the
2234+
# where clause will always be false, and we
2235+
# can optimize the query away.
2236+
if not v:
2237+
return []
22332238
s = ','.join([a for x in v])
22342239
where.append('_%s.%s in (%s)'%(pln, k, s))
22352240
args = args + v

0 commit comments

Comments
 (0)