Remove unreachable branches.
FossilOrigin-Name: fd4da2318cc032d7c355376e440d4a05d7ab8793
This commit is contained in:
+6
-3
@@ -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;
|
||||
|
||||
+4
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user