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

commit clears cursor buffer before fetch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.55
    • Fix Version/s: 0.9.56
    • Component/s: DBAPI 2.0
    • Labels:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            lucianobarcaro Luciano Barcaro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: