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

execute() with INSERT statement fails after executemany()

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

          georg Georg Richter created issue -
          georg Georg Richter made changes -
          Field Original Value New Value
          Affects Version/s 1.1.0a1 [ 26100 ]
          Affects Version/s 1.1.0 [ 25706 ]
          georg Georg Richter made changes -
          Fix Version/s 1.1.0a2 [ 26093 ]
          georg Georg Richter made changes -
          issue.field.resolutiondate 2021-09-07 06:49:52.0 2021-09-07 06:49:52.242
          georg Georg Richter made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 124854 ] MariaDB v4 [ 135716 ]

          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.