summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aae2424)
raw | patch | inline | side by side (parent: aae2424)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Nov 2010 22:31:39 +0000 (22:31 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Nov 2010 22:31:39 +0000 (22:31 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4571 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/rdbms_common.py | patch | blob | history |
index 2637f8868d04fe9d389ffdff70e5e002a2b89ca3..ae13ff27eded74408d6e0a254e927ca0c2eb5357 100644 (file)
elif k == 'id':
if p.sort_type < 2:
if isinstance(v, type([])):
+ # If there are no permitted values, then the
+ # where clause will always be false, and we
+ # can optimize the query away.
+ if not v:
+ return []
s = ','.join([a for x in v])
where.append('_%s.%s in (%s)'%(pln, k, s))
args = args + v