Revision 3007
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
237 | 237 |
|
238 | 238 |
# Always cache certain queries |
239 | 239 |
if query.startswith('CREATE') or query.startswith('ALTER'): |
240 |
self._cache_result() # structural changes |
|
240 |
# structural changes |
|
241 |
if query.find('ADD COLUMN') < 0: # rest of query must be unique |
|
242 |
self._cache_result() |
|
241 | 243 |
elif self.rowcount == 0 and query.startswith('SELECT'): # empty |
242 | 244 |
consume_rows(self) # fetch all rows so result will be cached |
243 | 245 |
|
Also available in: Unified diff
sql.py: DbConn.DbCursor.execute(): Don't cache ADD COLUMN queries because the rest of the query must be unique in order to use caching