#34544: models.TextField with =None filter throws Error for Oracle
-------------------------------------+-------------------------------------
     Reporter:  Michael D. Smith     |                    Owner:  Jatin-tec
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  Oracle isnull lob    |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  assigned => closed
 * resolution:   => needsinfo


Old description:

> Model contains
>
> somefield = models.TextField(
>         blank=True, null=True
>     )
>
> At 4.1.9:
>
> {{{
> print(MyModel.objects.filter(somefield=None).only('id').query)
>
> }}}
>
> {{{
> SELECT "TNAME_MYMODEL"."ID" FROM "TNAME_MYMODEL" WHERE
> "TNAME_MYMODEL"."SOMEFIELD"  IS NULL
>
> }}}
> works
>
> At 4.2.0:
>
> {{{
> print(MyModel.objects.filter(somefield=None).only('id').query)
>
> }}}
>
> {{{
> SELECT "TNAME_MYMODEL"."ID" FROM "TNAME_MYMODEL" WHERE
> DBMS_LOB.SUBSTR("TNAME_MYMODEL"."SOMEFIELD") IS NULL
>
> DatabaseError: ORA-06502: PL/SQL: numeric or value error: character
> string buffer too small
> ORA-06512: at line 1
> }}}

New description:

 Model contains
 {{{
 somefield = models.TextField(blank=True, null=True)
 }}}
 At 4.1.9:

 {{{
 print(MyModel.objects.filter(somefield=None).only('id').query)

 }}}

 {{{
 SELECT "TNAME_MYMODEL"."ID" FROM "TNAME_MYMODEL" WHERE
 "TNAME_MYMODEL"."SOMEFIELD"  IS NULL

 }}}
 works

 At 4.2.0:

 {{{
 print(MyModel.objects.filter(somefield=None).only('id').query)

 }}}

 {{{
 SELECT "TNAME_MYMODEL"."ID" FROM "TNAME_MYMODEL" WHERE
 DBMS_LOB.SUBSTR("TNAME_MYMODEL"."SOMEFIELD") IS NULL

 DatabaseError: ORA-06502: PL/SQL: numeric or value error: character string
 buffer too small
 ORA-06512: at line 1
 }}}

--

Comment:

 Thanks for this ticket, however it works for me. I cannot reproduce
 `ORA-06502` on Oracle 19c.

 Please reopen the ticket if you can debug your issue and provide a small
 sample project that reproduces the issue.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34544#comment:4>
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/01070187f0ed7097-a8e1734f-4676-4e12-bfce-3fa89ec28bcc-000000%40eu-central-1.amazonses.com.

Reply via email to