aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-04-07 19:31:59 +0000
committerdrh <drh@noemail.net>2010-04-07 19:31:59 +0000
commit3c379b010199391634ebc996081f1084b36590eb (patch)
tree2415d1ff30f274544a942f5221837ccd26a08c10 /src/tclsqlite.c
parentc6339081995b474bcf54e393e687bb1dde193005 (diff)
downloadsqlite-3c379b010199391634ebc996081f1084b36590eb.tar.gz
sqlite-3c379b010199391634ebc996081f1084b36590eb.zip
Add an interface to the SQLITE_STMTSTATUS_AUTOINDEX status information
to the TCL bindings. Add some simple automatic index test cases. FossilOrigin-Name: 1f40441204d9a912b1d6b67ff6ff9e17146c7abd
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 7048e4efb..5ad198fe9 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -132,7 +132,7 @@ struct SqliteDb {
int maxStmt; /* The next maximum number of stmtList */
int nStmt; /* Number of statements in stmtList */
IncrblobChannel *pIncrblob;/* Linked list of open incrblob channels */
- int nStep, nSort; /* Statistics for most recent operation */
+ int nStep, nSort, nIndex; /* Statistics for most recent operation */
int nTransaction; /* Number of nested [transaction] methods */
};
@@ -1351,6 +1351,7 @@ static int dbEvalStep(DbEvalContext *p){
pDb->nStep = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_FULLSCAN_STEP,1);
pDb->nSort = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_SORT,1);
+ pDb->nIndex = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_AUTOINDEX,1);
dbReleaseColumnNames(p);
p->pPreStmt = 0;
@@ -2528,7 +2529,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}
/*
- ** $db status (step|sort)
+ ** $db status (step|sort|autoindex)
**
** Display SQLITE_STMTSTATUS_FULLSCAN_STEP or
** SQLITE_STMTSTATUS_SORT for the most recent eval.
@@ -2545,8 +2546,11 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
v = pDb->nStep;
}else if( strcmp(zOp, "sort")==0 ){
v = pDb->nSort;
+ }else if( strcmp(zOp, "autoindex")==0 ){
+ v = pDb->nIndex;
}else{
- Tcl_AppendResult(interp, "bad argument: should be step or sort",
+ Tcl_AppendResult(interp,
+ "bad argument: should be autoindex, step, or sort",
(char*)0);
return TCL_ERROR;
}