summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/connection.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-09-20 14:36:18 (GMT)
committerGitHub <noreply@github.com>2017-09-20 14:36:18 (GMT)
commit525269430a3f9fbb7287e4bb6b365ac216004980 (patch)
tree2d773b5d8ee8582da1b90bcbd17bb3ffc9ce25f7 /Modules/_sqlite/connection.c
parent0ad05c32cc41d4c21bfd78b9ffead519ead475a2 (diff)
downloadcpython-525269430a3f9fbb7287e4bb6b365ac216004980.zip
cpython-525269430a3f9fbb7287e4bb6b365ac216004980.tar.gz
cpython-525269430a3f9fbb7287e4bb6b365ac216004980.tar.bz2
closes bpo-31525: require sqlite3_prepare_v2 (#3666)
This is based on https://github.com/ghaering/pysqlite/commit/40b349cadbd87c42f70fc92e5e1aee6d02564c6d#diff-0489411409cd2934730e88bf7767790, though we can be a bit more aggressive about deleting code.
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r--Modules/_sqlite/connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index f596bcf..2759116 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -375,7 +375,7 @@ PyObject* _pysqlite_connection_begin(pysqlite_Connection* self)
sqlite3_stmt* statement;
Py_BEGIN_ALLOW_THREADS
- rc = SQLITE3_PREPARE(self->db, self->begin_statement, -1, &statement, &tail);
+ rc = sqlite3_prepare_v2(self->db, self->begin_statement, -1, &statement, &tail);
Py_END_ALLOW_THREADS
if (rc != SQLITE_OK) {
@@ -417,7 +417,7 @@ PyObject* pysqlite_connection_commit(pysqlite_Connection* self, PyObject* args)
if (!sqlite3_get_autocommit(self->db)) {
Py_BEGIN_ALLOW_THREADS
- rc = SQLITE3_PREPARE(self->db, "COMMIT", -1, &statement, &tail);
+ rc = sqlite3_prepare_v2(self->db, "COMMIT", -1, &statement, &tail);
Py_END_ALLOW_THREADS
if (rc != SQLITE_OK) {
_pysqlite_seterror(self->db, NULL);
@@ -460,7 +460,7 @@ PyObject* pysqlite_connection_rollback(pysqlite_Connection* self, PyObject* args
pysqlite_do_all_statements(self, ACTION_RESET, 1);
Py_BEGIN_ALLOW_THREADS
- rc = SQLITE3_PREPARE(self->db, "ROLLBACK", -1, &statement, &tail);
+ rc = sqlite3_prepare_v2(self->db, "ROLLBACK", -1, &statement, &tail);
Py_END_ALLOW_THREADS
if (rc != SQLITE_OK) {
_pysqlite_seterror(self->db, NULL);