return PyObject_Vectorcall(cache, args + 1, nargsf, NULL);
}
+static inline int
+stmt_step(sqlite3_stmt *statement)
+{
+ int rc;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_step(statement);
+ Py_END_ALLOW_THREADS
+
+ return rc;
+}
+
PyObject *
_pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation, PyObject* second_argument)
{
goto error;
}
- rc = pysqlite_step(self->statement->st);
+ rc = stmt_step(self->statement->st);
if (rc != SQLITE_DONE && rc != SQLITE_ROW) {
if (PyErr_Occurred()) {
/* there was an error that occurred in a user-defined callback */
if (row == NULL) {
return NULL;
}
- int rc = pysqlite_step(stmt);
+ int rc = stmt_step(stmt);
if (rc == SQLITE_DONE) {
(void)pysqlite_statement_reset(self->statement);
}
#include "module.h"
#include "connection.h"
-int
-pysqlite_step(sqlite3_stmt *statement)
-{
- int rc;
-
- Py_BEGIN_ALLOW_THREADS
- rc = sqlite3_step(statement);
- Py_END_ALLOW_THREADS
-
- return rc;
-}
-
// Returns non-NULL if a new exception should be raised
static PyObject *
get_exception_class(pysqlite_state *state, int errorcode)
#include "sqlite3.h"
#include "connection.h"
-int pysqlite_step(sqlite3_stmt *statement);
-
/**
* Checks the SQLite error code and sets the appropriate DB-API exception.
* Returns the error code (0 means no error occurred).