Lines Matching refs:nKey

6462   const void *pKey, int nKey     /* The key */
6467 const void *pKey, int nKey /* The key */
6480 const void *pKey, int nKey /* The new key */
6485 const void *pKey, int nKey /* The new key */
13976 /* #define sqliteHashKeysize(E) ((E)->nKey) // NOT USED */
15697 ** an arbitrary key and no data. These btrees have pKey,nKey set to the
15703 ** the key and passed in the nKey field. The pKey field is zero.
15713 ** nKey the ROWID length of pKey
15728 sqlite3_int64 nKey; /* Size of pKey for indexes. PRIMARY KEY for tabs */
68047 i64 nKey; /* The key for INTKEY tables, or nPayload otherwise */
68108 i64 nKey; /* Size of pKey, or last integer key */
68123 #define BTCF_ValidNKey 0x02 /* True if info.nKey is valid */
68149 ** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in
69174 if( p->pgnoRoot==pgnoRoot && (isClearTable || p->info.nKey==iRow) ){
69274 ** function saves the current cursor key in variables pCur->nKey and
69279 ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to
69281 ** set to point to a malloced buffer pCur->nKey bytes in size containing
69292 pCur->nKey = sqlite3BtreeIntegerKey(pCur);
69301 pCur->nKey = sqlite3BtreePayloadSize(pCur);
69302 pKey = sqlite3Malloc( pCur->nKey + 9 + 8 );
69304 rc = sqlite3BtreePayload(pCur, 0, (int)pCur->nKey, pKey);
69306 memset(((u8*)pKey)+pCur->nKey, 0, 9+8);
69320 ** Save the current cursor position in the variables BtCursor.nKey
69433 i64 nKey, /* Integer key for tables. Size of pKey for indices */
69442 assert( nKey==(i64)(int)nKey );
69445 sqlite3VdbeRecordUnpack(pKeyInfo, (int)nKey, pKey, pIdxKey);
69454 rc = sqlite3BtreeTableMoveto(pCur, nKey, bias, pRes);
69478 rc = btreeMoveto(pCur, pCur->pKey, pCur->nKey, 0, &skipNext);
69805 pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
69844 ** pIter += getVarint(pIter, (u64*)&pInfo->nKey);
69877 pInfo->nKey = *(i64*)&iKey;
69914 pInfo->nKey = nPayload;
71963 ** 9-byte nKey value
73328 if( a->nKey!=b->nKey ) return 0;
73379 return pCur->info.nKey;
74220 if( pCur->info.nKey==intKey ){
74224 if( pCur->info.nKey<intKey ){
74233 if( pCur->info.nKey+1==intKey ){
74238 if( pCur->info.nKey==intKey ){
74311 pCur->info.nKey = nCellKey;
74569 nCell = (int)pCur->info.nKey;
75471 nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
75473 assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
75474 nSrc = nPayload = (int)pX->nKey;
75528 assert( info.nKey==pX->nKey );
77100 sz = 4 + putVarint(&pCell[4], info.nKey);
77604 ** For a table btree (used for rowid tables), only the pX.nKey value of
77605 ** the key is used. The pX.pKey value must be NULL. The pX.nKey is the
77610 ** key is an arbitrary byte sequence stored in pX.pKey,nKey. The
77614 ** sqlite3BtreeIndexMoveto() to seek cursor pCur to (pKey,nKey) has already
77618 ** smaller then (pKey,nKey). If seekResult>0 then pCur points to a cell
77619 ** that is larger than (pKey,nKey).
77623 ** point for (pKey,nKey) before doing the insertion. For index btrees,
77699 invalidateIncrblobCursors(p, pCur->pgnoRoot, pX->nKey, 0);
77708 assert( pX->nKey==pCur->info.nKey );
77717 if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
77733 rc = sqlite3BtreeTableMoveto(pCur, pX->nKey,
77760 rc = btreeMoveto(pCur, pX->pKey, pX->nKey,
77772 if( pCur->info.nKey==pX->nKey ){
77775 x2.nData = pX->nKey;
77785 assert( pPage->intKey || pX->nKey>=0 || (flags & BTREE_PREFORMAT) );
77798 pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
77910 pCur->pKey = sqlite3Malloc( pX->nKey );
77914 memcpy(pCur->pKey, pX->pKey, pX->nKey);
77918 pCur->nKey = pX->nKey;
78151 invalidateIncrblobCursors(p, pCur->pgnoRoot, pCur->info.nKey, 0);
79151 if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){
79152 checkAppendMsg(pCheck, "Rowid %lld out of order", info.nKey);
79154 maxKey = info.nKey;
86592 ** Given the nKey-byte encoding of a record in pKey[], populate the
86598 int nKey, /* Size of the binary record */
86614 while( idx<szHdr && d<=(u32)nKey ){
86628 if( d>(u32)nKey && u ){
86754 ** pKey,nKey. The verify that this count is less than or equal to the
86764 int nKey, const void *pKey, /* The record to verify */
86775 assert( nKey>=0 );
86776 assert( szHdr<=(u32)nKey );
89808 ** record in nKey/pKey. Return a pointer to the new UnpackedRecord structure
89813 int nKey,
89821 sqlite3VdbeRecordUnpack(pKeyInfo, nKey, pKey, pRet);
95923 x.nKey = pKey->u.i;
95939 sqlite3VdbePreUpdateHook(p,pC,SQLITE_INSERT,zDb,pTab,x.nKey,pOp->p2,-1);
95950 if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey;
95975 zDb, pTab->zName, x.nKey);
96682 x.nKey = pIn2->n;
100119 ** PMA, in sorted order. The next key to be read is cached in nKey/aKey.
100130 int nKey; /* Number of bytes in key */
100483 pReadr->nKey = (int)nRec;
101420 pReadr1->aKey, pReadr1->nKey, pReadr2->aKey, pReadr2->nKey
101671 int nKey = pReader->nKey;
101677 if( (iEof + nKey + sqlite3VarintLen(nKey))>(iStart + pIncr->mxSz) ) break;
101680 vdbePmaWriteVarint(&writer, nKey);
101681 vdbePmaWriteBlob(&writer, pReader->aKey, nKey);
101841 pTask, &bCached, p1->aKey, p1->nKey, p2->aKey, p2->nKey
102463 *pnKey = pReader->nKey;
102477 void *pKey; int nKey; /* Sorter key to copy into pOut */
102481 pKey = vdbeSorterRowkey(pSorter, &nKey);
102482 if( sqlite3VdbeMemClearAndResize(pOut, nKey) ){
102485 pOut->n = nKey;
102487 memcpy(pOut->z, pKey, nKey);
102518 void *pKey; int nKey; /* Sorter key to compare pVal with */
102531 pKey = vdbeSorterRowkey(pSorter, &nKey);
102532 sqlite3VdbeRecordUnpack(pKeyInfo, nKey, pKey, r2);
116751 int nKey;
116763 nKey = sqlite3_value_bytes(argv[2]);
116765 rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
116772 sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
116773 if( nKey || sqlite3BtreeGetRequestedReserve(db->aDb[0].pBt)>0 ){
116774 rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
119716 ** Return true if any of the first nKey entries of index pIdx exactly
119721 ** The first nKey entries of pIdx are guaranteed to be ordinary columns,
119728 static int isDupColumn(Index *pIdx, int nKey, Index *pPk, int iCol){
119730 assert( nKey<=pIdx->nColumn );
119738 for(i=0; i<nKey; i++){
123004 int nKey = pIdx->nKeyCol;
123008 pKey = sqlite3KeyInfoAlloc(pParse->db, nKey, nCol-nKey);
124003 i16 nKey; /* Number of memory cells in the row key */
124244 nKey = nPk; /* OP_Found will use an unpacked key */
124260 nKey = 0; /* Zero tells OP_Found to use a composite key */
124266 nKey = 1; /* OP_DeferredSeek always uses a single rowid */
124296 assert( nKey==nPk ); /* OP_Found will use an unpacked key */
124299 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
124309 assert( nKey==0 ); /* OP_Found will use a composite key */
124313 assert( nKey==1 );
124336 iKey, nKey, count, OE_Default, eOnePass, aiCurOnePass[1]);
138274 int nKey; /* Number of PK columns for table pTab (>=1) */
138957 int nKey; /* Number of sorting key columns, including OP_Sequence */
138963 nKey = nExpr - pSort->nOBSat + bSeq;
138973 pOp->p2 = nKey + nData;
139258 int nKey = 1;
139263 nKey = pPk->nKeyCol;
139265 for(k=0; k<nKey; k++){
139277 pSort->aDefer[nDefer].nKey = nKey;
139658 int nKey;
139664 nKey = pSO->nExpr;
139666 r2 = sqlite3GetTempRange(pParse, nKey+2);
139667 r3 = r2+nKey+1;
139681 for(i=0; i<nKey; i++){
139686 sqlite3VdbeAddOp2(v, OP_Sequence, iParm, r2+nKey);
139687 sqlite3VdbeAddOp3(v, OP_MakeRecord, r2, nKey+2, r1);
139688 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iParm, r1, r2, nKey+2);
139691 sqlite3ReleaseTempRange(pParse, r2, nKey+2);
139882 int nKey; /* Number of key columns in sorter record */
139902 nRefKey = MAX(nRefKey, pSort->aDefer[i].nKey);
139922 nKey = pOrderBy->nExpr - pSort->nOBSat;
139930 nKey+1+nColumn+nRefKey);
139958 for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){
139972 int nKey = pSort->aDefer[i].nKey;
139982 assert( sqlite3PrimaryKeyIndex(pTab)->nKeyCol==nKey );
139983 for(k=0; k<nKey; k++){
139987 sqlite3VdbeAddOp4Int(v, OP_SeekGE, iCsr, iJmp+2, regKey, nKey);
139988 sqlite3VdbeAddOp4Int(v, OP_IdxLE, iCsr, iJmp+3, regKey, nKey);
140015 sqlite3VdbeAddOp3(v, OP_Column, iSortTab, nKey+bSeq, regRow);
148173 int nKey = 0; /* Number of elements in regKey for WITHOUT ROWID */
148552 nKey = nPk;
148628 nKey = nPk;
148671 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey,nKey);
148825 sqlite3VdbeAddOp4Int(v, OP_NotFound,iDataCur,labelContinue,regKey,nKey);
148870 sqlite3VdbeAddOp4Int(v, OP_NotFound,iDataCur,labelContinue,regKey,nKey);
149757 int nKey;
149759 sqlite3CodecGetKey(db, iDb, (void**)&zKey, &nKey);
149760 if( nKey ) db->nextPagesize = 0;
179259 void *pKey; int nKey; /* Key associated with this element */
179265 ** FTS3_HASH_STRING pKey points to a string that is nKey bytes long
179269 ** FTS3_HASH_BINARY pKey points to binary data nKey bytes long.
179281 SQLITE_PRIVATE void *sqlite3Fts3HashInsert(Fts3Hash*, const void *pKey, int nKey, void *pData);
179282 SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash*, const void *pKey, int nKey);
179311 #define fts3HashKeysize(E) ((E)->nKey)
180886 int nKey;
180899 else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){
180920 if( nKey==pOp->nOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){
186761 int nKey = pKey->n;
186766 assert( nKey==4 );
186768 nKey += 1+sqlite3Fts3ReadInt(&zInput[nKey+1], &nNear);
186776 cNext = zInput[nKey];
186787 *pnConsumed = (int)((zInput - z) + nKey);
187712 static int fts3StrHash(const void *pKey, int nKey){
187715 if( nKey<=0 ) nKey = (int) strlen(z);
187716 while( nKey > 0 ){
187718 nKey--;
187730 static int fts3BinHash(const void *pKey, int nKey){
187733 while( nKey-- > 0 ){
187824 int h = (*xHash)(elem->pKey, elem->nKey) & (new_size-1);
187838 int nKey,
187851 if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){
187900 int nKey
187908 h = (*xHash)(pKey,nKey);
187910 return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1));
187915 ** that matches pKey,nKey. Return the data for this element if it is
187918 SQLITE_PRIVATE void *sqlite3Fts3HashFind(const Fts3Hash *pH, const void *pKey, int nKey){
187921 pElem = sqlite3Fts3HashFindElem(pH, pKey, nKey);
187925 /* Insert an element into the hash table pH. The key is pKey,nKey
187943 int nKey, /* Number of bytes in the key */
187955 hraw = (*xHash)(pKey, nKey);
187958 elem = fts3FindElementByHash(pH,pKey,nKey,h);
187979 new_elem->pKey = fts3HashMalloc( nKey );
187984 memcpy((void*)new_elem->pKey, pKey, nKey);
187988 new_elem->nKey = nKey;
191611 int nKey = fts3HashKeysize(pE);
191612 if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){
194130 ** * The first key read from the input (arguments zKey and nKey) is
194139 int nKey, /* Number of bytes in nKey */
194179 /* Check that zKey/nKey is larger than the largest key the candidate */
194193 if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){
194919 int nKey = pCsr->nTerm;
194920 rc = fts3IncrmergeLoad(p, iAbsLevel, iIdx-1, zKey, nKey, pWriter);
199315 ** Compare the OBJECT label at pNode against zKey,nKey. Return true on
199318 static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){
199321 if( pNode->n!=nKey ) return 0;
199322 return strncmp(pNode->u.zJContent, zKey, nKey)==0;
199324 if( pNode->n!=nKey+2 ) return 0;
199325 return strncmp(pNode->u.zJContent+1, zKey, nKey)==0;
199348 u32 i, j, nKey;
199359 nKey = i-1;
199366 testcase( nKey==0 );
199370 nKey = i;
199371 if( nKey==0 ){
199379 if( jsonLabelCompare(pRoot+j, zKey, nKey) ){
199395 iLabel = jsonParseAddNode(pParse, JSON_STRING, nKey, zKey);
199882 u32 nKey;
199887 nKey = pPatch[i].n;
199894 if( pTarget[j].n==nKey && strncmp(pTarget[j].u.zJContent,zKey,nKey)==0 ){
199919 jsonParseAddNode(pParse, JSON_STRING, nKey, zKey);
229510 int nKey; /* Length of key in bytes */
229706 && p->nKey==nToken
229736 p->nKey = nToken;
229904 || (pIter->nKey+1>=nTerm && 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm))
229944 assert( p->nKey+1==(int)strlen(zKey) );
229945 if( nTerm==p->nKey+1 && memcmp(zKey, pTerm, nTerm)==0 ) break;
245262 CODEC_STATIC int sqlite3CodecSetPassword(KeyContext *keyCtx, const void *zKey, int nKey){
245263 keyCtx->passwordSize = nKey;
245268 errno_t rc = memcpy_s(keyCtx->password, keyCtx->passwordSize, zKey, nKey);
245341 CODEC_STATIC int sqlite3CodecInitKeyContext(CodecContext *ctx, Btree *p, const void *zKey, int nKey, int attachFlag,
245344 CODEC_STATIC int sqlite3CodecInitKeyContext(CodecContext *ctx, Btree *p, const void *zKey, int nKey){
245381 rc += sqlite3CodecSetPassword(keyCtx, zKey, nKey);
245411 CODEC_STATIC int sqlite3CodecInitContext(CodecContext *ctx, Btree *p, const void *zKey, int nKey, int nDb){
245414 CODEC_STATIC int sqlite3CodecInitContext(CodecContext *ctx, Btree *p, const void *zKey, int nKey){
245437 int rc = sqlite3CodecInitKeyContext(ctx, p, zKey, nKey, attachFlag, attachHmacAlgo);
245439 int rc = sqlite3CodecInitKeyContext(ctx, p, zKey, nKey);
245713 int sqlite3CodecAttach(sqlite3* db, int nDb, const void *pKey, int nKey){
245718 if(p == NULL || pKey == NULL || nKey <= 0){
245733 int rc = sqlite3CodecInitContext(ctx, p, pKey, nKey, nDb);
245735 int rc = sqlite3CodecInitContext(ctx, p, pKey, nKey);
245756 void sqlite3CodecGetKey(sqlite3* db, int nDb, void **pKey, int *nKey)
245766 *nKey = ctx->readCtx->passwordSize;
245769 *nKey = ctx->readCtx->codecConst.keyInfoSize;
245773 *nKey = 0;
245778 int sqlite3_key(sqlite3 *db, const void *pKey, int nKey){
245779 return sqlite3_key_v2(db, "main", pKey, nKey);
245782 int sqlite3_key_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey){
245783 if(db == NULL || pKey == NULL || nKey <= 0){
245787 return sqlite3CodecAttach(db, iDb, pKey, nKey);
245790 int sqlite3_rekey(sqlite3 *db, const void *pKey, int nKey){
245791 return sqlite3_rekey_v2(db, "main", pKey, nKey);
245794 int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey){
245795 if(db == NULL || pKey == NULL || nKey == 0){
245813 int rc = sqlite3CodecSetPassword(ctx->writeCtx, pKey, nKey);