if a select query is executed without parameter, after commit, the cursor looses fetched rows.
db = mariadb.connect(...)
|
qr = db.cursor(buffered=True)
|
qr.execute('create temporary table temp (a int unsigned)')
|
qr.execute('insert into temp values (1), (2), (3)')
|
|
qr.execute('select a from temp')
|
db.commit()
|
qr.fetchall()
|
Traceback (most recent call last):
|
File "<input>", line 1, in <module>
|
qr.fetchall()
|
mariadb.ProgrammingError: Cursor doesn't have a result set
|
|
qr.execute('select a from temp where a > ?', (0, ))
|
db.commit()
|
qr.fetchall()
|
[(1,), (2,), (3,)]
|