diff options
author | drh <drh@noemail.net> | 2019-02-19 13:08:35 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-02-19 13:08:35 +0000 |
commit | 9df385ec3d1167d6abba905f39fc7cc84a2d24b8 (patch) | |
tree | 9cef2042ae1080f1693087fdf78440154c006f64 /src | |
parent | b43ac0021ff4f9e389551fc36b57664e265d4bc0 (diff) | |
download | sqlite-9df385ec3d1167d6abba905f39fc7cc84a2d24b8.tar.gz sqlite-9df385ec3d1167d6abba905f39fc7cc84a2d24b8.zip |
Always use the symbolic name SQLITE_IDXTYPE_PRIMARYKEY rather than a hard-coded
magic number 2.
FossilOrigin-Name: 55d43adc894a6b1e0f77bf481dad6dd604a0dc0022e72bbf2e3037f97351971e
Diffstat (limited to 'src')
-rw-r--r-- | src/insert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/insert.c b/src/insert.c index 1b6235d4d..6f044db5a 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1669,7 +1669,9 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn, aRegIdx[ix]); VdbeComment((v, "for %s", pIdx->zName)); #ifdef SQLITE_ENABLE_NULL_TRIM - if( pIdx->idxType==2 ) sqlite3SetMakeRecordP5(v, pIdx->pTable); + if( pIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ + sqlite3SetMakeRecordP5(v, pIdx->pTable); + } #endif /* In an UPDATE operation, if this index is the PRIMARY KEY index @@ -2410,7 +2412,7 @@ static int xferOptimization( sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest); } } - if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){ + if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ idxInsFlags |= OPFLAG_NCHANGE; } sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData); |