petehunt/PyMySQL — Issue #82: __iter__ from Cursor doesn't work as expected
Author: vejnar
Created: 2011-10-09 09:15:13+00:00
State: open

The following program is working the version 0.4:

```python
conn = pymysql.connect(host='localhost', user='XXX', passwd='XXX', db='XXX', charset='utf8')
cursor = conn.cursor()

cursor.execute("select * from XXX limit 30;")
for l in cursor:
print(l)
cursor.execute("select * from XXX limit 1;")
print(cursor.fetchone())
```

It returns:

query1.line1
query2a.line1
query1.line2
query2b.line1
query1.line3
query2c.line1
query1.line4
...

Since you applied Allen Kerr's patch it only returns the first 2 lines. The first iterator gets modified by the second query which is not expected.