﻿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
28206	Raw queries with Oracle impossible when using uppercase column names	Dmitry Shachnev	Mariusz Felisiak	"When one has a model with a custom column name in uppercase, say:

{{{
class Man(Model):
    id = models.AutoField(primary_key=True, db_column=""F_MAN_ID"")
}}}

Then it is impossible to use RawQuerySets with this model on Oracle, you will always get the “InvalidQuery: Raw query must include the primary key” error.

The problem is that {{{column_name_converter()}}} converts the column names to lowercase, so even if you use {{{F_MAN_ID}}} in your query, the {{{self.columns}}} list in the RawQuerySet instance will contain the lowercase column name. And because of case differences the {{{f.column in self.columns}}} check in {{{resolve_model_init_order}}} method will return False.

We are currently using Django 1.8 in production, but I looked at the Django code and it’s the same between 1.8 and 1.11, so I have put 1.11 into the Version field."	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	Oracle		Ready for checkin	1	0	0	0	0	0
