Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
1.0.1
-
None
-
fedora 31, mariadb server 10.3.22
Description
the following program throws the above mentioned error:
import mariadb
|
|
conn = mariadb.connect(user="scott", password="tiger", db="test", host="localhost")
|
|
cursor = conn.cursor()
|
cursor.execute("select 1")
|
row = cursor.fetchone()
|
|
conn.rollback()
|
|
result:
|
|
$ python test3.py
|
Traceback (most recent call last):
|
File "test3.py", line 9, in <module>
|
conn.rollback()
|
mariadb.InterfaceError: Commands out of sync; you can't run this command now
|
if the cursor is closed first, no error is raised.
using other DBAPI drivers such as mysqlclient, mysql-connector, and pymysql, no error is raised with the identical program, generally it's not standard behavior that rollback() fails if a cursor is open, and also if this were part of mariadb-connector's contract, it should raise an informative error that the cursor was not closed when it should have been.
I'm also getting segfaults in some similar cases however i dont have a reproducer for that right now.