]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Changes to auth.c to promote full coverage testing. (CVS 6600)
authordrh <drh@noemail.net>
Mon, 4 May 2009 18:01:39 +0000 (18:01 +0000)
committerdrh <drh@noemail.net>
Mon, 4 May 2009 18:01:39 +0000 (18:01 +0000)
FossilOrigin-Name: c7615b44583c4b3afa45b57c6047478c18c234e9

manifest
manifest.uuid
src/auth.c

index 342e3e7cef1623d80256d908bf0df12156399c34..9ffc8e78ff2049a6d87fdfc01f25cd28a31d3d46 100644 (file)
--- a/manifest
+++ b/manifest
@@ -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)
-D 2009-05-04T11:42:30
+C Changes\sto\sauth.c\sto\spromote\sfull\scoverage\stesting.\s(CVS\s6600)
+D 2009-05-04T18:01:40
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -102,7 +102,7 @@ F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
 F src/alter.c 8ab5824bde0a03dae5829f61557ab7c72757000a
 F src/analyze.c e239496cfb5394ac8867f1c112905ddab8d01cd9
 F src/attach.c 3b99611f04926fc69c35b1145603fc3ddb0ca967
-F src/auth.c 3aa04c55fba2b4d5905d3a1f8f24b0c2249d1921
+F src/auth.c 98db07c2088455797678eb1031f42d4d94d18a71
 F src/backup.c 0082d0e5a63f04e88faee0dff0a7d63d3e92a78d
 F src/bitvec.c ef370407e03440b0852d05024fb016b14a471d3d
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
@@ -727,7 +727,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 694662f7860179403e0cc55b45ae8afa45aa7dfb
-R 6576fd5d802472afe202456dad4f145e
-U danielk1977
-Z b2077480b3cdd4d5393106dee9847930
+P cac4f3d812f0a02ca5c1fa78d366f694403929a8
+R e9ee069731064c4aed8a67abd21e3dc7
+U drh
+Z f9a6939b6e933820d20808f0d4fed962
index 59d3e5810e7e6ef8d43851873d3974147d0b099e..0fafffae840035bf76f0d1558429b7ce4e346f85 100644 (file)
@@ -1 +1 @@
-cac4f3d812f0a02ca5c1fa78d366f694403929a8
\ No newline at end of file
+c7615b44583c4b3afa45b57c6047478c18c234e9
\ No newline at end of file
index c76520a9227d6e26851fd71c8e79279fbc7bb04a..787acfe620f71219558fcf9685c1d0ee4450b82f 100644 (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;
 }
 
 /*