Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.0.3
-
None
Description
When there arr pending result sets, cursor.close() needs to clear them to prevent out of sync errors when executing another cursor.
import mariadb |
from mariadb.constants import CLIENT |
|
c= mariadb.connect(client_flag=CLIENT.MULTI_STATEMENTS) |
|
cursor1= c.cursor() |
cursor1.execute("SELECT 1; SELECT 2; SELECT 3") |
cursor1.close
|
cursor2= c.cursor() |
cursor2.execute("SELECT 1") |
cursor2.fetchall()
|
results in following error:
mariadb.InterfaceError: Commands out of sync; you can't run this command now