Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7130 closed (fixed)

MySQL 4.1 and the NOT LIKE in QuerySet refactor Fails

Reported by: bo <bo.blanton@…> Owned by: gav
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 7 years ago by gav

  • Keywords qsrf-cleanup added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by gav

  • Owner changed from nobody to gav
  • Status changed from new to assigned

comment:3 Changed 7 years ago by jacob

  • milestone set to 1.0

comment:4 Changed 7 years ago by gav

  • Resolution set to fixed
  • Status changed from assigned to closed

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 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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