-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
johnny-cache should use query.table_map.keys(), not query.tables #7
Comments
As a silly demonstration of the problem, suppose we have
See:
|
I've tried to make this change. It appears to work in Django 1.1 (ugh) in the https://github.com/jmoiron/johnny-cache/blob/master/johnny/tests/cache.py#L649-653 Specifically, during that "clear()", a delete query is made, and the method patched onto ipdb> cls.query
<django.db.models.sql.subqueries.DeleteQuery object at 0x20cd310>
ipdb> cls.query.tables
['testapp_book_authors']
ipdb> cls.query.table_map
{}
ipdb> import django
ipdb> django.VERSION
(1, 4, 1, 'final', 0) I'm ... not sure why that is, but this leads to an over-caching bug. Any thoughts? |
Hmm, can you like to a specific commit? I'm not sure which lines you're referring to, since HEAD 649 there doesn't point to a delete query. |
https://github.com/jmoiron/johnny-cache/blob/master/johnny/cache.py#L400 With a list of the |
query.tables includes aliases, such as "T6"; these alias names are useless in terms of invalidation and also cause a lot of generational noise. They are necessarily the same base tables (aliases are only generated if required because a query refers to the same table more than once).
The text was updated successfully, but these errors were encountered: