Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 0.9.55
    • 0.9.56
    • DBAPI 2.0
    • None

    Description

      if a select query is executed without parameter, after commit, the cursor looses fetched rows.

      db = mariadb.connect(...)
      qr = db.cursor(buffered=True)
      qr.execute('create temporary table temp (a int unsigned)')
      qr.execute('insert into temp values (1), (2), (3)')
       
      qr.execute('select a from temp')
      db.commit()
      qr.fetchall()
      Traceback (most recent call last):
        File "<input>", line 1, in <module>
          qr.fetchall()
      mariadb.ProgrammingError: Cursor doesn't have a result set
       
      qr.execute('select a from temp where a > ?', (0, ))
      db.commit()
      qr.fetchall()
      [(1,), (2,), (3,)]
      

      Attachments

        Activity

          lucianobarcaro Luciano Barcaro created issue -
          georg Georg Richter made changes -
          Field Original Value New Value
          Fix Version/s 0.9.56 [ 24303 ]
          georg Georg Richter made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          georg Georg Richter added a comment -

          Fix should be simple: if cursor type is buffered, we need to store the field_count value inside cursor instead of calling the api function mysql_(stmt_)field_count which was resetted due to previous commit call.

          georg Georg Richter added a comment - Fix should be simple: if cursor type is buffered, we need to store the field_count value inside cursor instead of calling the api function mysql_(stmt_)field_count which was resetted due to previous commit call.

          Georg, did you noted that if I pass a parameter, the commit does not flush the cursor buffer?

          lucianobarcaro Luciano Barcaro added a comment - Georg, did you noted that if I pass a parameter, the commit does not flush the cursor buffer?
          georg Georg Richter made changes -
          issue.field.resolutiondate 2020-04-05 19:53:37.0 2020-04-05 19:53:37.685
          georg Georg Richter made changes -
          Component/s DBAPI 2.0 [ 14516 ]
          Resolution Fixed [ 1 ]
          Status Confirmed [ 10101 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 106735 ] MariaDB v4 [ 135626 ]

          People

            georg Georg Richter
            lucianobarcaro Luciano Barcaro
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.