diff -r e97940f701be Modules/_sqlite/connection.c --- a/Modules/_sqlite/connection.c Mon Apr 02 14:25:55 2012 -0400 +++ b/Modules/_sqlite/connection.c Sat Apr 14 17:38:45 2012 +0200 @@ -358,7 +358,7 @@ 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) { @@ -404,7 +404,7 @@ pysqlite_do_all_statements(self, ACTION_RESET, 0); 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); @@ -450,7 +450,7 @@ 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); diff -r e97940f701be Modules/_sqlite/cursor.c --- a/Modules/_sqlite/cursor.c Mon Apr 02 14:25:55 2012 -0400 +++ b/Modules/_sqlite/cursor.c Sat Apr 14 17:38:45 2012 +0200 @@ -631,31 +631,17 @@ } /* Something went wrong. Re-set the statement and try again. */ rc = pysqlite_statement_reset(self->statement); - if (rc == SQLITE_SCHEMA) { - /* If this was a result of the schema changing, let's try - again. */ - rc = pysqlite_statement_recompile(self->statement, parameters); - if (rc == SQLITE_OK) { - continue; + if (PyErr_Occurred()) { + /* there was an error that occurred in a user-defined callback */ + if (_enable_callback_tracebacks) { + PyErr_Print(); } else { - /* If the database gave us an error, promote it to Python. */ - (void)pysqlite_statement_reset(self->statement); - _pysqlite_seterror(self->connection->db, NULL); - goto error; + PyErr_Clear(); } - } else { - if (PyErr_Occurred()) { - /* there was an error that occurred in a user-defined callback */ - if (_enable_callback_tracebacks) { - PyErr_Print(); - } else { - PyErr_Clear(); - } - } - (void)pysqlite_statement_reset(self->statement); - _pysqlite_seterror(self->connection->db, NULL); - goto error; } + (void)pysqlite_statement_reset(self->statement); + _pysqlite_seterror(self->connection->db, NULL); + goto error; } if (pysqlite_build_row_cast_map(self) != 0) { @@ -804,7 +790,7 @@ while (1) { Py_BEGIN_ALLOW_THREADS - rc = sqlite3_prepare(self->connection->db, + rc = sqlite3_prepare_v2(self->connection->db, script_cstr, -1, &statement, diff -r e97940f701be Modules/_sqlite/statement.c --- a/Modules/_sqlite/statement.c Mon Apr 02 14:25:55 2012 -0400 +++ b/Modules/_sqlite/statement.c Sat Apr 14 17:38:45 2012 +0200 @@ -69,11 +69,11 @@ self->sql = sql; Py_BEGIN_ALLOW_THREADS - rc = sqlite3_prepare(connection->db, - sql_cstr, - -1, - &self->st, - &tail); + rc = sqlite3_prepare_v2(connection->db, + sql_cstr, + -1, + &self->st, + &tail); Py_END_ALLOW_THREADS self->db = connection->db; @@ -295,11 +295,11 @@ } Py_BEGIN_ALLOW_THREADS - rc = sqlite3_prepare(self->db, - sql_cstr, - -1, - &new_st, - &tail); + rc = sqlite3_prepare_v2(self->db, + sql_cstr, + -1, + &new_st, + &tail); Py_END_ALLOW_THREADS if (rc == SQLITE_OK) {