mozilla / code-review

Automated static analysis & linting bot for Mozilla repositories
Mozilla Public License 2.0
56 stars 42 forks source link

Distinct null values on IssueLink constraints #2537

Closed La0 closed 20 minutes ago

La0 commented 1 day ago

While working on #2536 I found out that we can have duplicate IssueLink with the same positioning arguments (nb_lines, line, char), provided one of these values is NULL.

This is because Django defaults (and the databases default behaviour) makes the nullable values as distinct ones (so it does not trigger the constraint).

If I understand correctly the notes on Django doc, only Postgresql 15+ is supported to use nulls_distinct=False

La0 commented 1 day ago

I have made some unit tests that should pass if the constraint worked as expected.

By using nulls_distinct=False, we see that the tests are OK... on postgresql.

So this means that the CI must use a postgresql server