[CONPY-193] executemany() with NULL values fails in fallback mode Created: 2022-02-08  Updated: 2023-03-28  Resolved: 2022-02-08

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.0.9
Fix Version/s: 1.0.10

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
Python Version: 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)]



 Comments   
Comment by Michael Currie [ 2023-03-28 ]

This is a problem again; see @CONPY-254.

Generated at Thu Feb 08 03:30:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.