﻿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
34409	Examples of fetching raw SQL don't work for non-unique column names.	Jesper Olsson	Jesper Olsson	"The documentation on [https://docs.djangoproject.com/en/4.1/topics/db/sql/#executing-custom-sql-directly executing custom SQL directly] includes a code sample for `dictfetchall`. When the cursor executes a `SELECT` statement for two identically named table columns (e.g., `""foo"".""id""` and `""bar"".""id""`) then the resulting `dict` ends up with just one `id` key.

In other words, the consumer may deal with a ID for `bar` when they expected an ID for `foo`, causing unanticipated behavior and threatening information security. This behavior can be very difficult to pin down, especially since Django is considered reputable.

The same problem can be observed in the code sample for `namedtuplefetchall` but will instead result in a runtime error."	Cleanup/optimization	closed	Documentation	4.1	Normal	fixed			Ready for checkin	1	0	0	0	1	0
