[CONPY-218] Cursor does not accept None as parameter Created: 2022-07-20  Updated: 2022-07-21  Resolved: 2022-07-21

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 1.1.3
Fix Version/s: 1.1.4

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

Python Version: 3.10

 Description   

Python connector in 1.1 does not accept None as valid data (indicating no data at all) for cursor execute method.

1.0 works as expected.

The error occurs on cursors.py in line 268:

        if len(data):

As a suggestion, I would put it before (Avoiding error in lines 268 and 281):

        data = data or ()  # force an empty tuple if None was provided.



 Comments   
Comment by Georg Richter [ 2022-07-21 ]

Thanks for the report and provided fix - fixed in 1.1.4 (rev. 205b9c276824115c4b32154e37eea9eed86130df)

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