summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/cursor.c
diff options
context:
space:
mode:
authorAviv Palivoda <palaviv@gmail.com>2017-03-03 10:58:17 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2017-03-03 10:58:17 (GMT)
commit86a670543ff97d52fd9b8ca0477f8b6d27ee946d (patch)
treef17bb07cfd34d1404be9d0b9eb27e6800080868a /Modules/_sqlite/cursor.c
parent15aa4c88f6052af6279e6be3fcd2f968f1c53eae (diff)
downloadcpython-86a670543ff97d52fd9b8ca0477f8b6d27ee946d.zip
cpython-86a670543ff97d52fd9b8ca0477f8b6d27ee946d.tar.gz
cpython-86a670543ff97d52fd9b8ca0477f8b6d27ee946d.tar.bz2
bpo-9303: Migrate sqlite3 module to _v2 API to enhance performance (#359)
Diffstat (limited to 'Modules/_sqlite/cursor.c')
-rw-r--r--Modules/_sqlite/cursor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 8341fb8..ba6e52d 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -548,8 +548,10 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
/* If it worked, let's get out of the loop */
break;
}
+#if SQLITE_VERSION_NUMBER < 3003009
/* Something went wrong. Re-set the statement and try again. */
rc = pysqlite_statement_reset(self->statement);
+#endif
if (rc == SQLITE_SCHEMA) {
/* If this was a result of the schema changing, let's try
again. */
@@ -706,7 +708,7 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
while (1) {
Py_BEGIN_ALLOW_THREADS
- rc = sqlite3_prepare(self->connection->db,
+ rc = SQLITE3_PREPARE(self->connection->db,
script_cstr,
-1,
&statement,