aboutsummaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/status.c b/src/status.c
index 504f44e50..a5e45dd33 100644
--- a/src/status.c
+++ b/src/status.c
@@ -13,7 +13,7 @@
** This module implements the sqlite3_status() interface and related
** functionality.
**
-** $Id: status.c,v 1.4 2008/07/25 15:39:04 drh Exp $
+** $Id: status.c,v 1.5 2008/07/28 19:34:54 drh Exp $
*/
#include "sqliteInt.h"
@@ -83,3 +83,26 @@ int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
}
return SQLITE_OK;
}
+
+/*
+** Query status information for a single database connection
+*/
+int sqlite3_db_status(
+ sqlite3 *db, /* The database connection whose status is desired */
+ int op, /* Status verb */
+ int *pCurrent, /* Write current value here */
+ int *pHighwater, /* Write high-water mark here */
+ int resetFlag /* Reset high-water mark if true */
+){
+ switch( op ){
+ case SQLITE_DBSTATUS_LOOKASIDE_USED: {
+ *pCurrent = db->lookaside.nOut;
+ *pHighwater = db->lookaside.mxOut;
+ if( resetFlag ){
+ db->lookaside.mxOut = db->lookaside.nOut;
+ }
+ break;
+ }
+ }
+ return SQLITE_OK;
+}