﻿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
28792	Index names can be incorrectly truncated when using a namespaced table name	Simon Charette	Simon Charette	"When using a namespaced `_meta.db_table` (e.g. Oracle's `'schema"".""table'`) it's possible that `_create_index_name` returns an index name truncating the namespace resulting in an invalid identifier or one that isn't namespaced anymore and thus created in the user's namespace.

For example, given the following model:

{{{#!python
class Foo(models.Model):
    field = models.IntegerField(index=True)

    class Meta:
        db_table = 'long_name"".""table_name'
}}}

The resulting index name will be `'long_name""_field_d21c9e0a'` which is invalid SQL even when quoted to `'""long_name""_field_d21c9e0a""'`.

Marking as a release blocker because this is a regression which I believe was introduced by #27458 and wasn't addressed by #27843. I confirm that this uses to work on Django 1.10 but was broken on 1.11 as I stumbled upon the issue when upgrading a Django 1.8 LTS codebase to 1.11 LTS on the 1.10 -> 1.11 step.

The tests added by #27458 just happened to work because the index name truncation cut the string the in a way that both double quotes are stripped. It should be possible to tweak the table names to trigger the errors but I felt like directly testing `_create_index_name` was more appropriate."	Bug	closed	Migrations	1.11	Release blocker	fixed			Ready for checkin	1	0	0	0	0	0
