-C Remove\sincorrect\sNEVER()\smacro\sin\sthe\sprevious\scheck-in\s(6634).\s(CVS\s6635)
-D 2009-05-13T17:35:23
+C Additional\ssimplifications\sto\sbuild.c\sin\ssupport\sfull\scoverage\stesting.\s(CVS\s6636)
+D 2009-05-13T22:58:29
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 6cf99a4e3235b5da7655281651a9f1076d6ae0e4
+F src/build.c 2b4cef0dccea8d5ceb34d30b69121590ad2d5314
F src/callback.c bf295cfdc065b56cc49a5f6452126dc4ffe0ff5b
F src/complete.c 5ad5c6cd4548211867c204c41a126d73a9fbcea0
F src/date.c ab5f7137656652a48434d64f96bdcdc823bb23b3
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 264ace50bbaec3468de0e42b2b8cebf9ce1d6682
-R 843d02846a4c9c1e2f03264992adfe69
+P c684957991fe45cbcb188d2a419501c3f1fdc93f
+R b7d938cf0534e6a7525437136b322f35
U drh
-Z 89e04f4f589e3ad4c80a45972c432ebb
+Z a945f0494911586b285a588e892ed85a
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.543 2009/05/13 17:35:23 drh Exp $
+** $Id: build.c,v 1.544 2009/05/13 22:58:29 drh Exp $
*/
#include "sqliteInt.h"
int nBytes;
TableLock *p;
- if( NEVER(iDb<0) ) return;
+ assert( iDb>=0 );
for(i=0; i<pParse->nTableLock; i++){
p = &pParse->aTableLock[i];
if( p->iDb==iDb && p->iTab==iTab ){
*/
static void freeIndex(Index *p){
sqlite3 *db = p->pTable->dbMem;
- testcase( db==0 );
+ /* testcase( db==0 ); */
sqlite3DbFree(db, p->zColAff);
sqlite3DbFree(db, p);
}
sqlite3 *db = pParse->db;
int iDb;
- if( (pEnd==0 && pSelect==0) || NEVER(pParse->nErr) || db->mallocFailed ) {
+ if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
return;
}
p = pParse->pNewTable;
/* Add the table to the in-memory representation of the database.
*/
- if( db->init.busy && ALWAYS(pParse->nErr==0) ){
+ if( db->init.busy ){
Table *pOld;
Schema *pSchema = p->pSchema;
pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName,
}
sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr);
p = pParse->pNewTable;
- if( p==0 || NEVER(pParse->nErr>0) ){
+ if( p==0 ){
sqlite3SelectDelete(db, pSelect);
return;
}
+ assert( pParse->nErr==0 ); /* If sqlite3StartTable return non-NULL then
+ ** there could not have been an error */
sqlite3TwoPartName(pParse, pName1, pName2, &pName);
iDb = sqlite3SchemaToIndex(db, p->pSchema);
if( sqlite3FixInit(&sFix, pParse, iDb, "view", pName)
sqlite3 *db = pParse->db;
int iDb;
- if( NEVER(pParse->nErr) || db->mallocFailed ){
+ if( db->mallocFailed ){
goto exit_drop_table;
}
+ assert( pParse->nErr==0 );
assert( pName->nSrc==1 );
pTab = sqlite3LocateTable(pParse, isView,
pName->a[0].zName, pName->a[0].zDatabase);
char *z;
assert( pTo!=0 );
- if( p==0 || NEVER(pParse->nErr) || IN_DECLARE_VTAB ) goto fk_end;
+ if( p==0 || IN_DECLARE_VTAB ) goto fk_end;
if( pFromCol==0 ){
int iCol = p->nCol-1;
if( NEVER(iCol<0) ) goto fk_end;
char *zExtra;
assert( pStart==0 || pEnd!=0 ); /* pEnd must be non-NULL if pStart is */
- if( NEVER(pParse->nErr>0) || db->mallocFailed || IN_DECLARE_VTAB ){
+ assert( pParse->nErr==0 ); /* Never called with prior errors */
+ if( db->mallocFailed || IN_DECLARE_VTAB ){
goto exit_create_index;
}
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
sqlite3 *db = pParse->db;
int iDb;
- if( NEVER(pParse->nErr>0) || db->mallocFailed ){
+ assert( pParse->nErr==0 ); /* Never called with prior errors */
+ if( db->mallocFailed ){
goto exit_drop_index;
}
assert( pName->nSrc==1 );
/* Sanity checking on calling parameters */
assert( iStart>=0 );
assert( nExtra>=1 );
- if( pSrc==0 || iStart>pSrc->nSrc ){
- assert( db->mallocFailed );
- return pSrc;
- }
+ assert( pSrc!=0 );
+ assert( iStart<=pSrc->nSrc );
/* Allocate additional space if needed */
if( pSrc->nSrc+nExtra>pSrc->nAlloc ){
struct SrcList_item *pItem;
sqlite3 *db = pParse->db;
p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
- if( p==0 || p->nSrc==0 ){
+ if( p==0 || NEVER(p->nSrc==0) ){
sqlite3ExprDelete(db, pOn);
sqlite3IdListDelete(db, pUsing);
sqlite3SelectDelete(db, pSubquery);
return p;
}
pItem = &p->a[p->nSrc-1];
- if( pAlias && pAlias->n ){
+ assert( pAlias!=0 );
+ if( pAlias->n ){
pItem->zAlias = sqlite3NameFromToken(db, pAlias);
}
pItem->pSelect = pSubquery;
** element of the source-list passed as the second argument.
*/
void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){
- if( pIndexedBy && p && p->nSrc>0 ){
+ assert( pIndexedBy!=0 );
+ if( p && ALWAYS(p->nSrc>0) ){
struct SrcList_item *pItem = &p->a[p->nSrc-1];
assert( pItem->notIndexed==0 && pItem->zIndex==0 );
if( pIndexedBy->n==1 && !pIndexedBy->z ){
** necessary to undo a write and the checkpoint should not be set.
*/
void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
- Vdbe *v = sqlite3GetVdbe(pParse);
- if( v==0 ) return;
sqlite3CodeVerifySchema(pParse, iDb);
pParse->writeMask |= 1<<iDb;
if( setStatement && pParse->nested==0 ){
- sqlite3VdbeAddOp1(v, OP_Statement, iDb);
+ /* Every place where this routine is called with setStatement!=0 has
+ ** already successfully created a VDBE. */
+ assert( pParse->pVdbe );
+ sqlite3VdbeAddOp1(pParse->pVdbe, OP_Statement, iDb);
}
}
return;
}
- if( pName1==0 || NEVER(pName1->z==0) ){
+ if( pName1==0 ){
reindexDatabases(pParse, 0);
return;
}else if( NEVER(pName2==0) || pName2->z==0 ){