mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-07-28 06:40:03 +00:00
Fix for CONPY-194:
Since executemany() returns a result set if the insert, update, delete or replace statement contains returning directive, we need to check if execute returned number of fiels and allocate a result set.
This commit is contained in:
@ -1406,9 +1406,17 @@ MrdbCursor_executemany(MrdbCursor *self,
|
||||
}
|
||||
}
|
||||
|
||||
self->row_count= CURSOR_AFFECTED_ROWS(self);
|
||||
self->lastrow_id= CURSOR_INSERT_ID(self);
|
||||
MARIADB_FREE_MEM(self->values);
|
||||
if ((self->field_count= CURSOR_FIELD_COUNT(self)))
|
||||
{
|
||||
if (MrdbCursor_InitResultSet(self))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
self->row_count= CURSOR_AFFECTED_ROWS(self);
|
||||
self->lastrow_id= CURSOR_INSERT_ID(self);
|
||||
MARIADB_FREE_MEM(self->values);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
error:
|
||||
MrdbCursor_clear(self, 0);
|
||||
|
Reference in New Issue
Block a user