#7130 closed (fixed)
MySQL 4.1 and the NOT LIKE in QuerySet refactor Fails
Reported by: | Owned by: | George Vilches | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | qsrf-cleanup | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
A simple Query to find things not like
Myobject.objects.all().exclude(name__icontains = "moo")
results in the Query
SELECT * from myobject where NOT name LIKE "%moo%"
which works for MySQL 5.X, but not for 4.X, it was (before the refactor)
SELECT * from myobject where NOT (name LIKE "%moo%")
which works in both 5.X and 4.X
weather or not you 'support' at least MySQL 4.1 is unknown to me really, but if you do, then this is a little thing that needs fixing
Change History (5)
comment:1 by , 17 years ago
Keywords: | qsrf-cleanup added |
---|
comment:2 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 17 years ago
milestone: | → 1.0 |
---|
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
This was fixed by r7509, which made sure that all NOT clauses are surrounded by parentheses. I verified this on MySQL 5.0 and 4.1. Reopen this ticket if you are able to generate the error still.