#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:  badeendjuh           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  4.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  oracle               |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by badeendjuh:

Old description:

> 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

New description:

 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.13 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#comment:1>
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/010701816cf100bb-02e813e8-805f-4659-889a-2d6038a0386e-000000%40eu-central-1.amazonses.com.

Reply via email to