aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-05-29 20:29:13 +0000
committerdrh <drh@noemail.net>2014-05-29 20:29:13 +0000
commitcbabb203908dc97166f2c5fe9366e134fdaf1ed2 (patch)
tree5cc34fc60adfff789aa59dc771b02e9440c0ec1e /src/insert.c
parentaff0fbb6a51b2ad8a5e1d7787236226603380437 (diff)
parentb463fef3fda4d233ba634d81bfc9c3bf001f0513 (diff)
downloadsqlite-cbabb203908dc97166f2c5fe9366e134fdaf1ed2.tar.gz
sqlite-cbabb203908dc97166f2c5fe9366e134fdaf1ed2.zip
Merge trunk changes into the sessions branch.
FossilOrigin-Name: 9f18e78f039ffa89a8806810ad385bdc51bc88ed
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/insert.c b/src/insert.c
index 31e16ba54..38e68ccdb 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -1475,7 +1475,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]);
@@ -1576,7 +1576,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;
}
@@ -1662,7 +1662,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] ){