10000 Group and order member initialisation · python/cpython@4f03b79 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f03b79

Browse files
author
Erlend E. Aasland
committed
Group and order member initialisation
1 parent df284eb commit 4f03b79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_sqlite/statement.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
7878
return NULL;
7979
}
8080

81+
self->db = connection->db;
8182
self->st = NULL;
83+
self->sql = Py_NewRef(sql);
8284
self->in_use = 0;
85+
self->is_dml = 0;
8386
self->in_weakreflist = NULL;
84-
self->sql = Py_NewRef(sql);
8587

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

105106
Py_BEGIN_ALLOW_THREADS
106-
rc = sqlite3_prepare_v2(connection->db,
107+
rc = sqlite3_prepare_v2(self->db,
107108
sql_cstr,
108109
-1,
109110
&self->st,
110111
&tail);
111112
Py_END_ALLOW_THREADS
112113

113-
self->db = connection->db;
114114
PyObject_GC_Track(self);
115115

116116
if (rc != SQLITE_OK) {

0 commit comments

Comments
 (0)
0