mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-07 11:39:43 +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);
|
if ((self->field_count= CURSOR_FIELD_COUNT(self)))
|
||||||
self->lastrow_id= CURSOR_INSERT_ID(self);
|
{
|
||||||
MARIADB_FREE_MEM(self->values);
|
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;
|
Py_RETURN_NONE;
|
||||||
error:
|
error:
|
||||||
MrdbCursor_clear(self, 0);
|
MrdbCursor_clear(self, 0);
|
||||||
|
Reference in New Issue
Block a user