Hey Malcolm, I was not aware that this behaviour changed between minor versions :-( You're right: after updating from 3.2.1 to 3.2.8 no problems.
Ubuntu breeze currently provides 3.2.1, dapper will provide 3.2.8. Malcolm Tredinnick wrote: > (1) If you are using a sufficiently old version of SQLite, the SQL > produced by distinct().count() does not respect the "distinct" modifier. This will make finding related bugs really hard. There shouldn't be hidden surprises when you switch from one database to another. > (2) Inside the SQLite backend, try to work out if the version is > sufficiently old and do the "count(distinct(..))" bit by hand by doing a > "SELECT DISTINCT..." and then counting the number of results (sadly, in > pysqlite2, cursor.rowcount is always -1 after a query, so can't cheat). Hmm. Somehow I don't like that the behaviour should change like this, and I also don't like Django fixing things that belong into the database. There should be at least a warning on startup. > (3) We don't support QuerySet.distinct().count() on older versions of > SQLite. We can make the tests conditional, so that if you get the > "unsupported" error, it just informs you (raises an exception?). We > might even be able to make the tests always pass. I'm all for this. I would like to see a test on startup within the sqlite3 backend if count(disctinct(...)) is supported, and give a red warning message, like "Your database version does not provide the functionality to execute count(disctinct(...)). If you use sqlite, updating to ... should help. If you don't use count().distinct() in your code, there should be no further problems." Tests should fail, since the db does not provide the functionality, but there might be a more helpful message, could be the same as above. > (4) We back out this change. Hmm. I personally don't like this. If this policy of the least common denominator was applied to all databases, there wouldn't be transaction control. Just my 2c, Michael --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
