aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-09-03 19:43:23 +0000
committerdrh <drh@noemail.net>2002-09-03 19:43:23 +0000
commitb798fa648116d238f861dca2b11ea9dbf794abf5 (patch)
tree86f93d0995b82d5367f6722b39eb3e618d571a33 /src/tclsqlite.c
parent96f453107784200db76c2f000573c294228dd4ed (diff)
downloadsqlite-b798fa648116d238f861dca2b11ea9dbf794abf5.tar.gz
sqlite-b798fa648116d238f861dca2b11ea9dbf794abf5.zip
Always fill in the 5th parameter to sqlite_exec if there is an error. (CVS 742)
FossilOrigin-Name: 7f8fd5c75d614f81ef87f0fc952c341cbc5076d0
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index ed27499ee..8fe2ab908 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.40 2002/08/31 18:53:08 drh Exp $
+** $Id: tclsqlite.c,v 1.41 2002/09/03 19:43:24 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -442,15 +442,17 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
rc = sqlite_exec(pDb->db, zSql, DbEvalCallback2, pList, &zErrMsg);
Tcl_SetObjResult(interp, pList);
}
- if( zErrMsg ){
+ if( rc==SQLITE_ABORT ){
+ if( zErrMsg ) free(zErrMsg);
+ rc = cbData.tcl_rc;
+ }else if( zErrMsg ){
Tcl_SetResult(interp, zErrMsg, TCL_VOLATILE);
free(zErrMsg);
rc = TCL_ERROR;
- }else if( rc!=SQLITE_OK && rc!=SQLITE_ABORT ){
+ }else if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, sqlite_error_string(rc), 0);
rc = TCL_ERROR;
}else{
- rc = cbData.tcl_rc;
}
Tcl_DecrRefCount(objv[2]);
#ifdef UTF_TRANSLATION_NEEDED