#34060: Creating CheckConstraint on JSONField with __exact lookup on key
transforms
crashes on Oracle.
-------------------------------------+-------------------------------------
Reporter: Mariusz | Owner: nobody
Felisiak |
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 |
-------------------------------------+-------------------------------------
Creating `CheckConstraint` on `JSONField` with `__exact` lookup on key
transforms crashes on Oracle:
{{{
class Version(models.Model):
metadata = models.JSONField(null=True)
class Meta:
constraints = [
models.CheckConstraint(
check=models.Q(metadata__stage="stable"),
name="only_stable_version",
),
]
}}}
Crashes with:
{{{
File "/django/django/db/backends/oracle/base.py", line 557, in execute
return self.cursor.execute(query, self._param_generator(params))
cx_Oracle.DatabaseError: ORA-00904: "DBMS_LOB"."SUBSTR": invalid
identifier
}}}
`DBMS_LOB.SUBSTR` is unnecessary in this case.
It's not a regression.
--
Ticket URL: <https://code.djangoproject.com/ticket/34060>
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/0107018382e03afb-98756026-ad1a-40b3-8eb0-aa857e8f9ca6-000000%40eu-central-1.amazonses.com.