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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 1.0.1
    • Fix Version/s: N/A, 1.0.2
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Environment:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            zzzeek Mike Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: