Fix for CONPY-225:

Set value for affected_rows.
This commit is contained in:
Georg Richter
2022-10-07 08:47:48 +02:00
parent 37ea27cf86
commit d70be504e3
2 changed files with 22 additions and 2 deletions

View File

@ -236,7 +236,7 @@ static struct PyMemberDef MrdbCursor_Members[] =
T_ULONGLONG,
offsetof(MrdbCursor, affected_rows),
READONLY,
"Number of affected rows"},
"This property is deprecated - use rowcount instead."},
{"_rownumber",
T_ULONGLONG,
offsetof(MrdbCursor, row_number),
@ -646,8 +646,9 @@ PyObject *MrdbCursor_InitResultSet(MrdbCursor *self)
if (self->field_count)
{
self->row_count= CURSOR_NUM_ROWS(self);
self->affected_rows= 0;
} else {
self->row_count= CURSOR_AFFECTED_ROWS(self);
self->row_count= self->affected_rows= CURSOR_AFFECTED_ROWS(self);
}
self->lastrow_id= CURSOR_INSERT_ID(self);