Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.0.10
-
None
-
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,)]
|
>>>
|