]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
More changes to insert.c to facilitate full coverage testing. (CVS 6596)
authordrh <drh@noemail.net>
Sun, 3 May 2009 01:00:59 +0000 (01:00 +0000)
committerdrh <drh@noemail.net>
Sun, 3 May 2009 01:00:59 +0000 (01:00 +0000)
FossilOrigin-Name: 46c4ec968bc22843c65744ab4a01ec7ac605567b

manifest
manifest.uuid
src/insert.c

index 163744e0bf514ce3953e0af1a5a72d70a0fc072f..51bc30e4786410bca8575269f730fbb814b607f8 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Simplifications\sto\sthe\suniqueness\sconstraint\sfailure\serror\smessage\ngeneration\scode.\s(CVS\s6595)
-D 2009-05-02T15:46:47
+C More\schanges\sto\sinsert.c\sto\sfacilitate\sfull\scoverage\stesting.\s(CVS\s6596)
+D 2009-05-03T01:01:00
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -121,7 +121,7 @@ F src/global.c 448419c44ce0701104c2121b0e06919b44514c0c
 F src/hash.c 7e90268f62662dc8ccb9da1e93090ea64481e4f8
 F src/hash.h 35b216c13343d0b4f87d9f21969ac55ad72174e1
 F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb
-F src/insert.c a655cd5e3aeb36039cef9653f050c53e2d5502dc
+F src/insert.c 35d73660090a3b93ee6aa92a54d9dad912ac0197
 F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0
 F src/legacy.c 2ad5b52df322d0f132f66817095e0e79c8942611
 F src/loadext.c 3f96631089fc4f3871a67f02f2e4fc7ea4d51edc
@@ -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 80c43a355c6e482457abc2f9c3ad3a565cec55fb
-R 8c49dd8877751309177109310f9f6e17
+P 8f3cac7682a0c992f95f7453aaf9a29b1fe35d6f
+R 5c167e348a2d5e3ff2fee4e24ebee7ea
 U drh
-Z 5db7a34baf28b41b86637568773d40b6
+Z 9f1931f4a62117e3d94c8c586b5f71f4
index eae67090d9f2196e15b126287d6a6d50fc0bb6a0..e173ec388a6bd04601574151ebb56c0e4886dc33 100644 (file)
@@ -1 +1 @@
-8f3cac7682a0c992f95f7453aaf9a29b1fe35d6f
\ No newline at end of file
+46c4ec968bc22843c65744ab4a01ec7ac605567b
\ No newline at end of file
index 8cd9acb0964a1331e50aea367271f0fb0c56392f..84ca95d6ae2637e4e74c7fb446057bd76fdb5318 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle INSERT statements in SQLite.
 **
-** $Id: insert.c,v 1.265 2009/05/02 15:46:47 drh Exp $
+** $Id: insert.c,v 1.266 2009/05/03 01:01:00 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -863,7 +863,7 @@ void sqlite3Insert(
         VdbeOp *pOp;
         sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regRowid);
         pOp = sqlite3VdbeGetOp(v, sqlite3VdbeCurrentAddr(v) - 1);
-        if( pOp && pOp->opcode==OP_Null && !IsVirtual(pTab) ){
+        if( ALWAYS(pOp) && pOp->opcode==OP_Null && !IsVirtual(pTab) ){
           appendFlag = 1;
           pOp->opcode = OP_NewRowid;
           pOp->p1 = baseCur;
@@ -1115,16 +1115,16 @@ void sqlite3GenerateConstraintChecks(
   int overrideError,  /* Override onError to this if not OE_Default */
   int ignoreDest      /* Jump to this label on an OE_Ignore resolution */
 ){
-  int i;
-  Vdbe *v;
-  int nCol;
-  int onError;
+  int i;              /* loop counter */
+  Vdbe *v;            /* VDBE under constrution */
+  int nCol;           /* Number of columns */
+  int onError;        /* Conflict resolution strategy */
   int j1;             /* Addresss of jump instruction */
   int j2 = 0, j3;     /* Addresses of jump instructions */
   int regData;        /* Register containing first data column */
-  int iCur;
-  Index *pIdx;
-  int seenReplace = 0;
+  int iCur;           /* Table cursor number */
+  Index *pIdx;         /* Pointer to one of the indices */
+  int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
   int hasTwoRowids = (isUpdate && rowidChng);
 
   v = sqlite3GetVdbe(pParse);
@@ -1427,7 +1427,7 @@ int sqlite3OpenTableAndIndices(
                       (char*)pKey, P4_KEYINFO_HANDOFF);
     VdbeComment((v, "%s", pIdx->zName));
   }
-  if( pParse->nTab<=baseCur+i ){
+  if( pParse->nTab<baseCur+i ){
     pParse->nTab = baseCur+i;
   }
   return i-1;
@@ -1718,7 +1718,7 @@ static int xferOptimization(
   sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1);
   autoIncEnd(pParse, iDbDest, pDest, regAutoinc);
   for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
-    for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
+    for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
       if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
     }
     assert( pSrcIdx );