diff options
author | drh <drh@noemail.net> | 2009-05-04 18:01:39 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-05-04 18:01:39 +0000 |
commit | eba661f88f6cd9c2a4faf12c63acea48fa6387bd (patch) | |
tree | 05c6617f7a128c05ccab13bff6ba3ef83069605d /src/auth.c | |
parent | de630353d823a3df460ae4adc2e03643873f0dd2 (diff) | |
download | sqlite-eba661f88f6cd9c2a4faf12c63acea48fa6387bd.tar.gz sqlite-eba661f88f6cd9c2a4faf12c63acea48fa6387bd.zip |
Changes to auth.c to promote full coverage testing. (CVS 6600)
FossilOrigin-Name: c7615b44583c4b3afa45b57c6047478c18c234e9
Diffstat (limited to 'src/auth.c')
-rw-r--r-- | src/auth.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/auth.c b/src/auth.c index c76520a92..787acfe62 100644 --- a/src/auth.c +++ b/src/auth.c @@ -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; } /* |