mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Do not allow triggers that run as part of REPLACE conflict resolution
during an UPDATE to modify the the table being updated. Otherwise, those triggers might delete content out from under the update operation, leading to all kinds of problems. Ticket [314cc133e5ada126] FossilOrigin-Name: db4b7e1dc399c1f16b827ac087aa37c0815f4b2f41f1ffad59963eead2ab5562
This commit is contained in:
15
src/btree.c
15
src/btree.c
@@ -699,6 +699,9 @@ static int saveCursorPosition(BtCursor *pCur){
|
||||
assert( 0==pCur->pKey );
|
||||
assert( cursorHoldsMutex(pCur) );
|
||||
|
||||
if( pCur->curFlags & BTCF_Pinned ){
|
||||
return SQLITE_CONSTRAINT_PINNED;
|
||||
}
|
||||
if( pCur->eState==CURSOR_SKIPNEXT ){
|
||||
pCur->eState = CURSOR_VALID;
|
||||
}else{
|
||||
@@ -4562,6 +4565,18 @@ i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
|
||||
return pCur->info.nKey;
|
||||
}
|
||||
|
||||
/*
|
||||
** Pin or unpin a cursor.
|
||||
*/
|
||||
void sqlite3BtreeCursorPin(BtCursor *pCur){
|
||||
assert( (pCur->curFlags & BTCF_Pinned)==0 );
|
||||
pCur->curFlags |= BTCF_Pinned;
|
||||
}
|
||||
void sqlite3BtreeCursorUnpin(BtCursor *pCur){
|
||||
assert( (pCur->curFlags & BTCF_Pinned)!=0 );
|
||||
pCur->curFlags &= ~BTCF_Pinned;
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
/*
|
||||
** Return the offset into the database file for the start of the
|
||||
|
Reference in New Issue
Block a user