Updated to pysqlite 2.4.1. Documentation additions will come later.
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index 5e78d58..e06c299 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -1,6 +1,6 @@
/* util.c - various utility functions
*
- * Copyright (C) 2005-2006 Gerhard Häring <gh@ghaering.de>
+ * Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
*
* This file is part of pysqlite.
*
@@ -45,10 +45,15 @@
* Checks the SQLite error code and sets the appropriate DB-API exception.
* Returns the error code (0 means no error occurred).
*/
-int _pysqlite_seterror(sqlite3* db)
+int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
{
int errorcode;
+ /* SQLite often doesn't report anything useful, unless you reset the statement first */
+ if (st != NULL) {
+ (void)sqlite3_reset(st);
+ }
+
errorcode = sqlite3_errcode(db);
switch (errorcode)