diff options
author | drh <drh@noemail.net> | 2014-05-27 18:18:58 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-05-27 18:18:58 +0000 |
commit | 48dd1d8e281238bb2844e03732d3e919429ee0e7 (patch) | |
tree | c22dc65d292b831e3a8a587e752ea5b6d4a26738 /src/insert.c | |
parent | a3bc66a3f588f1db8ed410b461cf0bce63059400 (diff) | |
download | sqlite-48dd1d8e281238bb2844e03732d3e919429ee0e7.tar.gz sqlite-48dd1d8e281238bb2844e03732d3e919429ee0e7.zip |
Change the name of the Index.autoIndex field to Index.idxType and provide
symbolic names for the various values of that field rather than using
magic numbers.
FossilOrigin-Name: d16e575dacc811de0f7b58a0d1cd243678dce6c5
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/insert.c b/src/insert.c index 9f588d906..7b427d1eb 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1463,7 +1463,7 @@ void sqlite3GenerateConstraintChecks( ** KEY values of this row before the update. */ int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol; int op = OP_Ne; - int regCmp = (pIdx->autoIndex==2 ? regIdx : regR); + int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR); for(i=0; i<pPk->nKeyCol; i++){ char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]); @@ -1564,7 +1564,7 @@ void sqlite3CompleteInsertion( sqlite3VdbeAddOp2(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i]); pik_flags = 0; if( useSeekResult ) pik_flags = OPFLAG_USESEEKRESULT; - if( pIdx->autoIndex==2 && !HasRowid(pTab) ){ + if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ assert( pParse->nested==0 ); pik_flags |= OPFLAG_NCHANGE; } @@ -1650,7 +1650,7 @@ int sqlite3OpenTableAndIndices( for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ int iIdxCur = iBase++; assert( pIdx->pSchema==pTab->pSchema ); - if( pIdx->autoIndex==2 && !HasRowid(pTab) && piDataCur ){ + if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) && piDataCur ){ *piDataCur = iIdxCur; } if( aToOpen==0 || aToOpen[i+1] ){ |