diff options
author | drh <drh@noemail.net> | 2009-05-03 01:00:59 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-05-03 01:00:59 +0000 |
commit | 1b7ecbb4ce01f94b4887b7072aae62fdf2cf1c7c (patch) | |
tree | ad8ce6d216a24b1db91e004c0fa18b6691b8c187 | |
parent | 098d1684d7c53186f7c7771f9e53eedca9dd4540 (diff) | |
download | sqlite-1b7ecbb4ce01f94b4887b7072aae62fdf2cf1c7c.tar.gz sqlite-1b7ecbb4ce01f94b4887b7072aae62fdf2cf1c7c.zip |
More changes to insert.c to facilitate full coverage testing. (CVS 6596)
FossilOrigin-Name: 46c4ec968bc22843c65744ab4a01ec7ac605567b
-rw-r--r-- | manifest | 12 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/insert.c | 22 |
3 files changed, 18 insertions, 18 deletions
@@ -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 diff --git a/manifest.uuid b/manifest.uuid index eae67090d..e173ec388 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8f3cac7682a0c992f95f7453aaf9a29b1fe35d6f
\ No newline at end of file +46c4ec968bc22843c65744ab4a01ec7ac605567b
\ No newline at end of file diff --git a/src/insert.c b/src/insert.c index 8cd9acb09..84ca95d6a 100644 --- a/src/insert.c +++ b/src/insert.c @@ -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 ); |