mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +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:
30
src/vdbe.c
30
src/vdbe.c
@@ -7025,6 +7025,36 @@ case OP_Expire: {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: CursorLock P1 * * * *
|
||||
**
|
||||
** Lock the btree to which cursor P1 is pointing so that the btree cannot be
|
||||
** written by an other cursor.
|
||||
*/
|
||||
case OP_CursorLock: {
|
||||
VdbeCursor *pC;
|
||||
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
|
||||
pC = p->apCsr[pOp->p1];
|
||||
assert( pC!=0 );
|
||||
assert( pC->eCurType==CURTYPE_BTREE );
|
||||
sqlite3BtreeCursorPin(pC->uc.pCursor);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Opcode: CursorUnlock P1 * * * *
|
||||
**
|
||||
** Unlock the btree to which cursor P1 is pointing so that it can be
|
||||
** written by other cursors.
|
||||
*/
|
||||
case OP_CursorUnlock: {
|
||||
VdbeCursor *pC;
|
||||
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
|
||||
pC = p->apCsr[pOp->p1];
|
||||
assert( pC!=0 );
|
||||
assert( pC->eCurType==CURTYPE_BTREE );
|
||||
sqlite3BtreeCursorUnpin(pC->uc.pCursor);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
/* Opcode: TableLock P1 P2 P3 P4 *
|
||||
** Synopsis: iDb=P1 root=P2 write=P3
|
||||
|
Reference in New Issue
Block a user