• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/sqlite/

Lines Matching defs:pMem

7419     Mem *pMem;             /* Used when p4type is P4_MEM */
11866 Mem *pMem; /* Memory cell used to store aggregate context */
12012 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
12016 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem);
12033 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
12035 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
19199 ** This routine transforms the internal text encoding used by pMem to
19201 ** encoding, or if *pMem does not contain a string value.
19203 SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
19211 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
19212 assert( pMem->flags&MEM_Str );
19213 assert( pMem->enc!=desiredEnc );
19214 assert( pMem->enc!=0 );
19215 assert( pMem->n>=0 );
19220 sqlite3VdbeMemPrettyPrint(pMem, zBuf);
19229 if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
19232 rc = sqlite3VdbeMemMakeWriteable(pMem);
19237 zIn = (u8*)pMem->z;
19238 zTerm = &zIn[pMem->n&~1];
19245 pMem->enc = desiredEnc;
19256 pMem->n &= ~1;
19257 len = pMem->n * 2 + 1;
19264 len = pMem->n * 2 + 2;
19273 zIn = (u8*)pMem->z;
19274 zTerm = &zIn[pMem->n];
19275 zOut = sqlite3DbMallocRaw(pMem->db, len);
19281 if( pMem->enc==SQLITE_UTF8 ){
19298 pMem->n = (int)(z - zOut);
19302 if( pMem->enc==SQLITE_UTF16LE ){
19315 pMem->n = (int)(z - zOut);
19318 assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
19320 sqlite3VdbeMemRelease(pMem);
19321 pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem);
19322 pMem->enc = desiredEnc;
19323 pMem->flags |= (MEM_Term|MEM_Dyn);
19324 pMem->z = (char*)zOut;
19325 pMem->zMalloc = pMem->z;
19331 sqlite3VdbeMemPrettyPrint(pMem, zBuf);
19340 ** UTF-16 string stored in *pMem. If one is present, it is removed and
19347 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
19351 assert( pMem->n>=0 );
19352 if( pMem->n>1 ){
19353 u8 b1 = *(u8 *)pMem->z;
19354 u8 b2 = *(((u8 *)pMem->z) + 1);
19364 rc = sqlite3VdbeMemMakeWriteable(pMem);
19366 pMem->n -= 2;
19367 memmove(pMem->z, &pMem->z[2], pMem->n);
19368 pMem->z[pMem->n] = '\0';
19369 pMem->z[pMem->n+1] = '\0';
19370 pMem->flags |= MEM_Term;
19371 pMem->enc = bom;
26181 void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE,
26184 if( pMem==MAP_FAILED ){
26188 pShmNode->apRegion[pShmNode->nRegion] = pMem;
53306 ** If pMem is an object with a valid string representation, this routine
53310 ** If pMem is not a string object, or the encoding of the string
53318 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
53320 assert( (pMem->flags&MEM_RowSet)==0 );
53323 if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
53326 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53334 rc = sqlite3VdbeMemTranslate(pMem, (u8)desiredEnc);
53336 assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
53337 assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
53343 ** Make sure pMem->z points to a writable allocation of at least
53355 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve){
53357 ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) +
53358 (((pMem->flags&MEM_Dyn)&&pMem->xDel) ? 1 : 0) +
53359 ((pMem->flags&MEM_Ephem) ? 1 : 0) +
53360 ((pMem->flags&MEM_Static) ? 1 : 0)
53362 assert( (pMem->flags&MEM_RowSet)==0 );
53365 if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)<n ){
53366 if( preserve && pMem->z==pMem->zMalloc ){
53367 pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
53370 sqlite3DbFree(pMem->db, pMem->zMalloc);
53371 pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
53375 if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){
53376 memcpy(pMem->zMalloc, pMem->z, pMem->n);
53378 if( pMem->flags&MEM_Dyn && pMem->xDel ){
53379 pMem->xDel((void *)(pMem->z));
53382 pMem->z = pMem->zMalloc;
53383 if( pMem->z==0 ){
53384 pMem->flags = MEM_Null;
53386 pMem->flags &= ~(MEM_Ephem|MEM_Static);
53388 pMem->xDel = 0;
53389 return (pMem->z ? SQLITE_OK : SQLITE_NOMEM);
53400 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
53402 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53403 assert( (pMem->flags&MEM_RowSet)==0 );
53404 expandBlob(pMem);
53405 f = pMem->flags;
53406 if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){
53407 if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){
53410 pMem->z[pMem->n] = 0;
53411 pMem->z[pMem->n+1] = 0;
53412 pMem->flags |= MEM_Term;
53423 SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
53424 if( pMem->flags & MEM_Zero ){
53426 assert( pMem->flags&MEM_Blob );
53427 assert( (pMem->flags&MEM_RowSet)==0 );
53428 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53431 nByte = pMem->n + pMem->u.nZero;
53435 if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
53439 memset(&pMem->z[pMem->n], 0, pMem->u.nZero);
53440 pMem->n += pMem->u.nZero;
53441 pMem->flags &= ~(MEM_Zero|MEM_Term);
53451 SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
53452 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53453 if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
53456 if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){
53459 pMem->z[pMem->n] = 0;
53460 pMem->z[pMem->n+1] = 0;
53461 pMem->flags |= MEM_Term;
53478 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
53480 int fg = pMem->flags;
53483 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53487 assert( (pMem->flags&MEM_RowSet)==0 );
53488 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53491 if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
53502 sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
53505 sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r);
53507 pMem->n = sqlite3Strlen30(pMem->z);
53508 pMem->enc = SQLITE_UTF8;
53509 pMem->flags |= MEM_Str|MEM_Term;
53510 sqlite3VdbeChangeEncoding(pMem, enc);
53515 ** Memory cell pMem contains the context of an aggregate function.
53517 ** result of the aggregate is stored back into pMem.
53522 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
53526 assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
53527 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53530 ctx.s.db = pMem->db;
53531 ctx.pMem = pMem;
53534 assert( 0==(pMem->flags&MEM_Dyn) && !pMem->xDel );
53535 sqlite3DbFree(pMem->db, pMem->zMalloc);
53536 memcpy(pMem, &ctx.s, sizeof(ctx.s));
53626 ** at representing the value that *pMem describes as an integer.
53627 ** If pMem is an integer, then the value is exact. If pMem is
53629 ** If pMem is a string or blob, then we make an attempt to convert
53630 ** it into a integer and return that. If pMem represents an
53633 ** If pMem represents a string value, its encoding might be changed.
53635 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
53637 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53638 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53639 flags = pMem->flags;
53641 return pMem->u.i;
53643 return doubleToInt64(pMem->r);
53646 pMem->flags |= MEM_Str;
53647 if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
53648 || sqlite3VdbeMemNulTerminate(pMem) ){
53651 assert( pMem->z );
53652 sqlite3Atoi64(pMem->z, &value);
53660 ** Return the best representation of pMem that we can get into a
53661 ** double. If pMem is already a double or an integer, return its
53665 SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
53666 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53667 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53668 if( pMem->flags & MEM_Real ){
53669 return pMem->r;
53670 }else if( pMem->flags & MEM_Int ){
53671 return (double)pMem->u.i;
53672 }else if( pMem->flags & (MEM_Str|MEM_Blob) ){
53675 pMem->flags |= MEM_Str;
53676 if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
53677 || sqlite3VdbeMemNulTerminate(pMem) ){
53681 assert( pMem->z );
53682 sqlite3AtoF(pMem->z, &val);
53694 SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
53695 assert( pMem->flags & MEM_Real );
53696 assert( (pMem->flags & MEM_RowSet)==0 );
53697 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53698 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53700 pMem->u.i = doubleToInt64(pMem->r);
53714 if( pMem->r==(double)pMem->u.i && pMem->u.i>SMALLEST_INT64
53715 && ALWAYS(pMem->u.i<LARGEST_INT64) ){
53716 pMem->flags |= MEM_Int;
53721 ** Convert pMem to type integer. Invalidate any prior representations.
53723 SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
53724 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53725 assert( (pMem->flags & MEM_RowSet)==0 );
53726 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53728 pMem->u.i = sqlite3VdbeIntValue(pMem);
53729 MemSetTypeFlag(pMem, MEM_Int);
53734 ** Convert pMem so that it is of type MEM_Real.
53737 SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
53738 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53739 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
53741 pMem->r = sqlite3VdbeRealValue(pMem);
53742 MemSetTypeFlag(pMem, MEM_Real);
53747 ** Convert pMem so that it has types MEM_Real or MEM_Int or both.
53754 SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
53756 assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 );
53757 assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
53758 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53759 rc = sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8);
53761 rc = sqlite3VdbeMemNulTerminate(pMem);
53763 if( sqlite3Atoi64(pMem->z, &pMem->u.i) ){
53764 MemSetTypeFlag(pMem, MEM_Int);
53766 pMem->r = sqlite3VdbeRealValue(pMem);
53767 MemSetTypeFlag(pMem, MEM_Real);
53768 sqlite3VdbeIntegerAffinity(pMem);
53774 ** Delete any previous value and set the value stored in *pMem to NULL.
53776 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
53777 if( pMem->flags & MEM_Frame ){
53778 sqlite3VdbeFrameDelete(pMem->u.pFrame);
53780 if( pMem->flags & MEM_RowSet ){
53781 sqlite3RowSetClear(pMem->u.pRowSet);
53783 MemSetTypeFlag(pMem, MEM_Null);
53784 pMem->type = SQLITE_NULL;
53791 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
53792 sqlite3VdbeMemRelease(pMem);
53793 pMem->flags = MEM_Blob|MEM_Zero;
53794 pMem->type = SQLITE_BLOB;
53795 pMem->n = 0;
53797 pMem->u.nZero = n;
53798 pMem->enc = SQLITE_UTF8;
53801 sqlite3VdbeMemGrow(pMem, n, 0);
53802 if( pMem->z ){
53803 pMem->n = n;
53804 memset(pMem->z, 0, n);
53810 ** Delete any previous value and set the value stored in *pMem to val,
53813 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
53814 sqlite3VdbeMemRelease(pMem);
53815 pMem->u.i = val;
53816 pMem->flags = MEM_Int;
53817 pMem->type = SQLITE_INTEGER;
53822 ** Delete any previous value and set the value stored in *pMem to val,
53825 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
53827 sqlite3VdbeMemSetNull(pMem);
53829 sqlite3VdbeMemRelease(pMem);
53830 pMem->r = val;
53831 pMem->flags = MEM_Real;
53832 pMem->type = SQLITE_FLOAT;
53838 ** Delete any previous value and set the value of pMem to be an
53841 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem *pMem){
53842 sqlite3 *db = pMem->db;
53844 assert( (pMem->flags & MEM_RowSet)==0 );
53845 sqlite3VdbeMemRelease(pMem);
53846 pMem->zMalloc = sqlite3DbMallocRaw(db, 64);
53848 pMem->flags = MEM_Null;
53850 assert( pMem->zMalloc );
53851 pMem->u.pRowSet = sqlite3RowSetInit(db, pMem->zMalloc,
53852 sqlite3DbMallocSize(db, pMem->zMalloc));
53853 assert( pMem->u.pRowSet!=0 );
53854 pMem->flags = MEM_RowSet;
53949 ** is required to store the string, then value of pMem is unchanged. In
53953 Mem *pMem, /* Memory cell to set to string value */
53959 int nByte = n; /* New value for pMem->n */
53961 u16 flags = 0; /* New value for pMem->flags */
53963 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
53964 assert( (pMem->flags & MEM_RowSet)==0 );
53966 /* If z is a NULL pointer, set pMem to contain an SQL NULL. */
53968 sqlite3VdbeMemSetNull(pMem);
53972 if( pMem->db ){
53973 iLimit = pMem->db->aLimit[SQLITE_LIMIT_LENGTH];
54000 if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){
54003 memcpy(pMem->z, z, nAlloc);
54005 sqlite3VdbeMemRelease(pMem);
54006 pMem->zMalloc = pMem->z = (char *)z;
54007 pMem->xDel = 0;
54009 sqlite3VdbeMemRelease(pMem);
54010 pMem->z = (char *)z;
54011 pMem->xDel = xDel;
54015 pMem->n = nByte;
54016 pMem->flags = flags;
54017 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
54018 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
54021 if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
54156 ** into the pMem element.
54158 ** The pMem structure is assumed to be uninitialized. Any prior content
54162 ** to read from the disk) then the pMem is left in an inconsistent state.
54169 Mem *pMem /* OUT: Return data in this Mem structure. */
54179 assert( (pMem->flags & MEM_RowSet)==0 );
54187 if( offset+amt<=available && (pMem->flags&MEM_Dyn)==0 ){
54188 sqlite3VdbeMemRelease(pMem);
54189 pMem->z = &zData[offset];
54190 pMem->flags = MEM_Blob|MEM_Ephem;
54191 }else if( SQLITE_OK==(rc = sqlite3VdbeMemGrow(pMem, amt+2, 0)) ){
54192 pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
54193 pMem->enc = 0;
54194 pMem->type = SQLITE_BLOB;
54196 rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
54198 rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
54200 pMem->z[amt] = 0;
54201 pMem->z[amt+1] = 0;
54203 sqlite3VdbeMemRelease(pMem);
54206 pMem->n = amt;
55301 Mem *pMem = pOp->p4.pMem;
55302 assert( (pMem->flags & MEM_Null)==0 );
55303 if( pMem->flags & MEM_Str ){
55304 zP4 = pMem->z;
55305 }else if( pMem->flags & MEM_Int ){
55306 sqlite3_snprintf(nTemp, zTemp, "%lld", pMem->u.i);
55307 }else if( pMem->flags & MEM_Real ){
55308 sqlite3_snprintf(nTemp, zTemp, "%.16g", pMem->r);
55310 assert( pMem->flags & MEM_Blob );
55468 Mem *pMem = p->pResultSet = &p->aMem[1]; /* First Mem of result set */
55478 releaseMemArray(pMem, 8);
55541 pMem->flags = MEM_Int;
55542 pMem->type = SQLITE_INTEGER;
55543 pMem->u.i = i; /* Program counter */
55544 pMem++;
55546 pMem->flags = MEM_Static|MEM_Str|MEM_Term;
55547 pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */
55548 assert( pMem->z!=0 );
55549 pMem->n = sqlite3Strlen30(pMem->z);
55550 pMem->type = SQLITE_TEXT;
55551 pMem->enc = SQLITE_UTF8;
55552 pMem++;
55574 pMem->flags = MEM_Int;
55575 pMem->u.i = pOp->p1; /* P1 */
55576 pMem->type = SQLITE_INTEGER;
55577 pMem++;
55579 pMem->flags = MEM_Int;
55580 pMem->u.i = pOp->p2; /* P2 */
55581 pMem->type = SQLITE_INTEGER;
55582 pMem++;
55585 pMem->flags = MEM_Int;
55586 pMem->u.i = pOp->p3; /* P3 */
55587 pMem->type = SQLITE_INTEGER;
55588 pMem++;
55591 if( sqlite3VdbeMemGrow(pMem, 32, 0) ){ /* P4 */
55595 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
55596 z = displayP4(pOp, pMem->z, 32);
55597 if( z!=pMem->z ){
55598 sqlite3VdbeMemSetStr(pMem, z, -1, SQLITE_UTF8, 0);
55600 assert( pMem->z!=0 );
55601 pMem->n = sqlite3Strlen30(pMem->z);
55602 pMem->enc = SQLITE_UTF8;
55604 pMem->type = SQLITE_TEXT;
55605 pMem++;
55608 if( sqlite3VdbeMemGrow(pMem, 4, 0) ){
55612 pMem->flags = MEM_Dyn|MEM_Str|MEM_Term;
55613 pMem->n = 2;
55614 sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */
55615 pMem->type = SQLITE_TEXT;
55616 pMem->enc = SQLITE_UTF8;
55617 pMem++;
55621 pMem->flags = MEM_Str|MEM_Term;
55622 pMem->z = pOp->zComment;
55623 pMem->n = sqlite3Strlen30(pMem->z);
55624 pMem->enc = SQLITE_UTF8;
55625 pMem->type = SQLITE_TEXT;
55629 pMem->flags = MEM_Null; /* Comment */
55630 pMem->type = SQLITE_NULL;
56873 ** Return the serial-type for the value stored in pMem.
56875 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
56876 int flags = pMem->flags;
56885 i64 i = pMem->u.i;
56901 assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
56902 n = pMem->n;
56904 n += pMem->u.nZero;
56976 ** Write the serialized data blob for the value stored in pMem into
56993 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
56994 u32 serial_type = sqlite3VdbeSerialType(pMem, file_format);
57002 assert( sizeof(v)==sizeof(pMem->r) );
57003 memcpy(&v, &pMem->r, sizeof(v));
57006 v = pMem->u.i;
57019 assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0)
57021 assert( pMem->n<=nBuf );
57022 len = pMem->n;
57023 memcpy(buf, pMem->z, len);
57024 if( pMem->flags & MEM_Zero ){
57025 len += pMem->u.nZero;
57030 memset(&buf[pMem->n], 0, len-pMem->n);
57041 ** and store the result in pMem. Return the number of bytes read.
57046 Mem *pMem /* Memory cell to write value into */
57052 pMem->flags = MEM_Null;
57056 pMem->u.i = (signed char)buf[0];
57057 pMem->flags = MEM_Int;
57061 pMem->u.i = (((signed char)buf[0])<<8) | buf[1];
57062 pMem->flags = MEM_Int;
57066 pMem->u.i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
57067 pMem->flags = MEM_Int;
57071 pMem->u.i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
57072 pMem->flags = MEM_Int;
57079 pMem->u.i = *(i64*)&x;
57080 pMem->flags = MEM_Int;
57104 pMem->u.i = *(i64*)&x;
57105 pMem->flags = MEM_Int;
57107 assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
57109 memcpy(&pMem->r, &x, sizeof(x));
57110 pMem->flags = sqlite3IsNaN(pMem->r) ? MEM_Null : MEM_Real;
57116 pMem->u.i = serial_type-8;
57117 pMem->flags = MEM_Int;
57122 pMem->z = (char *)buf;
57123 pMem->n = len;
57124 pMem->xDel = 0;
57126 pMem->flags = MEM_Str | MEM_Ephem;
57128 pMem->flags = MEM_Blob | MEM_Ephem;
57164 Mem *pMem;
57186 p->aMem = pMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
57187 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
57195 pMem->enc = pKeyInfo->enc;
57196 pMem->db = pKeyInfo->db;
57197 pMem->flags = 0;
57198 pMem->zMalloc = 0;
57199 d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
57200 pMem++;
57213 Mem *pMem;
57217 for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){
57223 if( NEVER(pMem->zMalloc) ) sqlite3VdbeMemRelease(pMem);
57528 Mem *pMem = &v->aVar[iVar-1];
57529 if( 0==(pMem->flags & MEM_Null) ){
57532 sqlite3VdbeMemCopy((Mem *)pRet, pMem);
58087 Mem *pMem;
58090 pMem = p->pMem;
58092 if( (pMem->flags & MEM_Agg)==0 ){
58094 sqlite3VdbeMemReleaseExternal(pMem);
58095 pMem->flags = MEM_Null;
58096 pMem->z = 0;
58098 sqlite3VdbeMemGrow(pMem, nByte, 0);
58099 pMem->flags = MEM_Agg;
58100 pMem->u.pDef = p->pFunc;
58101 if( pMem->z ){
58102 memset(pMem->z, 0, nByte);
58106 return (void*)pMem->z;
58179 assert( p && p->pMem && p->pFunc && p->pFunc->xStep );
58180 return p->pMem->n;
59129 ** Argument pMem points at a register that will be passed to a
59131 ** This routine sets the pMem->type variable used by the sqlite3_value_*()
59134 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
59135 int flags = pMem->flags;
59137 pMem->type = SQLITE_NULL;
59140 pMem->type = SQLITE_INTEGER;
59143 pMem->type = SQLITE_FLOAT;
59146 pMem->type = SQLITE_TEXT;
59148 pMem->type = SQLITE_BLOB;
59181 Mem *pMem = &p->aMem[p->nMem-iCur];
59195 if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){
59196 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;
59201 pCx->aType = (u32 *)&pMem->z[ROUND8(sizeof(VdbeCursor))];
59205 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*nField*sizeof(u32)];
59300 Mem *pMem = (Mem*)pVal;
59301 applyNumericAffinity(pMem);
59302 sqlite3VdbeMemStoreType(pMem);
59303 return pMem->type;
59320 ** Write a nice string representation of the contents of cell pMem
59323 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
59325 int f = pMem->flags;
59347 sqlite3_snprintf(100, zCsr, "%d[", pMem->n);
59349 for(i=0; i<16 && i<pMem->n; i++){
59350 sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));
59353 for(i=0; i<16 && i<pMem->n; i++){
59354 char z = pMem->z[i];
59359 sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
59362 sqlite3_snprintf(100, zCsr,"+%dz",pMem->u.nZero);
59382 sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n);
59385 for(j=0; j<15 && j<pMem->n; j++){
59386 u8 c = pMem->z[j];
59394 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);
59664 Mem *pMem;
59845 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
59954 Mem *pMem; /* Used to iterate through memory cells */
59971 Mem *pMem;
59977 Mem *pMem;
60554 Mem *pMem;
60598 u.ad.pMem = p->pResultSet = &aMem[pOp->p1];
60600 sqlite3VdbeMemNulTerminate(&u.ad.pMem[u.ad.i]);
60601 sqlite3VdbeMemStoreType(&u.ad.pMem[u.ad.i]);
60602 REGISTER_TRACE(pOp->p1+u.ad.i, &u.ad.pMem[u.ad.i]);
61785 sqlite3VdbeMemShallowCopy(u.am.pDest, pOp->p4.pMem, MEM_Static);
63156 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
63223 u.be.pMem = &u.be.pFrame->aMem[pOp->p3];
63227 u.be.pMem = &aMem[pOp->p3];
63230 REGISTER_TRACE(pOp->p3, u.be.pMem);
63231 sqlite3VdbeMemIntegerify(u.be.pMem);
63232 assert( (u.be.pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */
63233 if( u.be.pMem->u.i==MAX_ROWID || u.be.pC->useRandomRowid ){
63237 if( u.be.v<u.be.pMem->u.i+1 ){
63238 u.be.v = u.be.pMem->u.i + 1;
63240 u.be.pMem->u.i = u.be.v;
64406 Mem *pMem; /* Used to iterate through memory cells */
64475 for(u.by.pMem=VdbeFrameMem(u.by.pFrame); u.by.pMem!=u.by.pEnd; u.by.pMem++){
64476 u.by.pMem->flags = MEM_Null;
64477 u.by.pMem->db = db;
64662 Mem *pMem;
64679 u.cb.ctx.pMem = u.cb.pMem = &aMem[pOp->p3];
64680 u.cb.pMem->n++;
64717 Mem *pMem;
64720 u.cc.pMem = &aMem[pOp->p1];
64721 assert( (u.cc.pMem->flags & ~(MEM_Null|MEM_Agg))==0 );
64722 rc = sqlite3VdbeMemFinalize(u.cc.pMem, pOp->p4.pFunc);
64724 sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(u.cc.pMem));
64726 sqlite3VdbeChangeEncoding(u.cc.pMem, encoding);
64727 UPDATE_MAX_BLOBSIZE(u.cc.pMem);
64728 if( sqlite3VdbeMemTooBig(u.cc.pMem) ){