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

Enhance the OP_IdxInsert opcode to optionally accept unpacked key material.

FossilOrigin-Name: 89d958abbac45f2ca5954080cd9e74ec9a07ebb2
This commit is contained in:
drh
2016-11-09 00:10:33 +00:00
parent 3b908d41a0
commit 9b4eaebc68
12 changed files with 60 additions and 36 deletions

View File

@@ -8019,7 +8019,16 @@ int sqlite3BtreeInsert(
if( rc ) return rc;
}
}else if( loc==0 ){
rc = btreeMoveto(pCur, pX->pKey, pX->nKey, appendBias, &loc);
if( pX->nMem ){
UnpackedRecord r;
memset(&r, 0, sizeof(r));
r.pKeyInfo = pCur->pKeyInfo;
r.aMem = pX->aMem;
r.nField = pX->nMem;
rc = sqlite3BtreeMovetoUnpacked(pCur, &r, 0, appendBias, &loc);
}else{
rc = btreeMoveto(pCur, pX->pKey, pX->nKey, appendBias, &loc);
}
if( rc ) return rc;
}
assert( pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc) );