Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A while back the default behavior was changed in 3.2.x to make IsUnique strict about nulls. When that code was merged into `3.next` I deleted the 'duplicate' code. Then that change was reverted in `master` leaving these tests failing. This restores the behavior and fixes the failing tests.
- Loading branch information
Showing
1 changed file
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86e24ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
So by default it will work like before (for BC sake) but you can set allowMultipleNulls to false?
86e24ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do it the other way around and in 4.x change the default behavior possibly:
e.g.
default in 3.x:
treatNullsAsUnique => false
default in 4.x (or 5.x):
treatNullsAsUnique => true
Just a different perspective.
86e24ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's an option. I think sticking with SQL equivalence as the default is probably going to surprise fewer people though.
86e24ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, however that's not BC, is it?
What I meant is mostly changing the names because the current option flag doesn't really "tell" me what to expect, e.g.
treatNullsAsUnique
or similar does what you expect...allowMultipleNulls
I don't really understand by reading just it.86e24ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the code enforces SQL UNIQUE behavior (which allows multi-column indices to have duplicates if one column contains a null). The new option allows you to enforce no duplicates including nulls.