Skip to content

Commit b75b725

Browse files
Refactor
1 parent 02bd83f commit b75b725

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Modules/_sqlite/cursor.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,6 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
944944
}
945945
}
946946

947-
if (self->statement->is_dml && rc == SQLITE_DONE && multiple) {
948-
self->rowcount += (long)sqlite3_changes(self->connection->db);
949-
}
950-
951947
if (rc == SQLITE_DONE && !multiple) {
952948
if (self->statement->is_dml) {
953949
self->rowcount = (long)sqlite3_changes(self->connection->db);
@@ -958,6 +954,9 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
958954

959955
if (multiple) {
960956
stmt_reset(self->statement);
957+
if (self->statement->is_dml && rc == SQLITE_DONE) {
958+
self->rowcount += (long)sqlite3_changes(self->connection->db);
959+
}
961960
}
962961
Py_XDECREF(parameters);
963962
}

0 commit comments

Comments
 (0)