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 14:06:46 +0200 |
| commit | be5e3b46f78d54f8fae5dc255295d771c2becaac (patch) | |
| tree | d084aba8e55ca4d64f6857ac28088adba70b9e6c /docs | |
| parent | 148d60de741e16b5185fb517fc24c6bf5e5f705e (diff) | |
[4.1.x] Fixed #33996 -- Fixed CheckConstraint validation on NULL values.
Bug in 667105877e6723c6985399803a364848891513cc.
Thanks James Beith for the report.
Backport of e14d08cd894e9d91cb5d9f44ba7532c1a223f458 from main
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 9b1e110f85..b52f754294 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`). |
