﻿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
5223	Bug on sqlite __year comparison	Manuel Saelices <msaelices@…>	nobody	"This code:

{{{
  >>> from myapp.models import FooModel
  >>> FooModel.objects.filter(pub_date__year=2007)
}}}

produces this SQL:

{{{
SELECT ""myapp_foomodel"".""id"", ... FROM ""myapp_foomodel"" WHERE (""myapp_foomodel"".""pub_date"" BETWEEN '2006-01-01 00:00:00' AND '2006-12-31 23:59:59.999999');
}}}

but I think '''sqlite doesn't support this notation''' (at least in sqlite 3.3.5). It prefers something like that:

{{{
SELECT ""myapp_foomodel"".""id"", ... FROM ""myapp_foomodel"" WHERE (""myapp_foomodel"".""pub_date"" BETWEEN '2006-01-01' AND '2006-12-31');
}}}

I've attached a patch that fixes this bug."		closed	Database layer (models, ORM)	dev		fixed	sqlite orm sq-rf sprintsept14		Accepted	1	0	1	0	0	0
