Opened 17 years ago

Closed 16 years ago

Last modified 13 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: 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 George Vilches, 16 years ago

Keywords: qsrf-cleanup added

comment:2 by George Vilches, 16 years ago

Owner: changed from nobody to George Vilches
Status: newassigned

comment:3 by Jacob, 16 years ago

milestone: 1.0

comment:4 by George Vilches, 16 years ago

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 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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