execute_sql in django/db/models/sql/query.py fails with MySQL due to incorrect sentinel
|Reported by:||tpherndon||Owned by:||tpherndon|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
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.