Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-123

cursor.close() doesn't clear pending result sets

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.3
    • 1.0.4
    • DBAPI 2.0
    • 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

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.