aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-05-10 13:14:07 +0000
committerdrh <drh@noemail.net>2002-05-10 13:14:07 +0000
commitc22bd47d55ec97e18614af191cacfedaf7572ee9 (patch)
treea6aa0ae4a13d5b91f51fee9c9e7c3d1b55900049 /src/tclsqlite.c
parent247be43d606204ef5ae0fc0173298670b5277742 (diff)
downloadsqlite-c22bd47d55ec97e18614af191cacfedaf7572ee9.tar.gz
sqlite-c22bd47d55ec97e18614af191cacfedaf7572ee9.zip
Improvements to the SQLITE_MISUSE detection logic. Also added test cases
for this logic, including the new test file "misuse.test". (CVS 559) FossilOrigin-Name: f42907ce457e012592f8c043dc6c915e87258b35
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 045c18d78..7df3f7741 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.31 2002/04/12 10:08:59 drh Exp $
+** $Id: tclsqlite.c,v 1.32 2002/05/10 13:14:07 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -552,10 +552,18 @@ static int DbMain(void *cd, Tcl_Interp *interp, int argc, char **argv){
return TCL_ERROR;
}
Tcl_CreateObjCommand(interp, argv[1], DbObjCmd, (char*)p, DbDeleteCmd);
+
+ /* If compiled with SQLITE_TEST turned on, then register the "md5sum"
+ ** SQL function and return an integer which is the memory address of
+ ** the underlying sqlite* pointer.
+ */
#ifdef SQLITE_TEST
{
- extern void Md5_Register(sqlite*);
- Md5_Register(p->db);
+ char zBuf[40];
+ extern void Md5_Register(sqlite*);
+ Md5_Register(p->db);
+ sprintf(zBuf, "%d", (int)p->db);
+ Tcl_AppendResult(interp, zBuf, 0);
}
#endif
return TCL_OK;