Home | History | Annotate | Download | only in orig

Lines Matching refs:pMem

8478     Mem *pMem;             /* Used when p4type is P4_MEM */
13085 Mem *pMem; /* Memory cell used to store aggregate context */
13243 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
13247 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem);
13289 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
13291 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
20683 ** This routine transforms the internal text encoding used by pMem to
20685 ** encoding, or if *pMem does not contain a string value.
20687 SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
20695 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
20696 assert( pMem->flags&MEM_Str );
20697 assert( pMem->enc!=desiredEnc );
20698 assert( pMem->enc!=0 );
20699 assert( pMem->n>=0 );
20704 sqlite3VdbeMemPrettyPrint(pMem, zBuf);
20713 if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
20716 rc = sqlite3VdbeMemMakeWriteable(pMem);
20721 zIn = (u8*)pMem->z;
20722 zTerm = &zIn[pMem->n&~1];
20729 pMem->enc = desiredEnc;
20740 pMem->n &= ~1;
20741 len = pMem->n * 2 + 1;
20748 len = pMem->n * 2 + 2;
20757 zIn = (u8*)pMem->z;
20758 zTerm = &zIn[pMem->n];
20759 zOut = sqlite3DbMallocRaw(pMem->db, len);
20765 if( pMem->enc==SQLITE_UTF8 ){
20782 pMem->n = (int)(z - zOut);
20786 if( pMem->enc==SQLITE_UTF16LE ){
20799 pMem->n = (int)(z - zOut);
20802 assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
20804 sqlite3VdbeMemRelease(pMem);
20805 pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem);
20806 pMem->enc = desiredEnc;
20807 pMem->flags |= (MEM_Term|MEM_Dyn);
20808 pMem->z = (char*)zOut;
20809 pMem->zMalloc = pMem->z;
20815 sqlite3VdbeMemPrettyPrint(pMem, zBuf);
20824 ** UTF-16 string stored in *pMem. If one is present, it is removed and
20831 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
20835 assert( pMem->n>=0 );
20836 if( pMem->n>1 ){
20837 u8 b1 = *(u8 *)pMem->z;
20838 u8 b2 = *(((u8 *)pMem->z) + 1);
20848 rc = sqlite3VdbeMemMakeWriteable(pMem);
20850 pMem->n -= 2;
20851 memmove(pMem->z, &pMem->z[2], pMem->n);
20852 pMem->z[pMem->n] = '\0';
20853 pMem->z[pMem->n+1] = '\0';
20854 pMem->flags |= MEM_Term;
20855 pMem->enc = bom;
29099 void *pMem;
29101 pMem = mmap(0, szRegion,
29105 if( pMem==MAP_FAILED ){
29110 pMem = sqlite3_malloc(szRegion);
29111 if( pMem==0 ){
29115 memset(pMem, 0, szRegion);
29117 pShmNode->apRegion[pShmNode->nRegion] = pMem;
58376 ** If pMem is an object with a valid string representation, this routine
58380 ** If pMem is not a string object, or the encoding of the string
58388 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
58390 assert( (pMem->flags&MEM_RowSet)==0 );
58393 if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
58396 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58404 rc = sqlite3VdbeMemTranslate(pMem, (u8)desiredEnc);
58406 assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
58407 assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
58413 ** Make sure pMem->z points to a writable allocation of at least
58425 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve){
58427 ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) +
58428 (((pMem->flags&MEM_Dyn)&&pMem->xDel) ? 1 : 0) +
58429 ((pMem->flags&MEM_Ephem) ? 1 : 0) +
58430 ((pMem->flags&MEM_Static) ? 1 : 0)
58432 assert( (pMem->flags&MEM_RowSet)==0 );
58435 if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)<n ){
58436 if( preserve && pMem->z==pMem->zMalloc ){
58437 pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
58440 sqlite3DbFree(pMem->db, pMem->zMalloc);
58441 pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
58445 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){
58446 memcpy(pMem->zMalloc, pMem->z, pMem->n);
58448 if( pMem->flags&MEM_Dyn && pMem->xDel ){
58449 assert( pMem->xDel!=SQLITE_DYNAMIC );
58450 pMem->xDel((void *)(pMem->z));
58453 pMem->z = pMem->zMalloc;
58454 if( pMem->z==0 ){
58455 pMem->flags = MEM_Null;
58457 pMem->flags &= ~(MEM_Ephem|MEM_Static);
58459 pMem->xDel = 0;
58460 return (pMem->z ? SQLITE_OK : SQLITE_NOMEM);
58471 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
58473 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58474 assert( (pMem->flags&MEM_RowSet)==0 );
58475 ExpandBlob(pMem);
58476 f = pMem->flags;
58477 if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){
58478 if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){
58481 pMem->z[pMem->n] = 0;
58482 pMem->z[pMem->n+1] = 0;
58483 pMem->flags |= MEM_Term;
58485 pMem->pScopyFrom = 0;
58497 SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
58498 if( pMem->flags & MEM_Zero ){
58500 assert( pMem->flags&MEM_Blob );
58501 assert( (pMem->flags&MEM_RowSet)==0 );
58502 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58505 nByte = pMem->n + pMem->u.nZero;
58509 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
58513 memset(&pMem->z[pMem->n], 0, pMem->u.nZero);
58514 pMem->n += pMem->u.nZero;
58515 pMem->flags &= ~(MEM_Zero|MEM_Term);
58525 SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
58526 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58527 if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
58530 if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){
58533 pMem->z[pMem->n] = 0;
58534 pMem->z[pMem->n+1] = 0;
58535 pMem->flags |= MEM_Term;
58552 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
58554 int fg = pMem->flags;
58557 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58561 assert( (pMem->flags&MEM_RowSet)==0 );
58562 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58565 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
58576 sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
58579 sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r);
58581 pMem->n = sqlite3Strlen30(pMem->z);
58582 pMem->enc = SQLITE_UTF8;
58583 pMem->flags |= MEM_Str|MEM_Term;
58584 sqlite3VdbeChangeEncoding(pMem, enc);
58589 ** Memory cell pMem contains the context of an aggregate function.
58591 ** result of the aggregate is stored back into pMem.
58596 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
58600 assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
58601 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58604 ctx.s.db = pMem->db;
58605 ctx.pMem = pMem;
58608 assert( 0==(pMem->flags&MEM_Dyn) && !pMem->xDel );
58609 sqlite3DbFree(pMem->db, pMem->zMalloc);
58610 memcpy(pMem, &ctx.s, sizeof(ctx.s));
58695 ** at representing the value that *pMem describes as an integer.
58696 ** If pMem is an integer, then the value is exact. If pMem is
58698 ** If pMem is a string or blob, then we make an attempt to convert
58699 ** it into a integer and return that. If pMem represents an
58702 ** If pMem represents a string value, its encoding might be changed.
58704 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
58706 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58707 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58708 flags = pMem->flags;
58710 return pMem->u.i;
58712 return doubleToInt64(pMem->r);
58715 assert( pMem->z || pMem->n==0 );
58716 testcase( pMem->z==0 );
58717 sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
58725 ** Return the best representation of pMem that we can get into a
58726 ** double. If pMem is already a double or an integer, return its
58730 SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
58731 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58732 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58733 if( pMem->flags & MEM_Real ){
58734 return pMem->r;
58735 }else if( pMem->flags & MEM_Int ){
58736 pMem->u.i;
58737 }else if( pMem->flags & (MEM_Str|MEM_Blob) ){
58740 sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
58752 SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
58753 assert( pMem->flags & MEM_Real );
58754 assert( (pMem->flags & MEM_RowSet)==0 );
58755 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58756 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58758 pMem->u.i = doubleToInt64(pMem->r);
58772 if( pMem->r==(double)pMem->u.i
58773 && pMem->u.i>SMALLEST_INT64
58775 && ALWAYS(pMem->u.i<LARGEST_INT64)
58777 && pMem->u.i<LARGEST_INT64
58780 pMem->flags |= MEM_Int;
58785 ** Convert pMem to type integer. Invalidate any prior representations.
58787 SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
58788 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58789 assert( (pMem->flags & MEM_RowSet)==0 );
58790 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58792 pMem->u.i = sqlite3VdbeIntValue(pMem);
58793 MemSetTypeFlag(pMem, MEM_Int);
58798 ** Convert pMem so that it is of type MEM_Real.
58801 SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
58802 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58803 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58805 pMem->r = sqlite3VdbeRealValue(pMem);
58806 MemSetTypeFlag(pMem, MEM_Real);
58811 ** Convert pMem so that it has types MEM_Real or MEM_Int or both.
58818 SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
58819 if( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ){
58820 assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
58821 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58822 if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
58823 MemSetTypeFlag(pMem, MEM_Int);
58825 pMem->r = sqlite3VdbeRealValue(pMem);
58826 MemSetTypeFlag(pMem, MEM_Real);
58827 sqlite3VdbeIntegerAffinity(pMem);
58830 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0 );
58831 pMem->flags &= ~(MEM_Str|MEM_Blob);
58836 ** Delete any previous value and set the value stored in *pMem to NULL.
58838 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
58839 if( pMem->flags & MEM_Frame ){
58840 VdbeFrame *pFrame = pMem->u.pFrame;
58844 if( pMem->flags & MEM_RowSet ){
58845 sqlite3RowSetClear(pMem->u.pRowSet);
58847 MemSetTypeFlag(pMem, MEM_Null);
58848 pMem->type = SQLITE_NULL;
58855 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
58856 sqlite3VdbeMemRelease(pMem);
58857 pMem->flags = MEM_Blob|MEM_Zero;
58858 pMem->type = SQLITE_BLOB;
58859 pMem->n = 0;
58861 pMem->u.nZero = n;
58862 pMem->enc = SQLITE_UTF8;
58865 sqlite3VdbeMemGrow(pMem, n, 0);
58866 if( pMem->z ){
58867 pMem->n = n;
58868 memset(pMem->z, 0, n);
58874 ** Delete any previous value and set the value stored in *pMem to val,
58877 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
58878 sqlite3VdbeMemRelease(pMem);
58879 pMem->u.i = val;
58880 pMem->flags = MEM_Int;
58881 pMem->type = SQLITE_INTEGER;
58886 ** Delete any previous value and set the value stored in *pMem to val,
58889 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
58891 sqlite3VdbeMemSetNull(pMem);
58893 sqlite3VdbeMemRelease(pMem);
58894 pMem->r = val;
58895 pMem->flags = MEM_Real;
58896 pMem->type = SQLITE_FLOAT;
58902 ** Delete any previous value and set the value of pMem to be an
58905 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem *pMem){
58906 sqlite3 *db = pMem->db;
58908 assert( (pMem->flags & MEM_RowSet)==0 );
58909 sqlite3VdbeMemRelease(pMem);
58910 pMem->zMalloc = sqlite3DbMallocRaw(db, 64);
58912 pMem->flags = MEM_Null;
58914 assert( pMem->zMalloc );
58915 pMem->u.pRowSet = sqlite3RowSetInit(db, pMem->zMalloc,
58916 sqlite3DbMallocSize(db, pMem->zMalloc));
58917 assert( pMem->u.pRowSet!=0 );
58918 pMem->flags = MEM_RowSet;
58947 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
58951 if( pX->pScopyFrom==pMem ){
58956 pMem->pScopyFrom = 0;
59035 ** is required to store the string, then value of pMem is unchanged. In
59039 Mem *pMem, /* Memory cell to set to string value */
59045 int nByte = n; /* New value for pMem->n */
59047 u16 flags = 0; /* New value for pMem->flags */
59049 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
59050 assert( (pMem->flags & MEM_RowSet)==0 );
59052 /* If z is a NULL pointer, set pMem to contain an SQL NULL. */
59054 sqlite3VdbeMemSetNull(pMem);
59058 if( pMem->db ){
59059 iLimit = pMem->db->aLimit[SQLITE_LIMIT_LENGTH];
59086 if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
59089 memcpy(pMem->z, z, nAlloc);
59091 sqlite3VdbeMemRelease(pMem);
59092 pMem->zMalloc = pMem->z = (char *)z;
59093 pMem->xDel = 0;
59095 sqlite3VdbeMemRelease(pMem);
59096 pMem->z = (char *)z;
59097 pMem->xDel = xDel;
59101 pMem->n = nByte;
59102 pMem->flags = flags;
59103 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
59104 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
59107 if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
59242 ** into the pMem element.
59244 ** The pMem structure is assumed to be uninitialized. Any prior content
59248 ** to read from the disk) then the pMem is left in an inconsistent state.
59255 Mem *pMem /* OUT: Return data in this Mem structure. */
59265 assert( (pMem->flags & MEM_RowSet)==0 );
59273 if( offset+amt<=available && (pMem->flags&MEM_Dyn)==0 ){
59274 sqlite3VdbeMemRelease(pMem);
59275 pMem->z = &zData[offset];
59276 pMem
59277 }else if( SQLITE_OK==(rc = sqlite3VdbeMemGrow(pMem, amt+2, 0)) ){
59278 pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
59279 pMem->enc = 0;
59280 pMem->type = SQLITE_BLOB;
59282 rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
59284 rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
59286 pMem->z[amt] = 0;
59287 pMem->z[amt+1] = 0;
59289 sqlite3VdbeMemRelease(pMem);
59292 pMem->n = amt;
60423 Mem *pMem = pOp->p4.pMem;
60424 if( pMem->flags & MEM_Str ){
60425 zP4 = pMem->z;
60426 }else if( pMem->flags & MEM_Int ){
60427 sqlite3_snprintf(nTemp, zTemp, "%lld", pMem->u.i);
60428 }else if( pMem->flags & MEM_Real ){
60429 sqlite3_snprintf(nTemp, zTemp, "%.16g", pMem->r);
60430 }else if( pMem->flags & MEM_Null ){
60433 assert( pMem->flags & MEM_Blob );
60654 Mem *pMem = &p->aMem[1]; /* First Mem of result set */
60664 releaseMemArray(pMem, 8);
60728 pMem->flags = MEM_Int;
60729 pMem->type = SQLITE_INTEGER;
60730 pMem->u.i = i; /* Program counter */
60731 pMem++;
60733 pMem->flags = MEM_Static|MEM_Str|MEM_Term;
60734 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
60735 assert( pMem->z!=0 );
60736 pMem->n = sqlite3Strlen30(pMem->z);
60737 pMem->type = SQLITE_TEXT;
60738 pMem->enc = SQLITE_UTF8;
60739 pMem++;
60761 pMem->flags = MEM_Int;
60762 pMem->u.i = pOp->p1; /* P1 */
60763 pMem->type = SQLITE_INTEGER;
60764 pMem++;
60766 pMem->flags = MEM_Int;
60767 pMem->u.i = pOp->p2; /* P2 */
60768 pMem->type = SQLITE_INTEGER;
60769 pMem++;
60771 pMem->flags = MEM_Int;
60772 pMem->u.i = pOp->p3; /* P3 */
60773 pMem->type = SQLITE_INTEGER;
60774 pMem++;
60776 if( sqlite3VdbeMemGrow(pMem, 32, 0) ){ /* P4 */
60780 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
60781 z = displayP4(pOp, pMem->z, 32);
60782 if( z!=pMem->z ){
60783 sqlite3VdbeMemSetStr(pMem, z, -1, SQLITE_UTF8, 0);
60785 assert( pMem->z!=0 );
60786 pMem->n = sqlite3Strlen30(pMem->z);
60787 pMem->enc = SQLITE_UTF8;
60789 pMem->type = SQLITE_TEXT;
60790 pMem++;
60793 if( sqlite3VdbeMemGrow(pMem, 4, 0) ){
60797 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
60798 pMem->n = 2;
60799 sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
60800 pMem->type = SQLITE_TEXT;
60801 pMem->enc = SQLITE_UTF8;
60802 pMem++;
60806 pMem->flags = MEM_Str|MEM_Term;
60807 pMem->z = pOp->zComment;
60808 pMem->n = sqlite3Strlen30(pMem->z);
60809 pMem->enc = SQLITE_UTF8;
60810 pMem->type = SQLITE_TEXT;
60814 pMem->flags = MEM_Null; /* Comment */
60815 pMem->type = SQLITE_NULL;
62081 ** Return the serial-type for the value stored in pMem.
62083 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
62084 int flags = pMem->flags;
62093 i64 i = pMem->u.i;
62115 assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
62116 n = pMem->n;
62118 n += pMem->u.nZero;
62190 ** Write the serialized data blob for the value stored in pMem into
62207 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
62208 u32 serial_type = sqlite3VdbeSerialType(pMem, file_format);
62216 assert( sizeof(v)==sizeof(pMem->r) );
62217 memcpy(&v, &pMem->r, sizeof(v));
62220 v = pMem->u.i;
62233 assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0)
62235 assert( pMem->n<=nBuf );
62236 len = pMem->n;
62237 memcpy(buf, pMem->z, len);
62238 if( pMem->flags & MEM_Zero ){
62239 len += pMem->u.nZero;
62244 memset(&buf[pMem->n], 0, len-pMem->n);
62255 ** and store the result in pMem. Return the number of bytes read.
62260 Mem *pMem /* Memory cell to write value into */
62266 pMem->flags = MEM_Null;
62270 pMem->u.i = (signed char)buf[0];
62271 pMem->flags = MEM_Int;
62275 pMem->u.i = (((signed char)buf[0])<<8) | buf[1];
62276 pMem->flags = MEM_Int;
62280 pMem->u.i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
62281 pMem->flags = MEM_Int;
62285 pMem->u.i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
62286 pMem->flags = MEM_Int;
62293 pMem->u.i = *(i64*)&x;
62294 pMem->flags = MEM_Int;
62318 pMem->u.i = *(i64*)&x;
62319 pMem->flags = MEM_Int;
62321 assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
62323 memcpy(&pMem->r, &x, sizeof(x));
62324 pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
62330 pMem->u.i = serial_type-8;
62331 pMem->flags = MEM_Int;
62336 pMem->z = (char *)buf;
62337 pMem->n = len;
62338 pMem->xDel = 0;
62340 pMem->flags = MEM_Str | MEM_Ephem;
62342 pMem->flags = MEM_Blob | MEM_Ephem;
62411 Mem *pMem = p->aMem;
62414 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
62422 pMem->enc = pKeyInfo->enc;
62423 pMem->db = pKeyInfo->db;
62424 /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */
62425 pMem->zMalloc = 0;
62426 d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
62427 pMem++;
62720 Mem *pMem = &v->aVar[iVar-1];
62721 if( 0==(pMem->flags & MEM_Null) ){
62724 sqlite3VdbeMemCopy((Mem *)pRet, pMem);
63316 Mem *pMem;
63319 pMem = p->pMem;
63321 if( (pMem->flags & MEM_Agg)==0 ){
63323 sqlite3VdbeMemReleaseExternal(pMem);
63324 pMem->flags = MEM_Null;
63325 pMem->z = 0;
63327 sqlite3VdbeMemGrow(pMem, nByte, 0);
63328 pMem->flags = MEM_Agg;
63329 pMem->u.pDef = p->pFunc;
63330 if( pMem->z ){
63331 memset(pMem->z, 0, nByte);
63335 return (void*)pMem->z;
63408 assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
63409 return p->pMem->n;
64496 ** Argument pMem points at a register that will be passed to a
64498 ** This routine sets the pMem->type variable used by the sqlite3_value_*()
64501 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
64502 int flags = pMem->flags;
64504 pMem->type = SQLITE_NULL;
64507 pMem->type = SQLITE_INTEGER;
64510 pMem->type = SQLITE_FLOAT;
64513 pMem->type = SQLITE_TEXT;
64515 pMem->type = SQLITE_BLOB;
64548 Mem *pMem = &p->aMem[p->nMem-iCur];
64562 if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
64563 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
64568 pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))];
64572 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*nField*sizeof(u32)];
64651 Mem *pMem = (Mem*)pVal;
64652 if( pMem->type==SQLITE_TEXT ){
64653 applyNumericAffinity(pMem);
64654 sqlite3VdbeMemStoreType(pMem);
64656 return pMem->type;
64673 ** Write a nice string representation of the contents of cell pMem
64676 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
64678 int f = pMem->flags;
64700 sqlite3_snprintf(100, zCsr, "%d[", pMem->n);
64702 for(i=0; i<16 && i<pMem->n; i++){
64703 sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));
64706 for(i=0; i<16 && i<pMem->n; i++){
64707 char z = pMem->z[i];
64712 sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
64715 sqlite3_snprintf(100, zCsr,"+%dz",pMem->u.nZero);
64735 sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n);
64738 for(j=0; j<15 && j<pMem->n; j++){
64739 u8 c = pMem->z[j];
64747 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);
65021 Mem *pMem;
65210 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
65325 Mem *pMem; /* Used to iterate through memory cells */
65342 Mem *pMem;
65348 Mem *pMem;
65353 Mem *pMem; /* Write results here */
65962 Mem *pMem;
66006 u.ae.pMem = p->pResultSet = &aMem[pOp->p1];
66008 assert( memIsValid(&u.ae.pMem[u.ae.i]) );
66009 Deephemeralize(&u.ae.pMem[u.ae.i]);
66010 assert( (u.ae.pMem[u.ae.i].flags & MEM_Ephem)==0
66011 || (u.ae.pMem[u.ae.i].flags & (MEM_Str|MEM_Blob))==0 );
66012 sqlite3VdbeMemNulTerminate(&u.ae.pMem[u.ae.i]);
66013 sqlite3VdbeMemStoreType(&u.ae.pMem[u.ae.i]);
66014 REGISTER_TRACE(pOp->p1+u.ae.i, &u.ae.pMem[u.ae.i]);
67267 sqlite3VdbeMemShallowCopy(u.an.pDest, pOp->p4.pMem, MEM_Static);
68708 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
68774 u.bg.pMem = &u.bg.pFrame->aMem[pOp->p3];
68778 u.bg.pMem = &aMem[pOp->p3];
68779 memAboutToChange(p, u.bg.pMem);
68781 assert( memIsValid(u.bg.pMem) );
68783 REGISTER_TRACE(pOp->p3, u.bg.pMem);
68784 sqlite3VdbeMemIntegerify(u.bg.pMem);
68785 assert( (u.bg.pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */
68786 if( u.bg.pMem->u.i==MAX_ROWID || u.bg.pC->useRandomRowid ){
68790 if( u.bg.v<u.bg.pMem->u.i+1 ){
68791 u.bg.v = u.bg.pMem->u.i + 1;
68793 u.bg.pMem->u.i = u.bg.v;
70038 Mem *pMem; /* Used to iterate through memory cells */
70110 for(u.cc.pMem=VdbeFrameMem(u.cc.pFrame); u.cc.pMem!=u.cc.pEnd; u.cc.pMem++){
70111 u.cc.pMem->flags = MEM_Invalid;
70112 u.cc.pMem->db = db;
70301 Mem *pMem;
70320 u.cf.ctx.pMem = u.cf.pMem = &aMem[pOp->p3];
70321 u.cf.pMem->n++;
70366 Mem *pMem;
70369 u.cg.pMem = &aMem[pOp->p1];
70370 assert( (u.cg.pMem->flags & ~(MEM_Null|MEM_Agg))==0 );
70371 rc = sqlite3VdbeMemFinalize(u.cg.pMem, pOp->p4.pFunc);
70373 sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(u.cg.pMem));
70375 sqlite3VdbeChangeEncoding(u.cg.pMem, encoding);
70376 UPDATE_MAX_BLOBSIZE(u.cg.pMem);
70377 if( sqlite3VdbeMemTooBig(u.cg.pMem) ){
70399 Mem *pMem; /* Write results here */
70413 for(u.ch.i=0, u.ch.pMem = &aMem[pOp->p3]; u.ch.i<3; u.ch.i++, u.ch.pMem++){
70414 sqlite3VdbeMemSetInt64(u.ch.pMem, (i64)u.ch.aRes[u.ch.i]);