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

Add a new hint bit on the flags parameter of sqlite3BtreeDelete(). The new

BTREE_IDXDELETE bit indicates that the call is to delete an index entry 
corresponding to a table row that has already been deleted.

FossilOrigin-Name: ac2cbadd8000947c097da5b00c00090fe58fdcff
This commit is contained in:
drh
2016-01-21 17:06:33 +00:00
parent 9c0c57a4ca
commit e807bdba86
7 changed files with 73 additions and 33 deletions

View File

@@ -718,6 +718,7 @@ void sqlite3GenerateRowDelete(
** a view (in which case the only effect of the DELETE statement is to
** fire the INSTEAD OF triggers). */
if( pTab->pSelect==0 ){
u8 p5 = 0;
sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur,0,iIdxNoSeek);
sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, (count?OPFLAG_NCHANGE:0));
if( count ){
@@ -725,8 +726,10 @@ void sqlite3GenerateRowDelete(
}
if( iIdxNoSeek>=0 ){
sqlite3VdbeAddOp1(v, OP_Delete, iIdxNoSeek);
if( eMode!=ONEPASS_OFF ) p5 = OPFLAG_IDXDELETE;
}
sqlite3VdbeChangeP5(v, eMode==ONEPASS_MULTI);
if( eMode==ONEPASS_MULTI ) p5 |= OPFLAG_SAVEPOSITION;
sqlite3VdbeChangeP5(v, p5);
}
/* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to