1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Enhance the sqlite3_set_authorizer() callback so that it provides callbacks

on each SQL function that is invoked. (CVS 3365)

FossilOrigin-Name: 4547c81f7da29b1490c6eba8d9c333218c5cb88f
This commit is contained in:
drh
2006-08-24 14:59:45 +00:00
parent 882e8e4df2
commit 5169bbc6a3
7 changed files with 109 additions and 16 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
** $Id: tclsqlite.c,v 1.168 2006/08/24 02:42:28 drh Exp $
** $Id: tclsqlite.c,v 1.169 2006/08/24 14:59:46 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -553,6 +553,7 @@ static int auth_callback(
case SQLITE_ANALYZE : zCode="SQLITE_ANALYZE"; break;
case SQLITE_CREATE_VTABLE : zCode="SQLITE_CREATE_VTABLE"; break;
case SQLITE_DROP_VTABLE : zCode="SQLITE_DROP_VTABLE"; break;
case SQLITE_FUNCTION : zCode="SQLITE_FUNCTION"; break;
default : zCode="????"; break;
}
Tcl_DStringInit(&str);
@@ -2068,9 +2069,12 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
return TCL_ERROR;
}
p->maxStmt = NUM_PREPARED_STMTS;
p->interp = interp;
zArg = Tcl_GetStringFromObj(objv[1], 0);
Tcl_CreateObjCommand(interp, zArg, DbObjCmd, (char*)p, DbDeleteCmd);
/* If a TCL procedure named "::sqlite3_init
/* If compiled with SQLITE_TEST turned on, then register the "md5sum"
** SQL function.
*/
@@ -2087,7 +2091,6 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
#endif
}
#endif
p->interp = interp;
return TCL_OK;
}