Skip to content

Commit 02bd83f

Browse files
Revert 64-bit API support
1 parent ef10d9e commit 02bd83f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

Modules/_sqlite/cursor.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -776,16 +776,6 @@ stmt_mark_dirty(pysqlite_Statement *self)
776776
self->in_use = 1;
777777
}
778778

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-
789779
PyObject *
790780
_pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation, PyObject* second_argument)
791781
{
@@ -955,12 +945,12 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
955945
}
956946

957947
if (self->statement->is_dml && rc == SQLITE_DONE && multiple) {
958-
self->rowcount += changes(self->connection->db);
948+
self->rowcount += (long)sqlite3_changes(self->connection->db);
959949
}
960950

961951
if (rc == SQLITE_DONE && !multiple) {
962952
if (self->statement->is_dml) {
963-
self->rowcount = changes(self->connection->db);
953+
self->rowcount = (long)sqlite3_changes(self->connection->db);
964954
}
965955
stmt_reset(self->statement);
966956
Py_CLEAR(self->statement);
@@ -1137,7 +1127,7 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
11371127
int rc = stmt_step(stmt);
11381128
if (rc == SQLITE_DONE) {
11391129
if (self->statement->is_dml) {
1140-
self->rowcount = changes(self->connection->db);
1130+
self->rowcount = (long)sqlite3_changes(self->connection->db);
11411131
}
11421132
(void)stmt_reset(self->statement);
11431133
}

Modules/_sqlite/cursor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct
3838
PyObject* row_cast_map;
3939
int arraysize;
4040
PyObject* lastrowid;
41-
sqlite3_int64 rowcount;
41+
long rowcount;
4242
PyObject* row_factory;
4343
pysqlite_Statement* statement;
4444
int closed;

0 commit comments

Comments
 (0)