Opened 2 years ago
Last modified 2 years ago
#34544 closed Bug
models.TextField with =None filter throws Error for Oracle — at Initial Version
| Reported by: | Michael Smith | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 4.2 |
| Severity: | Release blocker | Keywords: | Oracle isnull lob |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
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
Note:
See TracTickets
for help on using tickets.