Home | History | Annotate | Download | only in dist

Lines Matching defs: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;
29127 void *pMem;
29129 pMem = mmap(0, szRegion,
29133 if( pMem==MAP_FAILED ){
29138 pMem = sqlite3_malloc(szRegion);
29139 if( pMem==0 ){
29143 memset(pMem, 0, szRegion);
29145 pShmNode->apRegion[pShmNode->nRegion] = pMem;
58404 ** If pMem is an object with a valid string representation, this routine
58408 ** If pMem is not a string object, or the encoding of the string
58416 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
58418 assert( (pMem->flags&MEM_RowSet)==0 );
58421 if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
58424 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58432 rc = sqlite3VdbeMemTranslate(pMem, (u8)desiredEnc);
58434 assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
58435 assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
58441 ** Make sure pMem->z points to a writable allocation of at least
58453 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve){
58455 ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) +
58456 (((pMem->flags&MEM_Dyn)&&pMem->xDel) ? 1 : 0) +
58457 ((pMem->flags&MEM_Ephem) ? 1 : 0) +
58458 ((pMem->flags&MEM_Static) ? 1 : 0)
58460 assert( (pMem->flags&MEM_RowSet)==0 );
58463 if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)<n ){
58464 if( preserve && pMem->z==pMem->zMalloc ){
58465 pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
58468 sqlite3DbFree(pMem->db, pMem->zMalloc);
58469 pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
58473 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){
58474 memcpy(pMem->zMalloc, pMem->z, pMem->n);
58476 if( pMem->flags&MEM_Dyn && pMem->xDel ){
58477 assert( pMem->xDel!=SQLITE_DYNAMIC );
58478 pMem->xDel((void *)(pMem->z));
58481 pMem->z = pMem->zMalloc;
58482 if( pMem->z==0 ){
58483 pMem->flags = MEM_Null;
58485 pMem->flags &= ~(MEM_Ephem|MEM_Static);
58487 pMem->xDel = 0;
58488 return (pMem->z ? SQLITE_OK : SQLITE_NOMEM);
58499 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
58501 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58502 assert( (pMem->flags&MEM_RowSet)==0 );
58503 ExpandBlob(pMem);
58504 f = pMem->flags;
58505 if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){
58506 if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){
58509 pMem->z[pMem->n] = 0;
58510 pMem->z[pMem->n+1] = 0;
58511 pMem->flags |= MEM_Term;
58513 pMem->pScopyFrom = 0;
58525 SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
58526 if( pMem->flags & MEM_Zero ){
58528 assert( pMem->flags&MEM_Blob );
58529 assert( (pMem->flags&MEM_RowSet)==0 );
58530 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58533 nByte = pMem->n + pMem->u.nZero;
58537 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
58541 memset(&pMem->z[pMem->n], 0, pMem->u.nZero);
58542 pMem->n += pMem->u.nZero;
58543 pMem->flags &= ~(MEM_Zero|MEM_Term);
58553 SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
58554 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58555 if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
58558 if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){
58561 pMem->z[pMem->n] = 0;
58562 pMem->z[pMem->n+1] = 0;
58563 pMem->flags |= MEM_Term;
58580 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
58582 int fg = pMem->flags;
58585 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58589 assert( (pMem->flags&MEM_RowSet)==0 );
58590 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58593 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
58604 sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
58607 sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r);
58609 pMem->n = sqlite3Strlen30(pMem->z);
58610 pMem->enc = SQLITE_UTF8;
58611 pMem->flags |= MEM_Str|MEM_Term;
58612 sqlite3VdbeChangeEncoding(pMem, enc);
58617 ** Memory cell pMem contains the context of an aggregate function.
58619 ** result of the aggregate is stored back into pMem.
58624 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
58628 assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
58629 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58632 ctx.s.db = pMem->db;
58633 ctx.pMem = pMem;
58636 assert( 0==(pMem->flags&MEM_Dyn) && !pMem->xDel );
58637 sqlite3DbFree(pMem->db, pMem->zMalloc);
58638 memcpy(pMem, &ctx.s, sizeof(ctx.s));
58723 ** at representing the value that *pMem describes as an integer.
58724 ** If pMem is an integer, then the value is exact. If pMem is
58726 ** If pMem is a string or blob, then we make an attempt to convert
58727 ** it into a integer and return that. If pMem represents an
58730 ** If pMem represents a string value, its encoding might be changed.
58732 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
58734 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58735 pMem) );
58736 flags = pMem->flags;
58738 return pMem->u.i;
58740 return doubleToInt64(pMem->r);
58743 assert( pMem->z || pMem->n==0 );
58744 testcase( pMem->z==0 );
58745 sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
58753 ** Return the best representation of pMem that we can get into a
58754 ** double. If pMem is already a double or an integer, return its
58758 SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
58759 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58760 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58761 if( pMem->flags & MEM_Real ){
58762 return pMem->r;
58763 }else if( pMem->flags & MEM_Int ){
58764 return (double)pMem->u.i;
58765 }else if( pMem->flags & (MEM_Str|MEM_Blob) ){
58768 sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
58780 SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
58781 assert( pMem->flags & MEM_Real );
58782 assert( (pMem->flags & MEM_RowSet)==0 );
58783 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58784 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58786 pMem->u.i = doubleToInt64(pMem->r);
58800 if( pMem->r==(double)pMem->u.i
58801 && pMem->u.i>SMALLEST_INT64
58803 && ALWAYS(pMem->u.i<LARGEST_INT64)
58805 && pMem->u.i<LARGEST_INT64
58808 pMem->flags |= MEM_Int;
58813 ** Convert pMem to type integer. Invalidate any prior representations.
58815 SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
58816 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58817 assert( (pMem->flags & MEM_RowSet)==0 );
58818 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58820 pMem->u.i = sqlite3VdbeIntValue(pMem);
58821 MemSetTypeFlag(pMem, MEM_Int);
58826 ** Convert pMem so that it is of type MEM_Real.
58829 SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
58830 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58831 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
58833 pMem->r = sqlite3VdbeRealValue(pMem);
58834 MemSetTypeFlag(pMem, MEM_Real);
58839 ** Convert pMem so that it has types MEM_Real or MEM_Int or both.
58846 SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
58847 if( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ){
58848 assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
58849 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
58850 if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
58851 MemSetTypeFlag(pMem, MEM_Int);
58853 pMem->r = sqlite3VdbeRealValue(pMem);
58854 MemSetTypeFlag(pMem, MEM_Real);
58855 sqlite3VdbeIntegerAffinity(pMem);
58858 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0 );
58859 pMem->flags &= ~(MEM_Str|MEM_Blob);
58864 ** Delete any previous value and set the value stored in *pMem to NULL.
58866 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
58867 if( pMem->flags & MEM_Frame ){
58868 VdbeFrame *pFrame = pMem->u.pFrame;
58872 if( pMem->flags & MEM_RowSet ){
58873 sqlite3RowSetClear(pMem->u.pRowSet);
58875 MemSetTypeFlag(pMem, MEM_Null);
58876 pMem->type = SQLITE_NULL;
58883 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
58884 sqlite3VdbeMemRelease(pMem);
58885 pMem->flags = MEM_Blob|MEM_Zero;
58886 pMem->type = SQLITE_BLOB;
58887 pMem->n = 0;
58889 pMem->u.nZero = n;
58890 pMem->enc = SQLITE_UTF8;
58893 sqlite3VdbeMemGrow(pMem, n, 0);
58894 if( pMem->z ){
58895 pMem->n = n;
58896 memset(pMem->z, 0, n);
58902 ** Delete any previous value and set the value stored in *pMem to val,
58905 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
58906 sqlite3VdbeMemRelease(pMem);
58907 pMem->u.i = val;
58908 pMem->flags = MEM_Int;
58909 pMem->type = SQLITE_INTEGER;
58914 ** Delete any previous value and set the value stored in *pMem to val,
58917 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
58919 sqlite3VdbeMemSetNull(pMem);
58921 sqlite3VdbeMemRelease(pMem);
58922 pMem->r = val;
58923 pMem->flags = MEM_Real;
58924 pMem->type = SQLITE_FLOAT;
58930 ** Delete any previous value and set the value of pMem to be an
58933 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem *pMem){
58934 sqlite3 *db = pMem->db;
58936 assert( (pMem->flags & MEM_RowSet)==0 );
58937 sqlite3VdbeMemRelease(pMem);
58938 pMem->zMalloc = sqlite3DbMallocRaw(db, 64);
58940 pMem->flags = MEM_Null;
58942 assert( pMem->zMalloc );
58943 pMem->u.pRowSet = sqlite3RowSetInit(db, pMem->zMalloc,
58944 sqlite3DbMallocSize(db, pMem->zMalloc));
58945 assert( pMem->u.pRowSet!=0 );
58946 pMem->flags = MEM_RowSet;
58975 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
58979 if( pX->pScopyFrom==pMem ){
58984 pMem->pScopyFrom = 0;
59063 ** is required to store the string, then value of pMem is unchanged. In
59067 Mem *pMem, /* Memory cell to set to string value */
59073 int nByte = n; /* New value for pMem->n */
59075 u16 flags = 0; /* New value for pMem->flags */
59077 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
59078 assert( (pMem->flags & MEM_RowSet)==0 );
59080 /* If z is a NULL pointer, set pMem to contain an SQL NULL. */
59082 sqlite3VdbeMemSetNull(pMem);
59086 if( pMem->db ){
59087 iLimit = pMem->db->aLimit[SQLITE_LIMIT_LENGTH];
59114 if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
59117 memcpy(pMem->z, z, nAlloc);
59119 sqlite3VdbeMemRelease(pMem);
59120 pMem->zMalloc = pMem->z = (char *)z;
59121 pMem->xDel = 0;
59123 sqlite3VdbeMemRelease(pMem);
59124 pMem->z = (char *)z;
59125 pMem->xDel = xDel;
59129 pMem->n = nByte;
59130 pMem->flags = flags;
59131 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
59132 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
59135 if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
59270 ** into the pMem element.
59272 ** The pMem structure is assumed to be uninitialized. Any prior content
59276 ** to read from the disk) then the pMem is left in an inconsistent state.
59283 Mem *pMem /* OUT: Return data in this Mem structure. */
59293 assert( (pMem->flags & MEM_RowSet)==0 );
59301 if( offset+amt<=available && (pMem->flags&MEM_Dyn)==0 ){
59302 sqlite3VdbeMemRelease(pMem);
59303 pMem->z = &zData[offset];
59304 pMem->flags = MEM_Blob|MEM_Ephem;
59305 }else if( SQLITE_OK==(rc = sqlite3VdbeMemGrow(pMem, amt+2, 0)) ){
59306 pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
59307 pMem->enc = 0;
59308 pMem->type = SQLITE_BLOB;
59310 rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
59312 rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
59314 pMem->z[amt] = 0;
59315 pMem->z[amt+1] = 0;
59317 sqlite3VdbeMemRelease(pMem);
59320 pMem->n = amt;
60451 Mem *pMem = pOp->p4.pMem;
60452 if( pMem->flags & MEM_Str ){
60453 zP4 = pMem->z;
60454 }else if( pMem->flags & MEM_Int ){
60455 sqlite3_snprintf(nTemp, zTemp, "%lld", pMem->u.i);
60456 }else if( pMem->flags & MEM_Real ){
60457 sqlite3_snprintf(nTemp, zTemp, "%.16g", pMem->r);
60458 }else if( pMem->flags & MEM_Null ){
60461 assert( pMem->flags & MEM_Blob );
60682 Mem *pMem = &p->aMem[1]; /* First Mem of result set */
60692 releaseMemArray(pMem, 8);
60756 pMem->flags = MEM_Int;
60757 pMem->type = SQLITE_INTEGER;
60758 pMem->u.i = i; /* Program counter */
60759 pMem++;
60761 pMem->flags = MEM_Static|MEM_Str|MEM_Term;
60762 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
60763 assert( pMem->z!=0 );
60764 pMem->n = sqlite3Strlen30(pMem->z);
60765 pMem->type = SQLITE_TEXT;
60766 pMem->enc = SQLITE_UTF8;
60767 pMem++;
60789 pMem->flags = MEM_Int;
60790 pMem->u.i = pOp->p1; /* P1 */
60791 pMem->type = SQLITE_INTEGER;
60792 pMem++;
60794 pMem->flags = MEM_Int;
60795 pMem->u.i = pOp->p2; /* P2 */
60796 pMem->type = SQLITE_INTEGER;
60797 pMem++;
60799 pMem->flags = MEM_Int;
60800 pMem->u.i = pOp->p3; /* P3 */
60801 pMem->type = SQLITE_INTEGER;
60802 pMem++;
60804 if( sqlite3VdbeMemGrow(pMem, 32, 0) ){ /* P4 */
60808 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
60809 z = displayP4(pOp, pMem->z, 32);
60810 if( z!=pMem->z ){
60811 sqlite3VdbeMemSetStr(pMem, z, -1, SQLITE_UTF8, 0);
60813 assert( pMem->z!=0 );
60814 pMem->n = sqlite3Strlen30(pMem->z);
60815 pMem->enc = SQLITE_UTF8;
60817 pMem->type = SQLITE_TEXT;
60818 pMem++;
60821 if( sqlite3VdbeMemGrow(pMem, 4, 0) ){
60825 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
60826 pMem->n = 2;
60827 sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
60828 pMem->type = SQLITE_TEXT;
60829 pMem->enc = SQLITE_UTF8;
60830 pMem++;
60834 pMem->flags = MEM_Str|MEM_Term;
60835 pMem->z = pOp->zComment;
60836 pMem->n = sqlite3Strlen30(pMem->z);
60837 pMem->enc = SQLITE_UTF8;
60838 pMem->type = SQLITE_TEXT;
60842 pMem->flags = MEM_Null; /* Comment */
60843 pMem->type = SQLITE_NULL;
62109 ** Return the serial-type for the value stored in pMem.
62111 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
62112 int flags = pMem->flags;
62121 i64 i = pMem->u.i;
62143 assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
62144 n = pMem->n;
62146 n += pMem->u.nZero;
62218 ** Write the serialized data blob for the value stored in pMem into
62235 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
62236 u32 serial_type = sqlite3VdbeSerialType(pMem, file_format);
62244 assert( sizeof(v)==sizeof(pMem->r) );
62245 memcpy(&v, &pMem->r, sizeof(v));
62248 v = pMem->u.i;
62261 assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0)
62263 assert( pMem->n<=nBuf );
62264 len = pMem->n;
62265 memcpy(buf, pMem->z, len);
62266 if( pMem->flags & MEM_Zero ){
62267 len += pMem->u.nZero;
62272 memset(&buf[pMem->n], 0, len-pMem->n);
62283 ** and store the result in pMem. Return the number of bytes read.
62288 Mem *pMem /* Memory cell to write value into */
62294 pMem->flags = MEM_Null;
62298 pMem->u.i = (signed char)buf[0];
62299 pMem->flags = MEM_Int;
62303 pMem->u.i = (((signed char)buf[0])<<8) | buf[1];
62304 pMem->flags = MEM_Int;
62308 pMem->u.i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
62309 pMem->flags = MEM_Int;
62313 pMem->u.i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
62314 pMem->flags = MEM_Int;
62321 pMem->u.i = *(i64*)&x;
62322 pMem->flags = MEM_Int;
62346 pMem->u.i = *(i64*)&x;
62347 pMem->flags = MEM_Int;
62349 assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
62351 memcpy(&pMem->r, &x, sizeof(x));
62352 pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
62358 pMem->u.i = serial_type-8;
62359 pMem->flags = MEM_Int;
62364 pMem->z = (char *)buf;
62365 pMem->n = len;
62366 pMem->xDel = 0;
62368 pMem->flags = MEM_Str | MEM_Ephem;
62370 pMem->flags = MEM_Blob | MEM_Ephem;
62439 Mem *pMem = p->aMem;
62442 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
62450 pMem->enc = pKeyInfo->enc;
62451 pMem->db = pKeyInfo->db;
62452 /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */
62453 pMem->zMalloc = 0;
62454 d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
62455 pMem++;
62748 Mem *pMem = &v->aVar[iVar-1];
62749 if( 0==(pMem->flags & MEM_Null) ){
62752 sqlite3VdbeMemCopy((Mem *)pRet, pMem);
63344 Mem *pMem;
63347 pMem = p->pMem;
63349 if( (pMem->flags & MEM_Agg)==0 ){
63351 sqlite3VdbeMemReleaseExternal(pMem);
63352 pMem->flags = MEM_Null;
63353 pMem->z = 0;
63355 sqlite3VdbeMemGrow(pMem, nByte, 0);
63356 pMem->flags = MEM_Agg;
63357 pMem->u.pDef = p->pFunc;
63358 if( pMem->z ){
63359 memset(pMem->z, 0, nByte);
63363 return (void*)pMem->z;
63436 assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
63437 return p->pMem->n;
64524 ** Argument pMem points at a register that will be passed to a
64526 ** This routine sets the pMem->type variable used by the sqlite3_value_*()
64529 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
64530 int flags = pMem->flags;
64532 pMem->type = SQLITE_NULL;
64535 pMem->type = SQLITE_INTEGER;
64538 pMem->type = SQLITE_FLOAT;
64541 pMem->type = SQLITE_TEXT;
64543 pMem->type = SQLITE_BLOB;
64576 Mem *pMem = &p->aMem[p->nMem-iCur];
64590 if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
64591 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
64596 pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))];
64600 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*nField*sizeof(u32)];
64679 Mem *pMem = (Mem*)pVal;
64680 if( pMem->type==SQLITE_TEXT ){
64681 applyNumericAffinity(pMem);
64682 sqlite3VdbeMemStoreType(pMem);
64684 return pMem->type;
64701 ** Write a nice string representation of the contents of cell pMem
64704 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
64706 int f = pMem->flags;
64728 sqlite3_snprintf(100, zCsr, "%d[", pMem->n);
64730 for(i=0; i<16 && i<pMem->n; i++){
64731 sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));
64734 for(i=0; i<16 && i<pMem->n; i++){
64735 char z = pMem->z[i];
64740 sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
64743 sqlite3_snprintf(100, zCsr,"+%dz",pMem->u.nZero);
64763 sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n);
64766 for(j=0; j<15 && j<pMem->n; j++){
64767 u8 c = pMem->z[j];
64775 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);
65049 Mem *pMem;
65238 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
65353 Mem *pMem; /* Used to iterate through memory cells */
65370 Mem *pMem;
65376 Mem *pMem;
65381 Mem *pMem; /* Write results here */
65990 Mem *pMem;
66034 u.ae.pMem = p->pResultSet = &aMem[pOp->p1];
66036 assert( memIsValid(&u.ae.pMem[u.ae.i]) );
66037 Deephemeralize(&u.ae.pMem[u.ae.i]);
66038 assert( (u.ae.pMem[u.ae.i].flags & MEM_Ephem)==0
66039 || (u.ae.pMem[u.ae.i].flags & (MEM_Str|MEM_Blob))==0 );
66040 sqlite3VdbeMemNulTerminate(&u.ae.pMem[u.ae.i]);
66041 sqlite3VdbeMemStoreType(&u.ae.pMem[u.ae.i]);
66042 REGISTER_TRACE(pOp->p1+u.ae.i, &u.ae.pMem[u.ae.i]);
67295 sqlite3VdbeMemShallowCopy(u.an.pDest, pOp->p4.pMem, MEM_Static);
68736 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
68802 u.bg.pMem = &u.bg.pFrame->aMem[pOp->p3];
68806 u.bg.pMem = &aMem[pOp->p3];
68807 memAboutToChange(p, u.bg.pMem);
68809 assert( memIsValid(u.bg.pMem) );
68811 REGISTER_TRACE(pOp->p3, u.bg.pMem);
68812 sqlite3VdbeMemIntegerify(u.bg.pMem);
68813 assert( (u.bg.pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */
68814 if( u.bg.pMem->u.i==MAX_ROWID || u.bg.pC->useRandomRowid ){
68818 if( u.bg.v<u.bg.pMem->u.i+1 ){
68819 u.bg.v = u.bg.pMem->u.i + 1;
68821 u.bg.pMem->u.i = u.bg.v;
70066 Mem *pMem; /* Used to iterate through memory cells */
70138 for(u.cc.pMem=VdbeFrameMem(u.cc.pFrame); u.cc.pMem!=u.cc.pEnd; u.cc.pMem++){
70139 u.cc.pMem->flags = MEM_Invalid;
70140 u.cc.pMem->db = db;
70329 Mem *pMem;
70348 u.cf.ctx.pMem = u.cf.pMem = &aMem[pOp->p3];
70349 u.cf.pMem->n++;
70394 Mem *pMem;
70397 u.cg.pMem = &aMem[pOp->p1];
70398 assert( (u.cg.pMem->flags & ~(MEM_Null|MEM_Agg))==0 );
70399 rc = sqlite3VdbeMemFinalize(u.cg.pMem, pOp->p4.pFunc);
70401 sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(u.cg.pMem));
70403 sqlite3VdbeChangeEncoding(u.cg.pMem, encoding);
70404 UPDATE_MAX_BLOBSIZE(u.cg.pMem);
70405 if( sqlite3VdbeMemTooBig(u.cg.pMem) ){
70427 Mem *pMem; /* Write results here */
70441 for(u.ch.i=0, u.ch.pMem = &aMem[pOp->p3]; u.ch.i<3; u.ch.i++, u.ch.pMem++){
70442 sqlite3VdbeMemSetInt64(u.ch.pMem, (i64)u.ch.aRes[u.ch.i]);