aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2006-01-04 18:13:26 +0000
committerdrh <drh@noemail.net>2006-01-04 18:13:26 +0000
commit446a9b825bb6ade42050ddf30c0ab233a19e45e2 (patch)
treebb476c16eda773c865d16244b46c17dfa61f8533 /src/tclsqlite.c
parent5af7e19bd0e7c34cb58994f50550fb8d569ed03e (diff)
downloadsqlite-446a9b825bb6ade42050ddf30c0ab233a19e45e2.tar.gz
sqlite-446a9b825bb6ade42050ddf30c0ab233a19e45e2.zip
Bug fix in the new "exists" method of the TCL interface. (CVS 2857)
FossilOrigin-Name: d0e3d466094f7b2f74ed7ebb324e5024ea8faa6f
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 1379ae5fe..610e9063e 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.143 2006/01/03 00:33:50 drh Exp $
+** $Id: tclsqlite.c,v 1.144 2006/01/04 18:13:26 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -1207,9 +1207,11 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
Tcl_WrongNumArgs(interp, 2, objv, "SQL");
return TCL_ERROR;
}
- pRet = 0;
if( choice==DB_EXISTS ){
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
+ pRet = Tcl_NewBooleanObj(0);
+ Tcl_IncrRefCount(pRet);
+ }else{
+ pRet = 0;
}
}
if( objc==3 ){
@@ -1423,8 +1425,9 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
rc = TCL_BREAK;
i = nCol;
}else if( choice==DB_EXISTS ){
- assert( pRet==0 );
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(1));
+ Tcl_DecrRefCount(pRet);
+ pRet = Tcl_NewBooleanObj(1);
+ Tcl_IncrRefCount(pRet);
rc = TCL_BREAK;
i = nCol;
}else{