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

commit clears cursor buffer before fetch

    XMLWordPrintable

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

          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.