Lines Matching refs:pMem

264   Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem;  in allocateCursor()  local
282 assert( pMem->flags==MEM_Undefined ); in allocateCursor()
283 assert( (pMem->flags & MEM_Dyn)==0 ); in allocateCursor()
284 assert( pMem->szMalloc==0 || pMem->z==pMem->zMalloc ); in allocateCursor()
285 if( pMem->szMalloc<nByte ){ in allocateCursor()
286 if( pMem->szMalloc>0 ){ in allocateCursor()
287 sqlite3DbFreeNN(pMem->db, pMem->zMalloc); in allocateCursor()
289 pMem->z = pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, nByte); in allocateCursor()
290 if( pMem->zMalloc==0 ){ in allocateCursor()
291 pMem->szMalloc = 0; in allocateCursor()
294 pMem->szMalloc = nByte; in allocateCursor()
297 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->zMalloc; in allocateCursor()
304 &pMem->z[ROUND8P(sizeof(VdbeCursor))+2*sizeof(u32)*nField]; in allocateCursor()
423 Mem *pMem = (Mem*)pVal; in sqlite3_value_numeric_type() local
424 applyNumericAffinity(pMem, 0); in sqlite3_value_numeric_type()
448 static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){ in computeNumericType() argument
451 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal))==0 ); in computeNumericType()
452 assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ); in computeNumericType()
453 if( ExpandBlob(pMem) ){ in computeNumericType()
454 pMem->u.i = 0; in computeNumericType()
457 rc = sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc); in computeNumericType()
459 if( rc==0 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1 ){ in computeNumericType()
460 pMem->u.i = ix; in computeNumericType()
465 }else if( rc==1 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)==0 ){ in computeNumericType()
466 pMem->u.i = ix; in computeNumericType()
479 static u16 numericType(Mem *pMem){ in numericType() argument
480 assert( (pMem->flags & MEM_Null)==0 in numericType()
481 || pMem->db==0 || pMem->db->mallocFailed ); in numericType()
482 if( pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null) ){ in numericType()
483 testcase( pMem->flags & MEM_Int ); in numericType()
484 testcase( pMem->flags & MEM_Real ); in numericType()
485 testcase( pMem->flags & MEM_IntReal ); in numericType()
486 return pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null); in numericType()
488 assert( pMem->flags & (MEM_Str|MEM_Blob) ); in numericType()
489 testcase( pMem->flags & MEM_Str ); in numericType()
490 testcase( pMem->flags & MEM_Blob ); in numericType()
491 return computeNumericType(pMem); in numericType()
500 void sqlite3VdbeMemPrettyPrint(Mem *pMem, StrAccum *pStr){ in sqlite3VdbeMemPrettyPrint() argument
501 int f = pMem->flags; in sqlite3VdbeMemPrettyPrint()
519 for(i=0; i<25 && i<pMem->n; i++){ in sqlite3VdbeMemPrettyPrint()
520 sqlite3_str_appendf(pStr, "%02X", ((int)pMem->z[i] & 0xFF)); in sqlite3VdbeMemPrettyPrint()
523 for(i=0; i<25 && i<pMem->n; i++){ in sqlite3VdbeMemPrettyPrint()
524 char z = pMem->z[i]; in sqlite3VdbeMemPrettyPrint()
529 sqlite3_str_appendf(pStr, "+%dz",pMem->u.nZero); in sqlite3VdbeMemPrettyPrint()
546 sqlite3_str_appendf(pStr, " %c%d[", c, pMem->n); in sqlite3VdbeMemPrettyPrint()
547 for(j=0; j<25 && j<pMem->n; j++){ in sqlite3VdbeMemPrettyPrint()
548 c = pMem->z[j]; in sqlite3VdbeMemPrettyPrint()
551 sqlite3_str_appendf(pStr, "]%s", encnames[pMem->enc]); in sqlite3VdbeMemPrettyPrint()
595 /**/ void sqlite3PrintMem(Mem *pMem){ in sqlite3PrintMem() argument
596 memTracePrint(pMem); in sqlite3PrintMem()
700 static const char *vdbeMemTypeName(Mem *pMem){ in vdbeMemTypeName() argument
708 return azTypes[sqlite3_value_type(pMem)-1]; in vdbeMemTypeName()
1599 Mem *pMem = p->pResultSet; in sqlite3VdbeExec() local
1602 assert( memIsValid(&pMem[i]) ); in sqlite3VdbeExec()
1603 REGISTER_TRACE(pOp->p1+i, &pMem[i]); in sqlite3VdbeExec()
1609 pMem[i].pScopyFrom = 0; in sqlite3VdbeExec()
2985 sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static); in sqlite3VdbeExec()
5365 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */ in sqlite3VdbeExec() local
5430 pMem = &pFrame->aMem[pOp->p3]; in sqlite3VdbeExec()
5434 pMem = &aMem[pOp->p3]; in sqlite3VdbeExec()
5435 memAboutToChange(p, pMem); in sqlite3VdbeExec()
5437 assert( memIsValid(pMem) ); in sqlite3VdbeExec()
5439 REGISTER_TRACE(pOp->p3, pMem); in sqlite3VdbeExec()
5440 sqlite3VdbeMemIntegerify(pMem); in sqlite3VdbeExec()
5441 assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */ in sqlite3VdbeExec()
5442 if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){ in sqlite3VdbeExec()
5446 if( v<pMem->u.i+1 ){ in sqlite3VdbeExec()
5447 v = pMem->u.i + 1; in sqlite3VdbeExec()
5449 pMem->u.i = v; in sqlite3VdbeExec()
7091 Mem *pMem; /* Used to iterate through memory cells */ in sqlite3VdbeExec() local
7170 for(pMem=VdbeFrameMem(pFrame); pMem!=pEnd; pMem++){ in sqlite3VdbeExec()
7171 pMem->flags = MEM_Undefined; in sqlite3VdbeExec()
7172 pMem->db = db; in sqlite3VdbeExec()
7467 pCtx->pMem = 0; in sqlite3VdbeExec()
7490 Mem *pMem; in sqlite3VdbeExec() local
7494 pMem = &aMem[pOp->p3]; in sqlite3VdbeExec()
7500 assert( pMem->uTemp==0x1122e0e3 ); in sqlite3VdbeExec()
7503 pMem->uTemp = 0x1122e0e3; in sqlite3VdbeExec()
7511 if( pCtx->pMem != pMem ){ in sqlite3VdbeExec()
7512 pCtx->pMem = pMem; in sqlite3VdbeExec()
7523 pMem->n++; in sqlite3VdbeExec()
7583 Mem *pMem; in sqlite3VdbeExec() local
7586 pMem = &aMem[pOp->p1]; in sqlite3VdbeExec()
7587 assert( (pMem->flags & ~(MEM_Null|MEM_Agg))==0 ); in sqlite3VdbeExec()
7591 rc = sqlite3VdbeMemAggValue(pMem, &aMem[pOp->p3], pOp->p4.pFunc); in sqlite3VdbeExec()
7592 pMem = &aMem[pOp->p3]; in sqlite3VdbeExec()
7596 rc = sqlite3VdbeMemFinalize(pMem, pOp->p4.pFunc); in sqlite3VdbeExec()
7600 sqlite3VdbeError(p, "%s", sqlite3_value_text(pMem)); in sqlite3VdbeExec()
7603 sqlite3VdbeChangeEncoding(pMem, encoding); in sqlite3VdbeExec()
7604 UPDATE_MAX_BLOBSIZE(pMem); in sqlite3VdbeExec()
7623 Mem *pMem; /* Write results here */ in sqlite3VdbeExec() local
7639 for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){ in sqlite3VdbeExec()
7640 sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]); in sqlite3VdbeExec()
8697 Mem *pMem; in sqlite3VdbeExec() local
8702 pMem = &aMem[pOp->p1]; in sqlite3VdbeExec()
8704 for(i=0; i<pOp->p2; i++, pMem++){ in sqlite3VdbeExec()
8706 pMem->pScopyFrom = 0; in sqlite3VdbeExec()
8707 if( i<32 && pOp->p5 ) MemSetTypeFlag(pMem, MEM_Undefined); in sqlite3VdbeExec()