Add the experimental sqlite3_expired() API. (CVS 2263)

FossilOrigin-Name: df648d50c0696cf7ada2fe5973d285b494891964
This commit is contained in:
drh
2005-01-22 03:03:54 +00:00
parent 52370e2c95
commit d89bd007ba
11 changed files with 104 additions and 25 deletions
+24 -1
View File
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
** $Id: test1.c,v 1.126 2005/01/21 11:55:27 danielk1977 Exp $
** $Id: test1.c,v 1.127 2005/01/22 03:03:55 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -949,6 +949,28 @@ static int test_reset(
return TCL_OK;
}
/*
** Usage: sqlite3_expired STMT
**
** Return TRUE if a recompilation of the statement is recommended.
*/
static int test_expired(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
sqlite3_stmt *pStmt;
if( objc!=2 ){
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetStringFromObj(objv[0], 0), " <STMT>", 0);
return TCL_ERROR;
}
if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(sqlite3_expired(pStmt)));
return TCL_OK;
}
/*
** Usage: sqlite3_changes DB
**
@@ -2848,6 +2870,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "sqlite3_prepare16", test_prepare16 ,0 },
{ "sqlite3_finalize", test_finalize ,0 },
{ "sqlite3_reset", test_reset ,0 },
{ "sqlite3_expired", test_expired ,0 },
{ "sqlite3_changes", test_changes ,0 },
{ "sqlite3_step", test_step ,0 },