1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

When building an ephemeral table of integers, do not assume that the table

does not already contain N if the insert cursor points to N-1. Fix for ticket
[61fe9745].

FossilOrigin-Name: 1c1b0862236f564283be08338790d6494e705f1198547a59499e3f8c07f2cd99
This commit is contained in:
dan
2017-04-24 14:16:55 +00:00
parent 0c3233be0b
commit a1188d6d93
4 changed files with 21 additions and 12 deletions

View File

@@ -8124,9 +8124,6 @@ int sqlite3BtreeInsert(
** btreeMoveto() call */
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
loc = 0;
}else if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey>0
&& pCur->info.nKey==pX->nKey-1 ){
loc = -1;
}else if( loc==0 ){
rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, flags!=0, &loc);
if( rc ) return rc;