diff options
| author | Marcin Biernat <mb@marcinbiernat.pl> | 2013-02-23 23:50:02 +0100 |
|---|---|---|
| committer | Marcin Biernat <mb@marcinbiernat.pl> | 2013-02-23 23:53:46 +0100 |
| commit | 2b76f19f2b89ac96bae2a169d71b23553c8101c7 (patch) | |
| tree | c696b9242914d0175035ca5e21e1716003e80a68 /django/db/models/sql/where.py | |
| parent | 7ec2a21be15af5b2c7513482c3bcfdd1e12782ed (diff) | |
fixes #19263
Diffstat (limited to 'django/db/models/sql/where.py')
| -rw-r--r-- | django/db/models/sql/where.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index ef856893b5..603ae3dfbe 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -204,6 +204,10 @@ class WhereNode(tree.Node): raise EmptyResultSet if extra: return ('%s IN %s' % (field_sql, extra), params) + if not params: + # Empty params would generate invalid sql in subquery + raise EmptyResultSet + max_in_list_size = connection.ops.max_in_list_size() if max_in_list_size and len(params) > max_in_list_size: # Break up the params list into an OR of manageable chunks. |
