﻿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
28484	QuerySet.extra keyword	Antonio Carrasco	nobody	"Related to the #extra deprecation https://docs.djangoproject.com/en/1.11/ref/models/querysets/#extra
Given this example:
{{{
queryset = Model.objects.all()
ordered_ids = ""1,3,5,7""
queryset.annotate(custom=RawSQL(f""SELECT FIELD(id, %s)"", (ordered_ids,))).order_by(""custom"")
queryset.extra(select={""custom"": f""FIELD(id, {ordered_ids})""}, order_by=['custom']).distinct()
}}}
The result of both queries is different. But executing the "".query"" query in the Mysql native console, the result is the same.
The result with #extra is ok (the same the native mysql console returns) but the result with annotate is wrong."	Uncategorized	new	Database layer (models, ORM)	1.11	Normal				Unreviewed	0	0	0	0	0	0
