aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-06-12 18:50:13 +0000
committerdrh <drh@noemail.net>2007-06-12 18:50:13 +0000
commit109b43507d7df7862b762c56f9cd1246f79f03ec (patch)
treec085569c2985e5e284f906e100dfa2f764fd3ef1 /src/tclsqlite.c
parent401b80656d88cc03b743787239c88b99c097d137 (diff)
downloadsqlite-109b43507d7df7862b762c56f9cd1246f79f03ec.tar.gz
sqlite-109b43507d7df7862b762c56f9cd1246f79f03ec.zip
In the "transaction" command of the TCL interface, if a COMMIT fails finish
it with a rollback. (CVS 4059) FossilOrigin-Name: 6da39fa4429400e21924074f5f219f4cb32415ff
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index bca6ed398..0c91302d3 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
-** $Id: tclsqlite.c,v 1.187 2007/05/08 01:08:49 drh Exp $
+** $Id: tclsqlite.c,v 1.188 2007/06/12 18:50:14 drh Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -2193,7 +2193,9 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
} else {
zEnd = "COMMIT";
}
- (void)sqlite3_exec(pDb->db, zEnd, 0, 0, 0);
+ if( sqlite3_exec(pDb->db, zEnd, 0, 0, 0) ){
+ sqlite3_exec(pDb->db, "ROLLBACK", 0, 0, 0);
+ }
}
break;
}