mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Allow instruction OP_OpenDup to duplicate cursors created by OP_OpenDup, as well as by OP_OpenEphemeral.
FossilOrigin-Name: b8de980b2fb78088ef74e053cb987bb84319d13dc96ce1e89baaaa3fe8cf1efc
This commit is contained in:
@@ -3873,7 +3873,7 @@ case OP_OpenDup: {
|
||||
|
||||
pOrig = p->apCsr[pOp->p2];
|
||||
assert( pOrig );
|
||||
assert( pOrig->pBtx!=0 ); /* Only ephemeral cursors can be duplicated */
|
||||
assert( pOrig->isEphemeral ); /* Only ephemeral cursors can be duplicated */
|
||||
|
||||
pCx = allocateCursor(p, pOp->p1, pOrig->nField, -1, CURTYPE_BTREE);
|
||||
if( pCx==0 ) goto no_mem;
|
||||
@@ -3883,8 +3883,9 @@ case OP_OpenDup: {
|
||||
pCx->isTable = pOrig->isTable;
|
||||
pCx->pgnoRoot = pOrig->pgnoRoot;
|
||||
pCx->isOrdered = pOrig->isOrdered;
|
||||
rc = sqlite3BtreeCursor(pOrig->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
|
||||
pCx->pKeyInfo, pCx->uc.pCursor);
|
||||
rc = sqlite3BtreeCursor(sqlite3BtreeGetBtree(pOrig->uc.pCursor),
|
||||
pCx->pgnoRoot, BTREE_WRCSR, pCx->pKeyInfo, pCx->uc.pCursor
|
||||
);
|
||||
/* The sqlite3BtreeCursor() routine can only fail for the first cursor
|
||||
** opened for a database. Since there is already an open cursor when this
|
||||
** opcode is run, the sqlite3BtreeCursor() cannot fail */
|
||||
|
Reference in New Issue
Block a user