aboutsummaryrefslogtreecommitdiff
path: root/src/test_stat.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-05-04 17:06:39 +0000
committerdrh <drh@noemail.net>2015-05-04 17:06:39 +0000
commit84ab95395ed6fbed8f8bd331a2a517b65524cae6 (patch)
treecd94e83e9cf81b9494f0a3eb061b0d704d4dc038 /src/test_stat.c
parent9af8646dceb11457e9cb045c2db6e6b725be2242 (diff)
downloadsqlite-84ab95395ed6fbed8f8bd331a2a517b65524cae6.tar.gz
sqlite-84ab95395ed6fbed8f8bd331a2a517b65524cae6.zip
Include the "dbstat" virtual table in the amalgamation.
FossilOrigin-Name: fc6504aa8ca19b3737f72c1e20db8df6b7608dd2
Diffstat (limited to 'src/test_stat.c')
-rw-r--r--src/test_stat.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/test_stat.c b/src/test_stat.c
index 17091c0d2..35304b3fd 100644
--- a/src/test_stat.c
+++ b/src/test_stat.c
@@ -18,8 +18,18 @@
** for an example implementation.
*/
+/* Only compile this module if there is evidence that the programmer
+** deliberately wants to include it. Evidence can be:
+** (1) Tt is compiled and linked separately from the amalgamation.
+** (2) The SQLITE_ENABLE_DBSTAT_VTAB compile-time option is used
+** (3) The SQLITE_TEST compile-time option is used
+*/
+#if !defined(SQLITE_AMALGAMATION) \
+ || defined(SQLITE_ENABLE_DBSTAT_VTAB) \
+ || defined(SQLITE_TEST)
+
#ifndef SQLITE_AMALGAMATION
-# include "sqliteInt.h"
+# include "sqliteInt.h" /* Requires access to internal data structures */
#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -625,9 +635,17 @@ int sqlite3_dbstat_register(sqlite3 *db){
#endif
+/*
+** This is the TCL interface
+*/
#if defined(SQLITE_TEST) || TCLSH==2
-#include <tcl.h>
+#include <tcl.h> /* amalgamator: keep */
+/*
+** tclcmd: register_dbstat_vtab DB
+**
+** Cause the dbstat virtual table to be available on the connection DB
+*/
static int test_dbstat(
void *clientData,
Tcl_Interp *interp,
@@ -656,9 +674,10 @@ static int test_dbstat(
return TCL_OK;
#endif
}
-
int SqlitetestStat_Init(Tcl_Interp *interp){
Tcl_CreateObjCommand(interp, "register_dbstat_vtab", test_dbstat, 0, 0);
return TCL_OK;
}
#endif /* if defined(SQLITE_TEST) || TCLSH==2 */
+
+#endif /* !SQLITE_AMALGAMATION || SQLITE_ENABLE_DBSTAT_VTAB || SQLITE_TEST */