Lines Matching defs:pRec

81945     UnpackedRecord *pRec = p->ppRec[0];
81947 if( pRec==0 ){
81954 pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte);
81955 if( pRec ){
81956 pRec->pKeyInfo = sqlite3KeyInfoOfIndex(p->pParse, pIdx);
81957 if( pRec->pKeyInfo ){
81958 assert( pRec->pKeyInfo->nAllField==nCol );
81959 assert( pRec->pKeyInfo->enc==ENC(db) );
81960 pRec->aMem = (Mem *)((u8*)pRec + ROUND8(sizeof(UnpackedRecord)));
81962 pRec->aMem[i].flags = MEM_Null;
81963 pRec->aMem[i].db = db;
81966 sqlite3DbFreeNN(db, pRec);
81967 pRec = 0;
81970 if( pRec==0 ) return 0;
81971 p->ppRec[0] = pRec;
81974 pRec->nField = p->iVal+1;
81975 return &pRec->aMem[p->iVal];
82416 ** Extract the iCol-th column from the nRec-byte record in pRec. Write
82425 const void *pRec, /* Pointer to buffer containing record */
82426 int nRec, /* Size of buffer pRec in bytes */
82436 u8 *a = (u8*)pRec; /* Typecast byte array */
82468 SQLITE_PRIVATE void sqlite3Stat4ProbeFree(UnpackedRecord *pRec){
82469 if( pRec ){
82471 int nCol = pRec->pKeyInfo->nAllField;
82472 Mem *aMem = pRec->aMem;
82477 sqlite3KeyInfoUnref(pRec->pKeyInfo);
82478 sqlite3DbFreeNN(db, pRec);
90581 ** The string in pRec is known to look like an integer and to have a
90586 static int alsoAnInt(Mem *pRec, double rValue, i64 *piValue){
90593 return 0==sqlite3Atoi64(pRec->z, piValue, pRec->n, pRec->enc);
90611 static void applyNumericAffinity(Mem *pRec, int bTryForInt){
90613 u8 enc = pRec->enc;
90615 assert( (pRec->flags & (MEM_Str|MEM_Int|MEM_Real|MEM_IntReal))==MEM_Str );
90616 rc = sqlite3AtoF(pRec->z, &rValue, pRec->n, enc);
90618 if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
90619 pRec->flags |= MEM_Int;
90621 pRec->u.r = rValue;
90622 pRec->flags |= MEM_Real;
90623 if( bTryForInt ) sqlite3VdbeIntegerAffinity(pRec);
90629 pRec->flags &= ~MEM_Str;
90638 ** Try to convert pRec to an integer representation or a
90645 ** Convert pRec to a text representation.
90649 ** No-op. pRec is unchanged.
90652 Mem *pRec, /* The value to apply affinity to */
90659 if( (pRec->flags & MEM_Int)==0 ){ /*OPTIMIZATION-IF-FALSE*/
90660 if( (pRec->flags & MEM_Real)==0 ){
90661 if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1);
90663 sqlite3VdbeIntegerAffinity(pRec);
90672 if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/
90673 if( (pRec->flags&(MEM_Real|MEM_Int|MEM_IntReal)) ){
90674 testcase( pRec->flags & MEM_Int );
90675 testcase( pRec->flags & MEM_Real );
90676 testcase( pRec->flags & MEM_IntReal );
90677 sqlite3VdbeMemStringify(pRec, enc, 1);
90680 pRec->flags &= ~(MEM_Real|MEM_Int|MEM_IntReal);
93637 Mem *pRec; /* The new record */
93686 pRec = pData0;
93688 applyAffinity(pRec, zAffinity[0], encoding);
93689 if( zAffinity[0]==SQLITE_AFF_REAL && (pRec->flags & MEM_Int) ){
93690 pRec->flags |= MEM_IntReal;
93691 pRec->flags &= ~(MEM_Int);
93693 REGISTER_TRACE((int)(pRec-aMem), pRec);
93695 pRec++;
93696 assert( zAffinity[0]==0 || pRec<=pLast );
93740 pRec = pLast;
93742 assert( memIsValid(pRec) );
93743 if( pRec->flags & MEM_Null ){
93744 if( pRec->flags & MEM_Zero ){
93754 pRec->uTemp = 10;
93756 pRec->uTemp = 0;
93759 }else if( pRec->flags & (MEM_Int|MEM_IntReal) ){
93761 i64 i = pRec->u.i;
93763 testcase( pRec->flags & MEM_Int );
93764 testcase( pRec->flags & MEM_IntReal );
93778 pRec->uTemp = 8+(u32)uu;
93781 pRec->uTemp = 1;
93785 pRec->uTemp = 2;
93788 pRec->uTemp = 3;
93791 pRec->uTemp = 4;
93794 pRec->uTemp = 5;
93797 if( pRec->flags & MEM_IntReal ){
93801 pRec->u.r = (double)pRec->u.i;
93802 pRec->flags &= ~MEM_IntReal;
93803 pRec->flags |= MEM_Real;
93804 pRec->uTemp = 7;
93806 pRec->uTemp = 6;
93809 }else if( pRec->flags & MEM_Real ){
93812 pRec->uTemp = 7;
93814 assert( db->mallocFailed || pRec->flags&(MEM_Str|MEM_Blob) );
93815 assert( pRec->n>=0 );
93816 len = (u32)pRec->n;
93817 serial_type = (len*2) + 12 + ((pRec->flags & MEM_Str)!=0);
93818 if( pRec->flags & MEM_Zero ){
93819 serial_type += pRec->u.nZero*2;
93821 if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
93822 len += pRec->u.nZero;
93824 nZero += pRec->u.nZero;
93829 pRec->uTemp = serial_type;
93831 if( pRec==pData0 ) break;
93832 pRec--;
93888 pRec = pData0;
93890 serial_type = pRec->uTemp;
93903 assert( sizeof(v)==sizeof(pRec->u.r) );
93904 memcpy(&v, &pRec->u.r, sizeof(v));
93907 v = pRec->u.i;
93920 if( serial_type>=14 && pRec->n>0 ){
93921 assert( pRec->z!=0 );
93922 memcpy(zPayload, pRec->z, pRec->n);
93923 zPayload += pRec->n;
93927 if( pRec->n ){
93928 assert( pRec->z!=0 );
93929 memcpy(zPayload, pRec->z, pRec->n);
93930 zPayload += pRec->n;
93933 if( pRec==pLast ) break;
93934 pRec++;
151724 UnpackedRecord *pRec; /* Probe for stat4 (if required) */
151725 int nRecValid; /* Number of valid fields currently in pRec */
157974 ** aStat[0] Est. number of rows less than pRec
157975 ** aStat[1] Est. number of rows equal to pRec
157978 ** is greater than or equal to pRec. Note that this index is not an index
157981 ** pRec.
157986 UnpackedRecord *pRec, /* Vector of values to consider */
157992 int i; /* Index of first sample >= pRec */
157993 int iSample; /* Smallest sample larger than or equal to pRec */
157997 int nField; /* Number of fields in pRec */
157998 tRowcnt iLower = 0; /* anLt[] + anEq[] of largest sample pRec is > */
158003 assert( pRec!=0 );
158005 assert( pRec->nField>0 );
158008 ** to pRec. If pRec contains a single field, the set of samples to search
158012 ** If pRec contains N fields, where N is more than one, then as well as the
158051 nField = MIN(pRec->nField, pIdx->nSample);
158071 pRec->nField = n;
158072 res = sqlite3VdbeRecordCompare(aSample[iSamp].n, aSample[iSamp].p, pRec);
158093 /* If (res==0) is true, then pRec must be equal to sample i. */
158096 pRec->nField = nField;
158097 assert( 0==sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec)
158101 /* Unless i==pIdx->nSample, indicating that pRec is larger than
158102 ** all samples in the aSample[] array, pRec must be smaller than the
158105 pRec->nField = iCol+1;
158107 || sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec)>0
158110 /* if i==0 and iCol==0, then record pRec is smaller than all samples
158111 ** in the aSample[] array. Otherwise, if (iCol>0) then pRec must
158113 ** If (i>0), then pRec must also be greater than sample (i-1). */
158115 pRec->nField = iCol;
158116 assert( sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec)<=0
158120 pRec->nField = nField;
158121 assert( sqlite3VdbeRecordCompare(aSample[i-1].n, aSample[i-1].p, pRec)<0
158129 /* Record pRec is equal to sample i */
158135 ** sample that is greater than pRec. Or, if i==pIdx->nSample then pRec
158158 /* Restore the pRec->nField value before returning. */
158159 pRec->nField = nField;
158370 UnpackedRecord *pRec = pBuilder->pRec;
158399 if( pRec ){
158400 testcase( pRec->nField!=pBuilder->nRecValid );
158401 pRec->nField = pBuilder->nRecValid;
158410 whereKeyStats(pParse, p, pRec, 0, a);
158428 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, nBtm, nEq, &n);
158433 iLwrIdx = whereKeyStats(pParse, p, pRec, 0, a);
158445 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, nTop, nEq, &n);
158450 iUprIdx = whereKeyStats(pParse, p, pRec, 1, a);
158458 pBuilder->pRec = pRec;
158540 UnpackedRecord *pRec = pBuilder->pRec;
158564 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, 1, nEq-1, &bOk);
158565 pBuilder->pRec = pRec;
158570 whereKeyStats(pParse, p, pRec, 0, a);
160182 sqlite3Stat4ProbeFree(pBuilder->pRec);
160184 pBuilder->pRec = 0;