Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
0.9.1
-
None
Description
When a connection was closed or died, cursor should be invalidated/closed too.
>>> conn=mariadb.connection(user="root") |
>>> cursor=conn.cursor()
|
>>> print(cursor.closed)
|
False
|
>>> conn.close()
|
>>> print(cursor.closed)
|
False
|
That means closed should be implemented as getter/setter function and should check the following conditions:
- is connection alive
- is statement valid
- is statement error code==CR_STMT_CLOSED
Additionally the MARIADB_CHECK_STMT macro should also check if the error code is CR_STMT_CLOSED.