1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Correctly handle changing counting when inserting and deleting on

WITHOUT ROWID tables.  Add more FOREIGN KEY test cases.

FossilOrigin-Name: d072bcd0a8692d590c13c2bf458454c10c12a3e2
This commit is contained in:
drh
2013-11-04 15:23:25 +00:00
parent 90e758ff1f
commit 6546af1480
6 changed files with 106 additions and 13 deletions

View File

@@ -1627,9 +1627,12 @@ void sqlite3CompleteInsertion(
sqlite3VdbeAddOp2(v, OP_IsNull, aRegIdx[i], sqlite3VdbeCurrentAddr(v)+2);
}
sqlite3VdbeAddOp2(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i]);
if( useSeekResult ){
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
pik_flags = 0;
if( useSeekResult ) pik_flags = OPFLAG_USESEEKRESULT;
if( pIdx->autoIndex==2 && !HasRowid(pTab) && pParse->nested==0 ){
pik_flags |= OPFLAG_NCHANGE;
}
if( pik_flags ) sqlite3VdbeChangeP5(v, pik_flags);
}
if( !HasRowid(pTab) ) return;
regData = regNewData + 1;