mirror of
https://github.com/sqlite/sqlite.git
synced 2026-01-06 08:01:16 +03:00
Add NEVER() and ALWAYS() macros on branches that are believed to be
unreachable. FossilOrigin-Name: 3a901e88c87fc76c7fe42e47a976a5706830f0dbd6027605663e4d55f4f33590
This commit is contained in:
@@ -6335,14 +6335,14 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
|
||||
for(pIEpr=pParse->pIdxEpr; pIEpr; pIEpr=pIEpr->pIENext){
|
||||
int iDataCur = pIEpr->iDataCur;
|
||||
if( iDataCur<0 ) continue;
|
||||
if( pParse->iSelfTab ){
|
||||
if( NEVER(pParse->iSelfTab) ){
|
||||
if( pIEpr->iDataCur!=pParse->iSelfTab-1 ) continue;
|
||||
iDataCur = -1;
|
||||
}
|
||||
if( sqlite3ExprCompare(0, pExpr, pIEpr->pExpr, iDataCur)==0 ) break;
|
||||
}
|
||||
if( pIEpr==0 ) break;
|
||||
if( !ExprUseYTab(pExpr) ) break;
|
||||
if( NEVER(!ExprUseYTab(pExpr)) ) break;
|
||||
|
||||
/* If we reach this point, it means that expression pExpr can be
|
||||
** translated into a reference to an index column as described by
|
||||
|
||||
@@ -6282,7 +6282,7 @@ static void optimizeAggregateUseOfIndexedExpr(
|
||||
NameContext *pNC /* Name context used to resolve agg-func args */
|
||||
){
|
||||
pAggInfo->nColumn = pAggInfo->nAccumulator;
|
||||
if( pAggInfo->nSortingColumn>0 ){
|
||||
if( ALWAYS(pAggInfo->nSortingColumn>0) ){
|
||||
if( pAggInfo->nColumn==0 ){
|
||||
pAggInfo->nSortingColumn = 0;
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user