On Sat, 2009-04-04 at 01:21 -0400, Daniel Tang wrote: [...] > Not sure if this is an end-all solution, but you can pass a > client_flag kwarg that makes MySQLdb return the number of matched rows > instead of affected rows. In MySQLdb.constants.CLIENT there is a > FOUND_ROWS constant. Passing it to connect resolves this problem. > Patch attached just to show what I did.
Hmm ... didn't know about that one. Interesting and might well be worth it. The usual argument against that kind of thing is that we try to proxy the cursor returned from MySQLdb.connect() fairly transparently, so that people can use django.db.connection.cursor() as a fairly normal PEP 249 cursor. Your idea changes that behaviour, as now the database returns something different from what it "normally" would. However, it's a fairly minor change and given the relative ugliness of the alternatives (in fact, it introduces a very small race condition), it's worth thinking about. Thanks for pointing it out. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---