Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
Merge branch 'main' into sqlite-stmt-busy
  • Loading branch information
Erlend E. Aasland committed Jun 4, 2021
commit 0744c8520796172627bfebdb14675ba8b9ab8dcb
19 changes: 0 additions & 19 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,25 +1329,6 @@ pysqlite_connection_call(pysqlite_Connection *self, PyObject *args,
return NULL;
}

statement->db = NULL;
statement->st = NULL;
statement->sql = NULL;
statement->in_weakreflist = NULL;

rc = pysqlite_statement_create(statement, self, sql);
if (rc != SQLITE_OK) {
if (rc == PYSQLITE_TOO_MUCH_SQL) {
PyErr_SetString(pysqlite_Warning, "You can only execute one statement at a time.");
} else if (rc == PYSQLITE_SQL_WRONG_TYPE) {
if (PyErr_ExceptionMatches(PyExc_TypeError))
PyErr_SetString(pysqlite_Warning, "SQL is of wrong type. Must be string.");
} else {
(void)pysqlite_statement_reset(statement);
_pysqlite_seterror(self->db);
}
goto error;
}

weakref = PyWeakref_NewRef((PyObject*)statement, NULL);
if (weakref == NULL)
goto error;
Expand Down
3 changes: 0 additions & 3 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
Py_ssize_t sql_cstr_len;
const char* p;

self->st = NULL;

assert(PyUnicode_Check(sql));

sql_cstr = PyUnicode_AsUTF8AndSize(sql, &sql_cstr_len);
Expand Down Expand Up @@ -89,7 +87,6 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
self->db = connection->db;
self->st = NULL;
self->sql = Py_NewRef(sql);
self->in_use = 0;
self->is_dml = 0;
self->in_weakreflist = NULL;

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.