#35594: Add support for non-distinct NULL expressions to
UniqueConstraint.validate()
-------------------------------------+-------------------------------------
Reporter: Mark Gensler | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: unique constraint | Triage Stage: Accepted
nulls_distinct validation |
expressions |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* keywords: uniqueconstraint nulls_distinct => unique constraint
nulls_distinct validation expressions
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Thanks for creating the report!
This was missed in #34701. Elevating to release blocker as this is a bug
in a newly released feature.
I guess solution would be that when `nulls_distinct=True` all expressions
checks should be turned into `OR (rhs IS NULL AND lhs IS NULL)`
{{{#!sql
SELECT 1 FROM book WHERE lower(name) = lower(NULL)
}}}
Is turned into
{{{#!sql
SELECT 1 FROM book WHERE (lower(name) = lower(NULL)) OR (lower(name) IS
NULL AND lower(NULL) IS NULL)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35594#comment:2>
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/01070190a271e91a-065fa413-0adc-4461-9908-daa8990e04d9-000000%40eu-central-1.amazonses.com.