[CONPY-61] executemany() doesn't allow inserting optional entries Created: 2020-05-03 Updated: 2020-12-08 Resolved: 2020-05-05 |
|
| Status: | Closed |
| Project: | MariaDB Connector/Python |
| Component/s: | Generic |
| Affects Version/s: | 0.9.57 |
| Fix Version/s: | 0.9.58 |
| Type: | Bug | Priority: | Major |
| Reporter: | Robin Wismeth | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Archlinux 5.6.8-arch1-1 x86_64 |
||
| Description |
Description:When inserting multiple entries into a column that allows NULL values executemany() throws a DataError. This only happens if some of the tuples contain values with the coresponding type and some are of type None. If all values are None or if all values are not None and have the proper type, this error doesn't occur. Steps to reproduce:1. create a table with a column that allows NULL values
2. use executemany() to insert values that can either be of type int (in this example) or None
Expected result:Either a proper exception that describes why None cannot be inserted together with the proper type or insertion of NULL values. Actual result:A mariadb.DatabaseError.DataError with the message "Invalid parameter type at row 2, column 1". (Another example can be found on StackOverflow) |
| Comments |
| Comment by Georg Richter [ 2020-05-05 ] | |||||||||||||||||||||
|
Thanks for your bug report. It seems like a regression bug, since the check for indicator variable was removed in a previous commit. Added the following test (using None and/or indicators):
|