-C Do\snot\srun\sasync4.test\sas\spart\sof\sthe\s"journaltest"\spermutation.\sIt\sspecifically\stests\sthat\sthe\sasynchronous\sIO\sbackend\scan\sbe\sconfigured\sto\sviolate\sthe\sassumptions\smade\sby\sjournaltest.\s(CVS\s6633)
-D 2009-05-13T14:46:10
+C Changes\sto\sbuild.c\sto\shelp\sfacilitate\sfull\scoverage\stesting.\s(CVS\s6634)
+D 2009-05-13T17:21:14
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/btree.c 7c4b02afea7efb561361f20408414fec68df898c
F src/btree.h 58d876d3ed944a8f4f1fd0e67024b385243fc9dd
F src/btreeInt.h df64030d632f8c8ac217ed52e8b6b3eacacb33a5
-F src/build.c e8e2f7d6cf0905a3a5681afb5cad16c3237351e5
+F src/build.c d9890c52f02a009aa7bd280218b3505e291a7670
F src/callback.c bf295cfdc065b56cc49a5f6452126dc4ffe0ff5b
F src/complete.c 5ad5c6cd4548211867c204c41a126d73a9fbcea0
F src/date.c ab5f7137656652a48434d64f96bdcdc823bb23b3
F src/shell.c 0a11f831603f17fea20ca97133c0f64e716af4a7
F src/sqlite.h.in d028ed6e0e991d730644f0b418964df1b51e6c53
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
-F src/sqliteInt.h 0a39cbf63cc7fe54aa9a4bb053e21b5b5b7cde14
+F src/sqliteInt.h d20ac97b4daf97621d641f52ac16e8ff26fb53fd
F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 90309008c35494c7a075fe76f7eb96b09a01d01b
-R ed250caec188d75dd66a52271396a75b
-U danielk1977
-Z 56e0c99958614308b534424b4ade9f10
+P b19bf39bbae96aeb6e742fb9fb1c33d0e251ad7f
+R 74cc80f4c5c238b3488a2be9f1be7ad9
+U drh
+Z 422ed81794fdbf61d42840503b0a04d7
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.541 2009/05/12 18:00:38 drh Exp $
+** $Id: build.c,v 1.542 2009/05/13 17:21:14 drh Exp $
*/
#include "sqliteInt.h"
int nBytes;
TableLock *p;
- if( iDb<0 ){
- return;
- }
-
+ if( NEVER(iDb<0) ) return;
for(i=0; i<pParse->nTableLock; i++){
p = &pParse->aTableLock[i];
if( p->iDb==iDb && p->iTab==iTab ){
int i;
Vdbe *pVdbe;
- if( 0==(pVdbe = sqlite3GetVdbe(pParse)) ){
- return;
- }
+ pVdbe = sqlite3GetVdbe(pParse);
+ assert( pVdbe!=0 ); /* sqlite3GetVdbe cannot fail: VDBE already allocated */
for(i=0; i<pParse->nTableLock; i++){
TableLock *p = &pParse->aTableLock[i];
/* Get the VDBE program ready for execution
*/
- if( v && pParse->nErr==0 && !db->mallocFailed ){
+ if( v && ALWAYS(pParse->nErr==0) && !db->mallocFailed ){
#ifdef SQLITE_DEBUG
FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0;
sqlite3VdbeTrace(v, trace);
for(i=OMIT_TEMPDB; i<db->nDb; i++){
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
Schema *pSchema = db->aDb[j].pSchema;
+ assert( pSchema );
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue;
- assert( pSchema || (j==1 && !db->aDb[1].pBt) );
- if( pSchema ){
- p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
- }
+ p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
if( p ) break;
}
return p;
len = sqlite3Strlen30(zIdxName);
pIndex = sqlite3HashInsert(pHash, zIdxName, len, 0);
- if( pIndex ){
+ /* Justification of ALWAYS(): This routine is only called from the
+ ** OP_DropIndex opcode. And there is no way that opcode will ever run
+ ** unless the corresponding index is in the symbol table. */
+ if( ALWAYS(pIndex) ){
if( pIndex->pTable->pIndex==pIndex ){
pIndex->pTable->pIndex = pIndex->pNext;
}else{
Index *p;
- for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){}
- if( p && p->pNext==pIndex ){
+ /* Justification of ALWAYS(); The index must be on the list of
+ ** indices. */
+ p = pIndex->pTable->pIndex;
+ while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; }
+ if( ALWAYS(p && p->pNext==pIndex) ){
p->pNext = pIndex->pNext;
}
}
** schema hash tables and therefore do not have to make any changes
** to any of those tables.
*/
- for(i=0; i<db->nDb; i++){
- struct Db *pDb = &db->aDb[i];
- if( pDb->pBt==0 ){
- if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux);
- pDb->pAux = 0;
- }
- }
for(i=j=2; i<db->nDb; i++){
struct Db *pDb = &db->aDb[i];
if( pDb->pBt==0 ){
sqlite3 *db = pParse->db;
int iDb;
- if( (pEnd==0 && pSelect==0) || pParse->nErr || db->mallocFailed ) {
+ if( (pEnd==0 && pSelect==0) || NEVER(pParse->nErr) || db->mallocFailed ) {
return;
}
p = pParse->pNewTable;
sqlite3 *db = pParse->db;
int iDb;
- if( pParse->nErr || db->mallocFailed ){
+ if( NEVER(pParse->nErr) || db->mallocFailed ){
goto exit_drop_table;
}
assert( pName->nSrc==1 );
zColl = db->pDfltColl->zName;
}
}
- if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){
+ if( NEVER(!db->init.busy && !sqlite3LocateCollSeq(pParse, zColl)) ){
goto exit_create_index;
}
pIndex->azColl[i] = zColl;
assert( pParse!=0 );
db = pParse->db;
assert( db!=0 );
- if( db->aDb[0].pBt==0 ) return;
+/* if( db->aDb[0].pBt==0 ) return; */
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ){
return;
}
assert( pParse!=0 );
db = pParse->db;
assert( db!=0 );
- if( db->aDb[0].pBt==0 ) return;
+/* if( db->aDb[0].pBt==0 ) return; */
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ){
return;
}
assert( pParse!=0 );
db = pParse->db;
assert( db!=0 );
- if( db->aDb[0].pBt==0 ) return;
+/* if( db->aDb[0].pBt==0 ) return; */
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ){
return;
}
#ifndef SQLITE_OMIT_REINDEX
static int collationMatch(const char *zColl, Index *pIndex){
int i;
+ assert( zColl!=0 );
for(i=0; i<pIndex->nColumn; i++){
const char *z = pIndex->azColl[i];
- if( z==zColl || (z && zColl && 0==sqlite3StrICmp(z, zColl)) ){
+ assert( z!=0 );
+ if( 0==sqlite3StrICmp(z, zColl) ){
return 1;
}
}