1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Fix the "onecolumn" and "exists" methods of the TCL interface so that they

work in combination with the "profile" callback.

FossilOrigin-Name: d362ba157f993fc74a590cf15a9a2fa589278dd7
This commit is contained in:
drh
2016-06-13 12:34:38 +00:00
parent 4d249e6128
commit edc4024b9d
4 changed files with 45 additions and 10 deletions

View File

@ -2325,6 +2325,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
*/
case DB_EXISTS:
case DB_ONECOLUMN: {
Tcl_Obj *pResult = 0;
DbEvalContext sEval;
if( objc!=3 ){
Tcl_WrongNumArgs(interp, 2, objv, "SQL");
@ -2335,14 +2336,15 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
rc = dbEvalStep(&sEval);
if( choice==DB_ONECOLUMN ){
if( rc==TCL_OK ){
Tcl_SetObjResult(interp, dbEvalColumnValue(&sEval, 0));
pResult = dbEvalColumnValue(&sEval, 0);
}else if( rc==TCL_BREAK ){
Tcl_ResetResult(interp);
}
}else if( rc==TCL_BREAK || rc==TCL_OK ){
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(rc==TCL_OK));
pResult = Tcl_NewBooleanObj(rc==TCL_OK);
}
dbEvalFinalize(&sEval);
if( pResult ) Tcl_SetObjResult(interp, pResult);
if( rc==TCL_BREAK ){
rc = TCL_OK;