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

executemany() with NULL values fails in fallback mode

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.9
    • 1.0.10
    • DBAPI 2.0
    • None
    • 3.10

    Description

      When connected to a server which doesn't support bulk operations (binary protocol) the fallback routine doesn't handle NULL values correctly.

      import mariadb
       
      conn = mariadb.connect(db="test")
      cur=conn.cursor()
      cur.execute("create table t1(x int, y int, z int)")
       
      sql = "insert into t1 values(?,?,?)"
       
      d=[(None,1,1),(2,None,2),(3,3,None)]
      print(f'input: {d}')
      cur.executemany(sql, d)
       
      cur.execute("select * from t1")
      y=cur.fetchall()
       
      print(f'result: {y}')
      

      Output:

      input : [(None, 1, 1), (2, None, 2), (3, 3, None)]
      result: [(None, 1, 1), (None, None, 2), (None, None, None)]
      

      Attachments

        Activity

          People

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