1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +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

@@ -1,5 +1,5 @@
C Speed\sup\sINSERT\soperations\sthat\sadd\sdata\sto\sUNIQUE\sor\sPRIMARY\sKEY\sindexes\sby\srationalizing\sduplicate\sseek\soperations.\s(CVS\s6599) C Changes\sto\sauth.c\sto\spromote\sfull\scoverage\stesting.\s(CVS\s6600)
D 2009-05-04T11:42:30 D 2009-05-04T18:01:40
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -102,7 +102,7 @@ F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
F src/alter.c 8ab5824bde0a03dae5829f61557ab7c72757000a F src/alter.c 8ab5824bde0a03dae5829f61557ab7c72757000a
F src/analyze.c e239496cfb5394ac8867f1c112905ddab8d01cd9 F src/analyze.c e239496cfb5394ac8867f1c112905ddab8d01cd9
F src/attach.c 3b99611f04926fc69c35b1145603fc3ddb0ca967 F src/attach.c 3b99611f04926fc69c35b1145603fc3ddb0ca967
F src/auth.c 3aa04c55fba2b4d5905d3a1f8f24b0c2249d1921 F src/auth.c 98db07c2088455797678eb1031f42d4d94d18a71
F src/backup.c 0082d0e5a63f04e88faee0dff0a7d63d3e92a78d F src/backup.c 0082d0e5a63f04e88faee0dff0a7d63d3e92a78d
F src/bitvec.c ef370407e03440b0852d05024fb016b14a471d3d F src/bitvec.c ef370407e03440b0852d05024fb016b14a471d3d
F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
@@ -727,7 +727,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 694662f7860179403e0cc55b45ae8afa45aa7dfb P cac4f3d812f0a02ca5c1fa78d366f694403929a8
R 6576fd5d802472afe202456dad4f145e R e9ee069731064c4aed8a67abd21e3dc7
U danielk1977 U drh
Z b2077480b3cdd4d5393106dee9847930 Z f9a6939b6e933820d20808f0d4fed962

View File

@@ -1 +1 @@
cac4f3d812f0a02ca5c1fa78d366f694403929a8 c7615b44583c4b3afa45b57c6047478c18c234e9

View File

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