commit | 525269430a3f9fbb7287e4bb6b365ac216004980 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Wed Sep 20 07:36:18 2017 -0700 |
committer | GitHub <noreply@github.com> | Wed Sep 20 07:36:18 2017 -0700 |
tree | 2d773b5d8ee8582da1b90bcbd17bb3ffc9ce25f7 | |
parent | 0ad05c32cc41d4c21bfd78b9ffead519ead475a2 [diff] [blame] |
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.
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c index b371aed..3fa671d 100644 --- a/Modules/_sqlite/util.c +++ b/Modules/_sqlite/util.c
@@ -47,17 +47,7 @@ */ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st) { - int errorcode; - -#if SQLITE_VERSION_NUMBER < 3003009 - /* SQLite often doesn't report anything useful, unless you reset the statement first. - When using sqlite3_prepare_v2 this is not needed. */ - if (st != NULL) { - (void)sqlite3_reset(st); - } -#endif - - errorcode = sqlite3_errcode(db); + int errorcode = sqlite3_errcode(db); switch (errorcode) {