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

commands out of sync error w/ simple rollback if cursor is not cloed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 1.0.1
    • 1.0.2, N/A
    • DBAPI 2.0
    • 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.

      Attachments

        Activity

          People

            georg Georg Richter
            zzzeek Mike Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.