On Jun 30, 2008, at 1:27 PM, Collin Grady wrote:
> > George Vilches said the following: >> As of http://code.djangoproject.com/changeset/7798 in the MySQL >> DatabaseWrapper.operations, Malcolm has changed the "__exact" filter >> to use '= BINARY' to force case-sensitive comparisons, which is >> appropriate. >> >> I therefore propose that operations."__iexact" should be changed from >> 'LIKE %s' to '= %s', which performs much better, and gives the same >> results for the cases which the documentation specifically describes: >> "Case-insensitive exact match". There's no reason to be using LIKE >> here when the database gives us a better built-in option for the same >> behavior. > > Actually, based on what I remember of my testing for #3575[1], = and > LIKE were about the same when using a case insensitive collation > (though I don't seem to have mentioned that in the ticket, since it > didn't really matter there) Well, if that's true, that covers about half the problem (I will be verifying The other half is that if someone puts a string like 'ab%c' into a __iexact search, the % is not currently escaped (correct me if I'm wrong here), then it's going to run a weird LIKE statement. So either we should have a backend-specific wildcard escape for these things, tell people "don't be stupid and watch out", or switch to something that doesn't use LIKE? George --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
