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

executemany does not work with returning clause

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.10
    • Fix Version/s: 1.0.11, 1.1.2
    • Component/s: DBAPI 2.0
    • Labels:
      None
    • Python Version:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            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.