Opened 9 years ago

Closed 8 years ago

Last modified 5 years ago

#7130 closed (fixed)

MySQL 4.1 and the NOT LIKE in QuerySet refactor Fails

Reported by: bo <bo.blanton@…> Owned by: George Vilches
Component: Uncategorized Version: master
Severity: Keywords: qsrf-cleanup
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 9 years ago by George Vilches

Keywords: qsrf-cleanup added

comment:2 Changed 9 years ago by George Vilches

Owner: changed from nobody to George Vilches
Status: newassigned

comment:3 Changed 8 years ago by Jacob

milestone: 1.0

comment:4 Changed 8 years ago by George Vilches

Resolution: fixed
Status: assignedclosed

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.

comment:5 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top