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

execute() with INSERT statement fails after executemany()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.0a1
    • 1.1.0b1
    • DBAPI 2.0
    • None
    • 3.9

    Description

      Since execute() and executemany() use the same callback for retrieving data, array_size needs to be cleared.

      Example:

      import mariadb

      connection= mariadb.connect(db="test")
       
      cursor= connection.cursor()
       
      cursor.execute("create temporary table t1 (a int, b int)")
       
      cursor.executemany("insert into t1 values (?,?)", [(1,2),(3,4)])
       
      cursor.execute("insert into t1 values (?,?)", (4,5))
      

      raises exception:
      mariadb.DataError: Can't access column number 1 at row 1

      Attachments

        Activity

          People

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