Lines Matching defs:Mem

3592 typedef struct Mem sqlite3_value;
8409 typedef struct Mem Mem;
8434 Mem *pMem; /* Used when p4type is P4_MEM */
8487 #define P4_MEM (-8) /* P4 is a pointer to a Mem* structure */
8509 ** The Vdbe.aColName array contains 5n Mem structures, where n is the
10305 Mem *aMem; /* Values */
12916 Mem *aMem; /* Array of memory cells for parent frame */
12930 #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
12938 ** Internally, the vdbe manipulates nearly all SQL values as Mem
12939 ** structures. Each Mem struct may cache multiple representations (string,
12942 struct Mem {
12958 Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
12959 void *pFiller; /* So that sizeof(Mem) is a multiple of 8 */
12961 void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
12966 ** representations of the value stored in the Mem struct.
12971 ** If the MEM_Str flag is set then Mem.z points at a string representation.
12987 /* Whenever Mem contains a valid string or blob representation, one of
12989 ** policy for Mem.z. The MEM_Term flag tells us whether or not the
12993 #define MEM_Dyn 0x0400 /* Need to call sqliteFree() on Mem.z */
12994 #define MEM_Static 0x0800 /* Mem.z points to a static string */
12995 #define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
12996 #define MEM_Agg 0x2000 /* Mem.z points to an agg function context */
12997 #define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */
13004 ** Clear any existing type flags from a Mem and replace them with f
13047 ** (Mem) which are only defined there.
13052 Mem s; /* The return value is stored here */
13053 Mem *pMem; /* Memory cell used to store aggregate context */
13088 Mem *aMem; /* The memory locations */
13089 Mem **apArg; /* Arguments to currently executing user function */
13090 Mem *aColName; /* Column names to return */
13091 Mem *pResultSet; /* Pointer to an array of results */
13104 Mem *aVar; /* Values for the OP_Variable opcode. */
13167 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int);
13168 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
13169 SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
13175 SQLITE_PRIVATE int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
13179 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *, int);
13180 SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem*);
13181 SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem*, const Mem*);
13182 SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
13183 SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem*, Mem*);
13184 SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem*);
13185 SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
13186 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
13190 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
13192 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
13193 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
13194 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem*);
13195 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem*);
13196 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem*, int);
13197 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem*);
13198 SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem*);
13199 SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem*);
13200 SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem*);
13201 SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem*);
13202 SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem*);
13203 SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
13204 SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p);
13205 SQLITE_PRIVATE void sqlite3VdbeMemReleaseExternal(Mem *p);
13209 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
13211 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve);
13215 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem);
13229 SQLITE_PRIVATE int sqlite3VdbeSorterRowkey(VdbeCursor *, Mem *);
13232 SQLITE_PRIVATE int sqlite3VdbeSorterWrite(sqlite3 *, VdbeCursor *, Mem *);
13233 SQLITE_PRIVATE int sqlite3VdbeSorterCompare(VdbeCursor *, Mem *, int *);
13245 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe*,Mem*);
13254 SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem*, u8);
13257 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
13259 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem);
13262 SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *);
20612 ** If the TRANSLATE_TRACE macro is defined, the value of each Mem is
20623 SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
20761 ** the encoding of the Mem adjusted. This routine does not do any
20762 ** byte-swapping, it just sets Mem.enc appropriately.
20764 ** The allocation (static, dynamic etc.) and encoding of the Mem may be
20767 SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
20860 Mem m;
20888 Mem m;
58233 ** This file contains code use to manipulate "Mem" structure. A "Mem"
58234 ** stores a single value in the VDBE. Mem is an opaque structure visible
58235 ** only within the VDBE. Interface routines refer to a Mem using the
58252 SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
58287 ** not set, Mem.n is zeroed.
58289 SQLITE_PRIVATE int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve){
58327 ** Make the given Mem object MEM_Dyn. In other words, make it so
58334 SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
58356 ** If the given Mem* has a zero-filled tail, turn it into an ordinary
58360 SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
58386 ** Make sure the given Mem is \u0000 terminated.
58388 SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
58403 ** Add MEM_Str to the set of representations for the given Mem. Numbers
58415 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
58459 SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
58482 ** does not free any Mem.zMalloc buffer.
58484 SQLITE_PRIVATE void sqlite3VdbeMemReleaseExternal(Mem *p){
58502 ** Release any memory held by the Mem. This may leave the Mem in an
58503 ** inconsistent state, for example with (Mem.z==0) and
58504 ** (Mem.type==SQLITE_TEXT).
58506 SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
58566 SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
58592 SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
58614 SQLITE_PRIVATE void sqlite3VdbeIntegerAffinity(Mem *pMem){
58643 SQLITE_PRIVATE int sqlite3VdbeMemIntegerify(Mem *pMem){
58657 SQLITE_PRIVATE int sqlite3VdbeMemRealify(Mem *pMem){
58674 SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
58694 SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
58711 SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
58733 SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
58745 SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
58761 SQLITE_PRIVATE void sqlite3VdbeMemSetRowSet(Mem *pMem){
58779 ** Return true if the Mem object contains a TEXT or BLOB that is
58782 SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){
58803 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
58805 Mem *pX;
58817 ** Size of struct Mem not including the Mem.zMalloc member.
58819 #define MEMCELLSIZE (size_t)(&(((Mem *)0)->zMalloc))
58827 SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
58843 SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
58867 SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){
58873 memcpy(pTo, pFrom, sizeof(Mem));
58880 ** Change the value of a Mem to be a string or a BLOB.
58885 ** Mem structure. Otherwise, any existing buffer is freed and the
58895 Mem *pMem, /* Memory cell to set to string value */
58930 /* The following block sets the new values of Mem.z and Mem.xDel. It
58984 SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){
59065 Mem c1;
59066 Mem c2;
59094 ** Move data out of a btree key or data field and into a Mem structure.
59111 Mem *pMem /* OUT: Return data in this Mem structure. */
59203 Mem *p = sqlite3DbMallocZero(db, sizeof(*p));
59339 if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
59347 sqlite3VdbeMemRelease((Mem *)v);
59348 sqlite3DbFree(((Mem*)v)->db, v);
59356 Mem *p = (Mem*)pVal;
59997 Mem *p = (Mem*)p4;
60282 Mem *pMem = pOp->p4.pMem;
60431 ** Release an array of N Mem elements
60433 static void releaseMemArray(Mem *p, int N){
60435 Mem *pEnd;
60478 Mem *aMem = VdbeFrameMem(p);
60509 Mem *pSub = 0; /* Memory cell hold array of subprogs */
60513 Mem *pMem = &p->aMem[1]; /* First Mem of result set */
60899 p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
60900 p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
60901 p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);
61055 Mem *pColName;
61063 p->aColName = pColName = (Mem*)sqlite3DbMallocZero(db, sizeof(Mem)*n );
61090 Mem *pColName;
61977 SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
62101 SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, int nBuf, Mem *pMem, int file_format){
62154 Mem *pMem /* Memory cell to write value into */
62273 nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1);
62283 p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
62305 Mem *pMem = p->aMem;
62357 Mem mem1;
62457 Mem m, v;
62539 Mem m;
62614 Mem *pMem = &v->aVar[iVar-1];
62618 sqlite3VdbeMemCopy((Mem *)pRet, pMem);
62620 sqlite3VdbeMemStoreType((Mem *)pRet);
62778 ** The following routines extract information from a Mem or sqlite3_value
62782 Mem *p = (Mem*)pVal;
62799 return sqlite3VdbeRealValue((Mem*)pVal);
62802 return (int)sqlite3VdbeIntValue((Mem*)pVal);
62805 return sqlite3VdbeIntValue((Mem*)pVal);
63210 Mem *pMem;
63328 ** it is, return a pointer to the Mem for the value of that column.
63329 ** If iCol is not valid, return a pointer to a Mem which has a value
63332 static Mem *columnMem(sqlite3_stmt *pStmt, int i){
63334 Mem *pOut;
63342 ** a pointer to the following static Mem object which contains the
63343 ** value SQL NULL. Even though the Mem structure contains an element
63345 ** switches (-Os), gcc may align this Mem object on a 4-byte boundary
63348 ** that a Mem structure is located on an 8-byte boundary. To prevent
63352 static const Mem nullMem
63366 pOut = (Mem*)&nullMem;
63448 Mem *pOut = columnMem(pStmt, i);
63495 const void *(*xFunc)(Mem*),
63528 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
63533 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
63553 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
63558 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
63571 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE);
63576 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE);
63587 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE);
63592 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE);
63603 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN);
63608 pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN);
63630 Mem *pVar;
63682 Mem *pVar;
64033 Mem *pVar; /* Value of a host parameter */
64085 Mem utf8;
64331 static void updateMaxBlobsize(Mem *p){
64395 SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
64442 Mem *pMem = &p->aMem[p->nMem-iCur];
64479 static void applyNumericAffinity(Mem *pRec){
64515 Mem *pRec, /* The value to apply affinity to */
64545 Mem *pMem = (Mem*)pVal;
64555 ** not the internal Mem* type.
64562 applyAffinity((Mem *)pVal, affinity, enc);
64570 SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
64652 static void memTracePrint(FILE *out, Mem *p){
64672 static void registerTrace(FILE *out, int iReg, Mem *p){
64878 Mem *aMem = p->aMem; /* Copy of p->aMem */
64879 Mem *pIn1 = 0; /* 1st input operand */
64880 Mem *pIn2 = 0; /* 2nd input operand */
64881 Mem *pIn3 = 0; /* 3rd input operand */
64882 Mem *pOut = 0; /* Output operand */
64906 Mem *pVar; /* Value being transferred */
64915 Mem *pMem;
64930 Mem *pArg;
64978 Mem *pDest; /* Where to write the extracted value */
64979 Mem sMem; /* For storing the record being decoded */
64987 Mem *pReg; /* PseudoTable input register */
64995 Mem *pRec; /* The new record */
65002 Mem *pData0; /* First field to be combined into the record */
65003 Mem *pLast; /* Last field of the record */
65082 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
65089 Mem *aMx;
65104 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
65108 Mem *pData; /* MEM cell holding data for the record to be inserted */
65109 Mem *pKey; /* MEM cell holding key for the record */
65206 Mem *pnErr; /* Register keeping track of errors remaining */
65218 Mem *pRt; /* Register to allocate runtime space */
65219 Mem *pMem; /* Used to iterate through memory cells */
65220 Mem *pEnd; /* Last memory cell in new array */
65227 Mem *pIn;
65230 Mem *pIn1;
65236 Mem *pMem;
65237 Mem *pRec;
65242 Mem *pMem;
65247 Mem *pMem; /* Write results here */
65272 Mem *pQuery;
65273 Mem *pArgc;
65279 Mem **apArg;
65284 Mem *pDest;
65295 Mem *pName;
65303 Mem **apArg;
65304 Mem *pX;
65747 Mem *pVar; /* Value being transferred */
65856 Mem *pMem;
66122 Mem *pArg;
66904 Mem *pDest; /* Where to write the extracted value */
66905 Mem sMem; /* For storing the record being decoded */
66913 Mem *pReg; /* PseudoTable input register */
67134 ** a pointer to a Mem object.
67229 Mem *pRec; /* The new record */
67236 Mem *pData0; /* First field to be combined into the record */
67237 Mem *pLast; /* Last field of the record */
68360 char aTempRec[ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*3 + 7];
68446 Mem *aMx;
68593 Mem *pMem; /* Register holding largest rowid for AUTOINCREMENT */
68771 Mem *pData; /* MEM cell holding data for the record to be inserted */
68772 Mem *pKey; /* MEM cell holding key for the record */
69762 Mem *pnErr; /* Register keeping track of errors remaining */
69921 Mem *pRt; /* Register to allocate runtime space */
69922 Mem *pMem; /* Used to iterate through memory cells */
69923 Mem *pEnd; /* Last memory cell in new array */
69968 + u.cc.nMem * sizeof(Mem)
70041 Mem *pIn;
70102 Mem *pIn1;
70186 Mem *pMem;
70187 Mem *pRec;
70245 Mem *pMem;
70278 Mem *pMem; /* Write results here */
70602 Mem *pQuery;
70603 Mem *pArgc;
70609 Mem **apArg;
70665 Mem *pDest;
70699 ** dynamic allocation in u.cn.sContext.s (a Mem struct) is released.
70770 Mem *pName;
70823 Mem **apArg;
70824 Mem *pX;
72134 Mem *pVal /* Memory cell containing record */
72366 SQLITE_PRIVATE int sqlite3VdbeSorterRowkey(VdbeCursor *pCsr, Mem *pOut){
72393 Mem *pVal, /* Value to compare to current sorter key */
79688 ** iMem+nCol+1 .. Mem+2*nCol:
87341 Mem *pArg = (Mem *)argv[0];
87342 Mem *pBest;
87346 pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));
98413 int iAMem; /* First Mem address for storing current GROUP BY */
98414 int iBMem; /* First Mem address for previous GROUP BY */
98415 int iUseFlag; /* Mem address holding flag indicating that at least
98418 int iAbortFlag; /* Mem address which causes query abort if positive */