Revision 2800
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
227 | 227 |
self.result = e # cache the exception as the result |
228 | 228 |
self._cache_result() |
229 | 229 |
raise |
230 |
# Fetch all rows so result will be cached
|
|
231 |
if self.rowcount == 0 and not self._is_insert: consume_rows(self)
|
|
230 |
if self.rowcount == 0 and query.startswith('SELECT'): # empty SELECT
|
|
231 |
consume_rows(self) # fetch all rows so result will be cached
|
|
232 | 232 |
return cur |
233 | 233 |
|
234 | 234 |
def fetchone(self): |
Also available in: Unified diff
sql.py: DbConn.DbCursor.execute(): Only fetch all rows for empty SELECT query, to support older versions of Python that would give a "no results to fetch" error for other types of queries