﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10432	"Empty generator in ""in"" lookup gives incorrect SQL"	Pavel Anossov	Malcolm Tredinnick	"Simple story, here's what happens:

{{{
> User.objects.filter(pk__in=[]) # ok
[]

> User.objects.filter(pk__in=(x for x in [])).query.as_sql() # ProgrammingError
(...)
ProgrammingError: (1064, ""You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 21' at line 1"")

> User.objects.filter(pk__in=(x for x in [])).query.as_sql()
(u'SELECT (...) FROM `user` WHERE `user`.`id` IN ()',
 ())
}}}

'''A''' patch is included."		closed	Database layer (models, ORM)	dev		fixed	sql where		Unreviewed	1	0	0	0	0	0
