diff options
author | drh <drh@noemail.net> | 2015-09-01 00:42:52 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-09-01 00:42:52 +0000 |
commit | 7d3d9daea2f94d1265ec97f1d1dfbc6cc36edefd (patch) | |
tree | 32c227cf90a4848409a29badca09a8fdb532d7d3 /src | |
parent | 8b576422592d9845240cc3b9e923d1ba2dbff4f1 (diff) | |
download | sqlite-7d3d9daea2f94d1265ec97f1d1dfbc6cc36edefd.tar.gz sqlite-7d3d9daea2f94d1265ec97f1d1dfbc6cc36edefd.zip |
Remove unreachable branches.
FossilOrigin-Name: fd4da2318cc032d7c355376e440d4a05d7ab8793
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 9 | ||||
-rw-r--r-- | src/where.c | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/build.c b/src/build.c index 0d5aa34fd..e05b17b68 100644 --- a/src/build.c +++ b/src/build.c @@ -1310,7 +1310,8 @@ void sqlite3AddPrimaryKey( nTerm = pList->nExpr; for(i=0; i<nTerm; i++){ Expr *pCExpr = sqlite3ExprSkipCollate(pList->a[i].pExpr); - if( pCExpr && pCExpr->op==TK_ID ){ + assert( pCExpr!=0 ); + if( pCExpr->op==TK_ID ){ const char *zCName = pCExpr->u.zToken; for(iCol=0; iCol<pTab->nCol; iCol++){ if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){ @@ -3061,7 +3062,8 @@ Index *sqlite3CreateIndex( */ for(i=0; i<pList->nExpr; i++){ Expr *pExpr = pList->a[i].pExpr; - if( pExpr && pExpr->op==TK_COLLATE ){ + assert( pExpr!=0 ); + if( pExpr->op==TK_COLLATE ){ nExtra += (1 + sqlite3Strlen30(pExpr->u.zToken)); } } @@ -3258,6 +3260,7 @@ Index *sqlite3CreateIndex( /* Link the new Index structure to its table and to the other ** in-memory database structures. */ + assert( pParse->nErr==0 ); if( db->init.busy ){ Index *p; assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) ); @@ -3287,7 +3290,7 @@ Index *sqlite3CreateIndex( ** has just been created, it contains no data and the index initialization ** step can be skipped. */ - else if( pParse->nErr==0 && (HasRowid(pTab) || pTblName!=0) ){ + else if( HasRowid(pTab) || pTblName!=0 ){ Vdbe *v; char *zStmt; int iMem = ++pParse->nMem; diff --git a/src/where.c b/src/where.c index 6dc326be0..68abfdfe1 100644 --- a/src/where.c +++ b/src/where.c @@ -180,7 +180,7 @@ static WhereTerm *whereScanNext(WhereScan *pScan){ while( pScan->iEquiv<=pScan->nEquiv ){ iCur = pScan->aiCur[pScan->iEquiv-1]; iColumn = pScan->aiColumn[pScan->iEquiv-1]; - if( iColumn==(-2) && pScan->pIdxExpr==0 ) return 0; + assert( iColumn!=(-2) || pScan->pIdxExpr!=0 ); while( (pWC = pScan->pWC)!=0 ){ for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){ if( pTerm->leftCursor==iCur @@ -396,6 +396,7 @@ static int indexColumnNotNull(Index *pIdx, int iCol){ }else{ assert( j==(-2) ); return 0; /* Assume an indexed expression can always yield a NULL */ + } } @@ -803,7 +804,7 @@ static sqlite3_index_info *allocateIndexInfo( testcase( pTerm->eOperator & WO_ALL ); if( (pTerm->eOperator & ~(WO_ISNULL|WO_EQUIV|WO_IS))==0 ) continue; if( pTerm->wtFlags & TERM_VNULL ) continue; - if( pTerm->u.leftColumn<(-1) ) continue; + assert( pTerm->u.leftColumn>=(-1) ); nTerm++; } @@ -859,7 +860,7 @@ static sqlite3_index_info *allocateIndexInfo( testcase( pTerm->eOperator & WO_ALL ); if( (pTerm->eOperator & ~(WO_ISNULL|WO_EQUIV|WO_IS))==0 ) continue; if( pTerm->wtFlags & TERM_VNULL ) continue; - if( pTerm->u.leftColumn<(-1) ) continue; + assert( pTerm->u.leftColumn>=(-1) ); pIdxCons[j].iColumn = pTerm->u.leftColumn; pIdxCons[j].iTermOffset = i; op = (u8)pTerm->eOperator & WO_ALL; |