Opened 17 years ago
Closed 17 years ago
#6807 closed (fixed)
execute_sql in django/db/models/sql/query.py fails with MySQL due to incorrect sentinel
Description ¶
Line 1333: return iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)), []) fails under MySQL because the cursor.fetchmany() call returns an empty tuple as sentinel, rather than an empty list. The empty list sentinel is correct for sqlite. I attempted to run runtests.py, which hung on "Running post-sync handlers for application string_lookup". When I changed the sentinel to a tuple, runtests.py ran to completion (four failing tests, but completion) with MySQL, yet hung in the exact same place with sqlite.
Change History (3)
by , 17 years ago
Attachment: | iterator_sentinel.patch added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
Nice catch. But I'd prefer to have a function that just returns the "empty sentinel" value in each case, rather than testing for one or the other.
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Sets iterator sentinel to proper sentinel type for sqlite and mysql backends.