diff options
| author | David Sanders <shang.xiao.sanders@gmail.com> | 2022-09-09 00:02:58 +1000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-09-13 12:48:31 +0200 |
| commit | e14d08cd894e9d91cb5d9f44ba7532c1a223f458 (patch) | |
| tree | a524445fadbda60124a63468c643f31639d794fc /docs | |
| parent | b731e8841558ee4caaba766c83f34ea9c7004f8b (diff) | |
Fixed #33996 -- Fixed CheckConstraint validation on NULL values.
Bug in 667105877e6723c6985399803a364848891513cc.
Thanks James Beith for the report.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/constraints.txt | 9 | ||||
| -rw-r--r-- | docs/releases/4.1.2.txt | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt index d0a9a017dc..8134a657d8 100644 --- a/docs/ref/models/constraints.txt +++ b/docs/ref/models/constraints.txt @@ -102,6 +102,15 @@ specifies the check you want the constraint to enforce. For example, ``CheckConstraint(check=Q(age__gte=18), name='age_gte_18')`` ensures the age field is never less than 18. +.. admonition:: Oracle + + Checks with nullable fields on Oracle must include a condition allowing for + ``NULL`` values in order for :meth:`validate() <BaseConstraint.validate>` + to behave the same as check constraints validation. For example, if ``age`` + is a nullable field:: + + CheckConstraint(check=Q(age__gte=18) | Q(age__isnull=True), name='age_gte_18') + .. versionchanged:: 4.1 The ``violation_error_message`` argument was added. diff --git a/docs/releases/4.1.2.txt b/docs/releases/4.1.2.txt index 96c2fefcdc..546ab7a635 100644 --- a/docs/releases/4.1.2.txt +++ b/docs/releases/4.1.2.txt @@ -15,3 +15,6 @@ Bugfixes * Fixed a regression in Django 4.1 that caused aggregation over a queryset that contained an ``Exists`` annotation to crash due to too many selected columns (:ticket:`33992`). + +* Fixed a bug in Django 4.1 that caused an incorrect validation of + ``CheckConstraint`` on ``NULL`` values (:ticket:`33996`). |
