summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/util.c
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2008-02-29 22:08:41 (GMT)
committerGerhard Häring <gh@ghaering.de>2008-02-29 22:08:41 (GMT)
commit1cc60ed214d83b1901a9e68782559c18f705ff07 (patch)
tree31d9638597c104accd2d2149095b16b9e8c22325 /Modules/_sqlite/util.c
parent0e795e7d9225837bc6949a951ba514feab18f9ef (diff)
downloadcpython-1cc60ed214d83b1901a9e68782559c18f705ff07.zip
cpython-1cc60ed214d83b1901a9e68782559c18f705ff07.tar.gz
cpython-1cc60ed214d83b1901a9e68782559c18f705ff07.tar.bz2
Updated to pysqlite 2.4.1. Documentation additions will come later.
Diffstat (limited to 'Modules/_sqlite/util.c')
-rw-r--r--Modules/_sqlite/util.c9
1 files changed, 7 insertions, 2 deletions
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 @@ int _sqlite_step_with_busyhandler(sqlite3_stmt* statement, pysqlite_Connection*
* 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)