#27843 closed Bug (fixed)
M2M db table names with explicit `username`
Reported by: | Mariusz Felisiak | Owned by: | Mariusz Felisiak |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
db.models.fields.related._get_m2m_db_table
doesn't work properly if we use db_table
with explicit username
of a length between 24-30 chars e.g.
db_table = "d4_pullrequestsoracle_35"."DJANGO_DOCUMENT_TABLE" name = 'students'
then _get_m2m_db_table
returns "D4_PULLREQUESTSORACLE_35".56C8"
instead of "D4_PULLREQUESTSORACLE_35"."DJANGO_DOCUMENT_TABLE_STUDENTS"
.
Change History (14)
comment:1 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 8 years ago
Has patch: | set |
---|
follow-up: 5 comment:3 by , 8 years ago
It looks like all usages of truncate_name(strip_quote())
are also affected (see #27458, 69b7d4b116e3b70b250c77829e11038d5d55c2a8)
comment:4 by , 8 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 8 years ago
Replying to Simon Charette:
It looks like all usages of
truncate_name(strip_quote())
are also affected (see #27458, 69b7d4b116e3b70b250c77829e11038d5d55c2a8)
I decided to fix truncate_name
instead of duplicate this fix in few other places.
comment:6 by , 8 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:11 by , 7 years ago
This didn't completely fix the regression introduced by #27458 in the index and foreign key constraint creation cases because _create_index_name
still rely on strip_quotes
without using truncate_name
. I'm working on a patch to deal with this issue so I'll file a new ticket once it's ready for review.
PR