Opened 3 years ago
Closed 3 years ago
#33228 closed Cleanup/optimization (fixed)
Change BaseDatabaseFeatures.has_case_insensitive_like to False
Reported by: | Tim Graham | Owned by: | Chinmoy |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
It seems that a better default for this feature would be False
, as of the built-in backends, only SQLite uses True
. In addition, all three of the databases I've built third-party backends for (Cloud Spanner, CockroachDB, Snowflake) all use False
. Of course, a mention in the release notes that the default is changed is still appropriate.
Change History (6)
comment:1 by , 3 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 3 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 3 years ago
comment:4 by , 3 years ago
You should add has_case_insensitive_like = True
to the sqlite3 backend (and remove the now unneeded has_case_insensitive_like = False
from the others).
I was going through the code and after changing the value to
False
, one of the tests seemed to fail.with the error
AssertionError: Sequences differ: <QuerySet [<Employee: Jack Jackson>, <Employee: Jack jackson>]> != [<Employee: Jack Jackson>]
.I don't understand why the query filter returns
<QuerySet [<Employee: Jack Jackson>, <Employee: Jack jackson>]>
when the default value ofhas_case_insensitive_like
is set toFalse
? @Mariusz Felisiak any suggestion on this?