﻿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
21603	Inconsistent column names in cursor.description under SQLite break RawQuerySet	alex@…	nobody	"See pull request at https://github.com/django/django/pull/2069

SQLite will sometimes return column names in cursor.description in the form `table_alias.""column_name""` or simply `""column_name""` instead of just `column_name`. This can happen when returning columns from subqueries, views or unions.

This means that `RawQuerySet` can't match up the columns when trying to create model instances, and raises `InvalidQuery: Raw query must include the primary key`.

This change introduces a `column_name_converter()` to the backend introspection code to mirror `table_name_converter()` and implements the fix on the SQLite backend."	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed		Shai Berger Tim Graham	Accepted	0	0	0	0	0	0
