mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
From sqlite3BtreeInsert(), bypass the btreeMoveto() routine for table inserts
and go directly to sqlite3BtreeMovetoUnpacked(). FossilOrigin-Name: 53fe685d56368af78238c8981cc41704929f7660
This commit is contained in:
14
src/btree.c
14
src/btree.c
@@ -7903,20 +7903,22 @@ int sqlite3BtreeInsert(
|
||||
if( rc ) return rc;
|
||||
|
||||
if( pCur->pKeyInfo==0 ){
|
||||
assert( pKey==0 );
|
||||
/* If this is an insert into a table b-tree, invalidate any incrblob
|
||||
** cursors open on the row being replaced */
|
||||
invalidateIncrblobCursors(p, nKey, 0);
|
||||
|
||||
/* If the cursor is currently on the last row and we are appending a
|
||||
** new row onto the end, set the "loc" to avoid an unnecessary btreeMoveto()
|
||||
** call */
|
||||
** new row onto the end, set the "loc" to avoid an unnecessary
|
||||
** btreeMoveto() call */
|
||||
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && nKey>0
|
||||
&& pCur->info.nKey==nKey-1 ){
|
||||
loc = -1;
|
||||
loc = -1;
|
||||
}else if( loc==0 ){
|
||||
rc = sqlite3BtreeMovetoUnpacked(pCur, 0, nKey, appendBias, &loc);
|
||||
if( rc ) return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if( !loc ){
|
||||
}else if( loc==0 ){
|
||||
rc = btreeMoveto(pCur, pKey, nKey, appendBias, &loc);
|
||||
if( rc ) return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user