Cannot insert a NULL into the final position, but inserting NULL in any other position is okay.
This makes no sense!
Steps to reproduce the error:
import sys
|
import mariadb
|
NULL = mariadb.constants.INDICATOR.NULL
|
|
conn = mariadb.connect(**db_credentials)
|
cursor = conn.cursor()
|
|
cursor.execute("DROP TABLE IF EXISTS ind1;")
|
cursor.execute("CREATE TABLE ind1 (id1 int, id2 int);")
|
|
# This command works:
|
cursor.executemany(
|
"INSERT INTO ind1 (id1, id2) VALUES (?,?)", [(NULL, 2)])
|
|
# This command returns:
|
# SystemError: <method '_execute_bulk' of 'mariadb.cursor' objects>
|
# returned NULL without setting an exception
|
cursor.executemany(
|
"INSERT INTO ind1 (id1, id2) VALUES (?,?)", [(2, NULL)])
|
|
print(mariadb.__version__)
|
# 1.1.6
|
print(sys.version)
|
# '3.10.9 | packaged by Anaconda, Inc. |
|
# (main, Mar 8 2023, 10:42:25)
|
# [MSC v.1916 64 bit (AMD64)]'
|
print(mariadb.mariadbapi_version)
|
# 3.3.4
|
print(conn.server_info)
|
# 10.7.7-MariaDB-1:10.7.7+maria~ubu2004-log
|