Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Group and order member initialisation
  • Loading branch information
Erlend E. Aasland committed Jun 1, 2021
commit 4f03b79a16f4dfdd3923c090f00a132cd71421dc
8 changes: 4 additions & 4 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
return NULL;
}

self->db = connection->db;
self->st = NULL;
self->sql = Py_NewRef(sql);
self->in_use = 0;
self->is_dml = 0;
self->in_weakreflist = NULL;
self->sql = Py_NewRef(sql);

/* Determine if the statement is a DML statement.
SELECT is the only exception. See #9924. */
self->is_dml = 0;
for (p = sql_cstr; *p != 0; p++) {
switch (*p) {
case ' ':
Expand All @@ -103,14 +104,13 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
}

Py_BEGIN_ALLOW_THREADS
rc = sqlite3_prepare_v2(connection->db,
rc = sqlite3_prepare_v2(self->db,
sql_cstr,
-1,
&self->st,
&tail);
Py_END_ALLOW_THREADS

self->db = connection->db;
PyObject_GC_Track(self);

if (rc != SQLITE_OK) {
Expand Down