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

Changes to auth.c to promote full coverage testing. (CVS 6600)

FossilOrigin-Name: c7615b44583c4b3afa45b57c6047478c18c234e9
This commit is contained in:
drh
2009-05-04 18:01:39 +00:00
parent de630353d8
commit eba661f88f
3 changed files with 27 additions and 24 deletions

View File

@@ -14,7 +14,7 @@
** systems that do not need this facility may omit it by recompiling
** the library with -DSQLITE_OMIT_AUTHORIZATION=1
**
** $Id: auth.c,v 1.30 2009/05/04 01:58:31 drh Exp $
** $Id: auth.c,v 1.31 2009/05/04 18:01:40 drh Exp $
*/
#include "sqliteInt.h"
@@ -123,19 +123,23 @@ void sqlite3AuthRead(
** temporary table. */
return;
}
for(iSrc=0; pTabList && iSrc<pTabList->nSrc; iSrc++){
if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break;
}
if( pTabList && iSrc<pTabList->nSrc ){
if( pTabList ){
for(iSrc=0; ALWAYS(iSrc<pTabList->nSrc); iSrc++){
if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break;
}
assert( iSrc<pTabList->nSrc );
pTab = pTabList->a[iSrc].pTab;
}else if( (pStack = pParse->trigStack)!=0 ){
/* This must be an attempt to read the NEW or OLD pseudo-tables
** of a trigger.
*/
assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx );
pTab = pStack->pTab;
}else{
pStack = pParse->trigStack;
if( ALWAYS(pStack) ){
/* This must be an attempt to read the NEW or OLD pseudo-tables
** of a trigger.
*/
assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx );
pTab = pStack->pTab;
}
}
if( pTab==0 ) return;
if( NEVER(pTab==0) ) return;
if( pExpr->iColumn>=0 ){
assert( pExpr->iColumn<pTab->nCol );
zCol = pTab->aCol[pExpr->iColumn].zName;
@@ -211,11 +215,10 @@ void sqlite3AuthContextPush(
AuthContext *pContext,
const char *zContext
){
assert( pParse );
pContext->pParse = pParse;
if( pParse ){
pContext->zAuthContext = pParse->zAuthContext;
pParse->zAuthContext = zContext;
}
pContext->zAuthContext = pParse->zAuthContext;
pParse->zAuthContext = zContext;
}
/*