mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Add a simple test case (and corresponding bugfix) for the virtual table xConnect and xDisconnect methods. (CVS 3214)
FossilOrigin-Name: b63dbc794795533f0bfd2d8e25633e6e3dea3ebd
This commit is contained in:
11
src/test8.c
11
src/test8.c
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test8.c,v 1.3 2006/06/12 11:24:37 danielk1977 Exp $
|
||||
** $Id: test8.c,v 1.4 2006/06/12 12:08:45 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -30,6 +30,11 @@ static void appendToEchoModule(const sqlite3_module *pModule, const char *zArg){
|
||||
Tcl_SetVar((Tcl_Interp *)(pModule->pAux), "echo_module", zArg, flags);
|
||||
}
|
||||
|
||||
static void appendToEchoTable(const sqlite3_vtab *pTab, const char *zArg){
|
||||
int flags = (TCL_APPEND_VALUE | TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
|
||||
Tcl_SetVar((Tcl_Interp *)(pTab), "echo_module", zArg, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is called from within the echo-modules xCreate and
|
||||
** xConnect methods. The argc and argv arguments are copies of those
|
||||
@@ -106,9 +111,7 @@ static int echoConnect(
|
||||
return 0;
|
||||
}
|
||||
static int echoDisconnect(sqlite3_vtab *pVtab){
|
||||
Tcl_Interp *interp = (Tcl_Interp*)pVtab;
|
||||
Tcl_SetVar(interp, "echo_module", "xDisconnect",
|
||||
TCL_APPEND_VALUE | TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
|
||||
appendToEchoTable(pVtab, "xDisconnect");
|
||||
return 0;
|
||||
}
|
||||
static int echoDestroy(sqlite3_vtab *pVtab){
|
||||
|
Reference in New Issue
Block a user