1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-03 08:01:19 +03:00

Refactoring: Change "pIndex->onError!=OE_None" to use a macro:

"IsUniqueIndex(pIndex)".  Easier to understand that way.

FossilOrigin-Name: e75b26ee357bb3d3c1a539b05d633ebf314726d7
This commit is contained in:
drh
2014-07-31 22:59:04 +00:00
parent 37e08081f3
commit 5f1d1d9c87
10 changed files with 30 additions and 27 deletions

View File

@@ -2707,7 +2707,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
addr1 = sqlite3VdbeAddOp2(v, OP_SorterSort, iSorter, 0); VdbeCoverage(v);
assert( pKey!=0 || db->mallocFailed || pParse->nErr );
if( pIndex->onError!=OE_None && pKey!=0 ){
if( IsUniqueIndex(pIndex) && pKey!=0 ){
int j2 = sqlite3VdbeCurrentAddr(v) + 3;
sqlite3VdbeAddOp2(v, OP_Goto, 0, j2);
addr2 = sqlite3VdbeCurrentAddr(v);
@@ -3104,9 +3104,9 @@ Index *sqlite3CreateIndex(
Index *pIdx;
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
int k;
assert( pIdx->onError!=OE_None );
assert( IsUniqueIndex(pIdx) );
assert( pIdx->idxType!=SQLITE_IDXTYPE_APPDEF );
assert( pIndex->onError!=OE_None );
assert( IsUniqueIndex(pIndex) );
if( pIdx->nKeyCol!=pIndex->nKeyCol ) continue;
for(k=0; k<pIdx->nKeyCol; k++){
@@ -3297,7 +3297,7 @@ void sqlite3DefaultRowEst(Index *pIdx){
}
assert( 0==sqlite3LogEst(1) );
if( pIdx->onError!=OE_None ) a[pIdx->nKeyCol] = 0;
if( IsUniqueIndex(pIdx) ) a[pIdx->nKeyCol] = 0;
}
/*