Python3 interpretator: print(ret[0]) Segmentation fault

I created a Test database and an exam table to reproduce the problem in my program. Architecture used:
Ubuntu 20.04.2 LTS, Python 3.8.10, mariadb 1.0.7 python extension, MariaDB 10.5.11

In mariadb client in database Test:
CREATE TABLE exam(
→ dep integer not null,
→ org integer not null,
→ comm varchar(150),
→ own integer not null);
AlTER TABLE exam ADD CONSTRAINT PRIMARY KEY(dep, own);

In Python3 interpretator:

import mariadb;
dbconnection = mariadb.connect(host=“localhost”, user=““, password=”***”, database=“test”)
cursor = dbconnection.cursor();
cursor.execute(“INSERT INTO exam(dep, org, comm, own) VALUES (%s, %s, %s, %s) RETURNING dep, own”, [1, 2, “normal-test”,3])
ret = cursor.fetchone()
print(ret)
(1, 3)
print(ret[0])
1
cursor.execute(“INSERT INTO exam(dep, org, comm, own) VALUES (%s, %s, %s, %s) RETURNING dep, own”, [1, 2, “None-test”, None])
ret = cursor.fetchone()
print(ret)
(, )
print(not ret)
False
print(ret[0])
Segmentation fault

mariadb is not included in the Python standard library; it’s an externally developed project. I suggest to report this problem on the mariadb Python extension bug tracker.