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

Fix problems for 64-bit machines and when SQLITE_OMIT_AUTHORIZATION is defined. (CVS 1868)

FossilOrigin-Name: e3cad1ab6226089265b4d15c6fc67cc33a31425f
This commit is contained in:
drh
2004-07-26 12:24:22 +00:00
parent be5c89acd0
commit 1211de3709
9 changed files with 49 additions and 122 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
** $Id: tclsqlite.c,v 1.97 2004/07/23 00:01:39 drh Exp $
** $Id: tclsqlite.c,v 1.98 2004/07/26 12:24:23 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -437,6 +437,10 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** callback string is returned.
*/
case DB_AUTHORIZER: {
#ifdef SQLITE_OMIT_AUTHORIZATION
Tcl_AppendResult(interp, "authorization not available in this build", 0);
return TCL_ERROR;
#else
if( objc>3 ){
Tcl_WrongNumArgs(interp, 2, objv, "?CALLBACK?");
return TCL_ERROR;
@@ -457,15 +461,14 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}else{
pDb->zAuth = 0;
}
#ifndef SQLITE_OMIT_AUTHORIZATION
if( pDb->zAuth ){
pDb->interp = interp;
sqlite3_set_authorizer(pDb->db, auth_callback, pDb);
}else{
sqlite3_set_authorizer(pDb->db, 0, 0);
}
#endif
}
#endif
break;
}