mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix the VDBE so that it correctly handles the sequence of operations
OP_OpenEphemeral, OP_OpenDup, OP_OpenEphemeral, and OP_OpenDup in that order on the same cursor. FossilOrigin-Name: a1be6ee0188911448c064e2c25fb0ca1daad50f3d50fb49a34430bd09736b4a9
This commit is contained in:
@@ -3917,15 +3917,13 @@ case OP_OpenEphemeral: {
|
||||
assert( pOp->p1>=0 );
|
||||
assert( pOp->p2>=0 );
|
||||
pCx = p->apCsr[pOp->p1];
|
||||
if( pCx ){
|
||||
if( pCx && pCx->pBtx ){
|
||||
/* If the ephermeral table is already open, erase all existing content
|
||||
** so that the table is empty again, rather than creating a new table. */
|
||||
assert( pCx->isEphemeral );
|
||||
pCx->seqCount = 0;
|
||||
pCx->cacheStatus = CACHE_STALE;
|
||||
if( pCx->pBtx ){
|
||||
rc = sqlite3BtreeClearTable(pCx->pBtx, pCx->pgnoRoot, 0);
|
||||
}
|
||||
rc = sqlite3BtreeClearTable(pCx->pBtx, pCx->pgnoRoot, 0);
|
||||
}else{
|
||||
pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, CURTYPE_BTREE);
|
||||
if( pCx==0 ) goto no_mem;
|
||||
|
Reference in New Issue
Block a user