#20462 closed Bug (fixed)
Regex lookups should not fail on null/None and non-string values on SQLite
Reported by: | noirbizarre | Owned by: | amclark7 |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.4 |
Severity: | Normal | Keywords: | sqlite, regex, lookup |
Cc: | timograham@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The user function provided to do the regex lookup is buggy for two cases:
- raise an exception when the value is None (null in databse)
- raise an exception when the value is not a string
I provided a pull request fixing these issues: https://github.com/django/django/pull/1043
Change History (12)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 11 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
Resolution: | fixed |
Status: | closed → new |
Triage Stage: | Ready for checkin → Accepted |
comment:6 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:7 by , 11 years ago
Patch needs improvement: | unset |
---|
Added a pull request for fixing this issue: https://github.com/django/django/pull/1306
This is only a minor change compared to the original patch provided by noirbizarre.
comment:8 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:9 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
As pointed out in IRC by loic84, the str()
cast added in django/db/backends/sqlite3/base.py
should probably be something like force_text
to properly handle unicode.
comment:11 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Ensuring that all databases behave the same way whenever this is possible is a good idea.