Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.10
-
Component/s: DBAPI 2.0
-
Labels:None
-
Python Version:3.9.9
Description
executemany accepts returning clause in query, but it does not return any resultset.
execute with many values, works as expected.
>>> import mariadb
|
>>> db = mariadb.connect(host='192.168.1.1', user='Administrador', password='xxxxxxx', database='yyyyyyy')
|
>>> qr = db.cursor(buffered=True)
|
>>>
|
>>> qr.execute('create table temp_test (a int unsigned not null primary key auto_increment, b int)')
|
>>> rows = [(1, ), (2, ), (3, )]
|
>>> qr.executemany('insert into temp_test (b) values (?) returning a', rows)
|
>>> qr.fetchall()
|
Traceback (most recent call last):
|
File "<stdin>", line 1, in <module>
|
mariadb.ProgrammingError: Cursor doesn't have a result set
|
>>>
|
>>> qr.execute('insert into temp_test (b) values (1), (2), (3) returning a')
|
>>> qr.fetchall()
|
[(4,), (5,), (6,)]
|
>>>
|