﻿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
6018	[patch] depth handling in fill_table_cache broken when using select_related(depth=1).extra()	Matthias Urlichs <smurf@…>	nobody	"As reported by marcin@elksoft.pl in #3275:

There is a bug in the way depth is handled in fill_table_cache, see ''the attached patch'' for a test case. When you specify a non-zero depth fill_table_cache goes one relationship too deep which causes get_cached_row not to handle all the columns from select_related.

This bug shows up when you use extra on that Query``Set: the extra fields to select should immediately follow columns handled by get_cached_row, but instead they get data from the relationship that fill_table_cache added and get_cached_row skipped.

----

I'm re-posting this bug (and his patches) here because #3275 is, essentially, an unrelated ticket; IMHO this here patch should go into mainline ASAP."		closed	Database layer (models, ORM)	dev		fixed	qs-rf-fixed	marcin@… matthias@… gabor@…	Accepted	1	0	0	0	0	0
