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

executemany does not work with returning clause

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.10
    • 1.0.11, 1.1.2
    • DBAPI 2.0
    • None
    • 3.9.9

    Description

      executemany accepts returning clause in query, but it does not return any resultset.

      execute with many values, works as expected.

      >>> import mariadb
      >>> db = mariadb.connect(host='192.168.1.1', user='Administrador', password='xxxxxxx', database='yyyyyyy')
      >>> qr = db.cursor(buffered=True)
      >>> 
      >>> qr.execute('create table temp_test (a int unsigned not null primary key auto_increment, b int)')
      >>> rows = [(1, ), (2, ), (3, )]
      >>> qr.executemany('insert into temp_test (b) values (?) returning a', rows)
      >>> qr.fetchall()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      mariadb.ProgrammingError: Cursor doesn't have a result set
      >>> 
      >>> qr.execute('insert into temp_test (b) values (1), (2), (3) returning a')
      >>> qr.fetchall()
      [(4,), (5,), (6,)]
      >>> 
      

      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.