#33789: Table and colums with more then 30 chars can no longer be found /
queried
after migrating from django 3.2 to 4.0 using an Oracle backend
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
badeendjuh |
Type: Bug | Status: new
Component: Database | Version: 4.0
layer (models, ORM) |
Severity: Normal | Keywords: oracle
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While in the proces of updating our project from Django 2.2 to 3.2 to 4.0
I noticed that things started to break down in 4.0.
Since upgrading to 4.0, tables with names longer than 30 chars fail with
ORA-00942: table or view does not exist
models with columns with names longer than 30 chars fail with
ORA-00904:
"COMPONENT_ATTRIBUTE_METADATA"."REQUIRES_ILOM_CONNECT_FOR_DD63": invalid
identifier
When I run the following on django 2.2 / 3.2 14 with python 3.6
{{{
from django.db.backends.utils import truncate_name
truncate_name("very_long_database_table_or_column" length=30)
Out[7]: 'VERY_LONG_DATABASE_TABLE_O20cb'
}}}
Then run the same on django 4.0.5 with python 3.9
{{{
from django.db.backends.utils import truncate_name
truncate_name("very_long_database_table_or_column", length=30)
Out[6]: 'very_long_database_table_o0c9a'
}}}
The hash value is different. As a result a table or column name is
queried that does not exist, because they where created using the older
algorithm.
I believe this was broken by this change:
https://code.djangoproject.com/ticket/32653
--
Ticket URL: <https://code.djangoproject.com/ticket/33789>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701816ce7f13c-1c7acff7-dc33-40eb-a4a5-50735afcd4bb-000000%40eu-central-1.amazonses.com.