@@ -776,6 +776,16 @@ stmt_mark_dirty(pysqlite_Statement *self)
776
776
self -> in_use = 1 ;
777
777
}
778
778
779
+ static inline sqlite3_int64
780
+ changes (sqlite3 * db )
781
+ {
782
+ #if SQLITE_VERSION_NUMBER >= 3037000
783
+ return sqlite3_changes64 (db );
784
+ #else
785
+ return (sqlite3_int64 )sqlite3_changes (db );
786
+ #endif
787
+ }
788
+
779
789
PyObject *
780
790
_pysqlite_query_execute (pysqlite_Cursor * self , int multiple , PyObject * operation , PyObject * second_argument )
781
791
{
@@ -945,12 +955,12 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
945
955
}
946
956
947
957
if (self -> statement -> is_dml && rc == SQLITE_DONE && multiple ) {
948
- self -> rowcount += ( long ) sqlite3_changes (self -> connection -> db );
958
+ self -> rowcount += changes (self -> connection -> db );
949
959
}
950
960
951
961
if (rc == SQLITE_DONE && !multiple ) {
952
962
if (self -> statement -> is_dml ) {
953
- self -> rowcount = ( long ) sqlite3_changes (self -> connection -> db );
963
+ self -> rowcount = changes (self -> connection -> db );
954
964
}
955
965
stmt_reset (self -> statement );
956
966
Py_CLEAR (self -> statement );
@@ -1127,7 +1137,7 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
1127
1137
int rc = stmt_step (stmt );
1128
1138
if (rc == SQLITE_DONE ) {
1129
1139
if (self -> statement -> is_dml ) {
1130
- self -> rowcount = ( long ) sqlite3_changes (self -> connection -> db );
1140
+ self -> rowcount = changes (self -> connection -> db );
1131
1141
}
1132
1142
(void )stmt_reset (self -> statement );
1133
1143
}
0 commit comments