-C Changes\sto\ssqlite3VdbeRecordUnpack()\sto\smake\sit\sslightly\ssmaller\sand\sfaster.
-D 2014-09-16T13:30:05.468
+C Reorder\sthe\selements\sof\sthe\sMem\sobject\sfor\sa\ssmall\ssize\sreduction\sand\nperformance\simprovement.
+D 2014-09-16T14:16:31.846
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/expr.c 19392d98e089640c3336e65b4254cc337efef7d1
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c da985ae673efef2c712caef825a5d2edb087ead7
-F src/func.c 5d498933f6168dff80941c873805fe04dc2b766d
+F src/func.c 1629ccdd8ef3f19d7accc9d9287190489469ff81
F src/global.c 5110fa12e09729b84eee0191c984ec4008e21937
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
F src/vdbe.c 9a45dcbcc967fc0cb9248c75ba245d1d47de3e78
F src/vdbe.h c63fad052c9e7388d551e556e119c0bcf6bebdf8
-F src/vdbeInt.h b4843c35c3ba533b69d4250f550b5bacf2fb013d
-F src/vdbeapi.c 06b712d4772b318b69cd37a416deb1ff0426aa8c
-F src/vdbeaux.c 2f284f8b052acc5b484682fbd3de35c990c2ca1c
+F src/vdbeInt.h 0de8705e38b5f28808e37cebb9ec6df995ac3304
+F src/vdbeapi.c 4d2aa56efa1b4a010012466bf8e97dbf179081a6
+F src/vdbeaux.c 4d607ce804cc4ee129df5745f7b73ed472f808b6
F src/vdbeblob.c 848238dc73e93e48432991bb5651bf87d865eca4
-F src/vdbemem.c dc36ea9fe26c25550c50085f388167086ef7d73a
+F src/vdbemem.c 4d1e1398be24f85805196c20a80699be0699a9ca
F src/vdbesort.c a7a40ceca6325b853040ffcc363dcd49a45f201b
F src/vdbetrace.c 16d39c1ef7d1f4a3a7464bea3b7b4bdd7849c415
F src/vtab.c 019dbfd0406a7447c990e1f7bd1dfcdb8895697f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 20ed2321b09ba076e50f9fc2f42c135b25746d72
-R 052add0d7794460f3fc0b9bdb3e7879a
+P 8fb90da77ce0e662c1ef1ae0d854e5164494b7af
+R 66ed6d98b57d603d2a5f34403ecc91fe
U drh
-Z bf1aaf6028da77cf4241e813f52ee696
+Z d53857782fade1fcfcd0d6fed6dee986
-8fb90da77ce0e662c1ef1ae0d854e5164494b7af
\ No newline at end of file
+0be3019ed794c10de67dfd645ceea7d45815bc4b
\ No newline at end of file
sqlite3SkipAccumulatorLoad(context);
}
}else{
+ pBest->db = sqlite3_context_db_handle(context);
sqlite3VdbeMemCopy(pBest, pArg);
}
}
** integer etc.) of the same value.
*/
struct Mem {
- sqlite3 *db; /* The associated database connection */
- char *z; /* String or BLOB value */
- double r; /* Real value */
union {
i64 i; /* Integer value used when MEM_Int is set in flags */
int nZero; /* Used when bit MEM_Zero is set in flags */
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
} u;
- int n; /* Number of characters in string value, excluding '\0' */
u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
+ int n; /* Number of characters in string value, excluding '\0' */
+ double r; /* Real value */
+ char *z; /* String or BLOB value */
+ char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */
+ /* ShallowCopy only needs to copy the information above */
+ sqlite3 *db; /* The associated database connection */
+ void (*xDel)(void*);/* If not null, call this function to delete Mem.z */
#ifdef SQLITE_DEBUG
Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
void *pFiller; /* So that sizeof(Mem) is a multiple of 8 */
#endif
- void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
- char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */
};
/* One or more of the following flags are set to indicate the validOK
#if defined(SQLITE_DEBUG) && defined(__GNUC__)
__attribute__((aligned(8)))
#endif
- = {0, "", (double)0, {0}, 0, MEM_Null, 0,
+ = {
+ .flags = MEM_Null,
+ .enc = 0,
+ .n = 0,
+ .r = (double)0,
+ .u = {0},
+ .z = 0,
+ .zMalloc = 0,
+ .db = 0,
+ .xDel = 0,
#ifdef SQLITE_DEBUG
- 0, 0, /* pScopyFrom, pFiller */
+ .pScopyFrom = 0,
+ .pFiller = 0,
#endif
- 0, 0 };
+ };
return &nullMem;
}
int n1, n2;
Mem c1;
Mem c2;
- memset(&c1, 0, sizeof(c1));
- memset(&c2, 0, sizeof(c2));
+ c1.db = c2.db = pMem1->db;
+ c1.flags = c2.flags = 0;
+ c1.zMalloc = c2.zMalloc = 0;
sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
*/
void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
assert( (pFrom->flags & MEM_RowSet)==0 );
+ assert( pTo->db==pFrom->db );
VdbeMemReleaseExtern(pTo);
memcpy(pTo, pFrom, MEMCELLSIZE);
pTo->xDel = 0;
int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
int rc = SQLITE_OK;
+ assert( pTo->db==pFrom->db );
assert( (pFrom->flags & MEM_RowSet)==0 );
VdbeMemReleaseExtern(pTo);
memcpy(pTo, pFrom, MEMCELLSIZE);