- C Add\sthe\sMem.szMalloc\selement\sto\sthe\sMem\sobject\sand\suse\sit\sto\skeep\strack\sof\nthe\ssize\sof\sthe\sMem.zMalloc\sallocation.
- D 2014-09-18T21:25:33.845
-C Make\ssure\sthat\sthe\ssorting-index\spre-filter\srecognizes\sthat\sa\srowid\sreference\nmight\sbe\ssortable.\s\sThis\sfixes\sa\sperformance\sregression.
-D 2014-09-19T02:01:37.043
++C Add\sthe\ssqlite3VdbeMemClearAndResize()\sfunction.\s\sFix\sa\ssorting-index\nprefilter\sproblem.
++D 2014-09-19T04:42:38.074
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
F src/util.c 4006c01772bd8d8ac4306d523bbcee41d3e392d8
F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
- F src/vdbe.c fb490f5b1b2ee2f33f60c7dc678c0d0b70f2e0cb
+ F src/vdbe.c 7bc115e540282b1bfff9b43205cbf6528e6398a6
F src/vdbe.h 09f5b4e3719fa454f252322b1cdab5cf1f361327
- F src/vdbeInt.h 1ac536d1fa1260d72f81003ff5b283e8f3c40442
- F src/vdbeapi.c e088ed70b6cc42ed68985ab064397ebd452286d6
- F src/vdbeaux.c b3230032238df611aefee5907ea792786362a55d
+ F src/vdbeInt.h f177bed1ec8d4eb5c7089f012aeb95f374745735
+ F src/vdbeapi.c e9e33b59834e3edc8790209765e069874c269d9d
+ F src/vdbeaux.c ecf0bb835f7c809ba8e22ba7d3a587b7a087ac52
F src/vdbeblob.c 848238dc73e93e48432991bb5651bf87d865eca4
- F src/vdbemem.c 3aea3831a981378368ca058cd8fc700b1982772d
- F src/vdbesort.c 09efa5e5098d1a159cd21f588eb118e4fe87cfde
-F src/vdbemem.c 0678ba6214a810539e51c6d8f263634d405b990f
++F src/vdbemem.c 5cd963730414a1a6ba53b8b340eba3f46ec2cb1d
+ F src/vdbesort.c 75c66c2fc02d450b67b4816873fba8088feaf12c
F src/vdbetrace.c 4f29b04edb0cec3d5fcd9b566d9f0e75c8984362
F src/vtab.c 019dbfd0406a7447c990e1f7bd1dfcdb8895697f
F src/wal.c 10e7de7ce90865a68153f001a61f1d985cd17983
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
- P 55879932116d373c95a5f32ec44b53a9c3f4db24
- R 508057a57cef866ce62608d1eb2d9e8e
-P 5b9b8987797abf7c68d2c3154f6657be9b8b1c8f
-R 15204d62056b16fb4766540f7ebb9528
++P 9c09ac353df6041808cace41880f4729ee73f5e1 72727b68cd07969165f1f0943cc7e1a265436653
++R a5960c77be61d5e92e67de5776336365
++T +closed 72727b68cd07969165f1f0943cc7e1a265436653
U drh
- Z 7d8fd1db974daf115bf085d0714b6de9
-Z d3f0dcf862181fb956350fa4a77ff638
++Z 88c7b85ca090541e4ecff878bb673522
return SQLITE_OK;
}
-** The pMem->xDel destructor is called, if it exists.
-**
-** The value of the pMem after this routine returns might be NULL or
-** it might retain its prior value, depending on circumstances. The
-** caller should make no assumptions about the state of pMem after this
-** routine returns, except that pMem->zMalloc is at least the requested
-** size and pMem->z==pMem->zMalloc.
+ /*
+ ** Change the pMem->zMalloc allocation to be at least szNew bytes.
+ ** If pMem->zMalloc already meets or exceeds the requested size, this
+ ** routine is a no-op.
+ **
+ ** Any prior string or blob content in the pMem object may be discarded.
- pMem->flags &= ~(MEM_Dyn|MEM_Ephem|MEM_Static);
-// pMem->flags = MEM_Null;
++** The pMem->xDel destructor is called, if it exists. Though MEM_Str
++** and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null
++** values are preserved.
+ **
+ ** Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
+ ** if unable to complete the resizing.
+ */
+ int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
+ if( pMem->szMalloc<szNew || (pMem->flags & MEM_Dyn)!=0 ){
+ return sqlite3VdbeMemGrow(pMem, szNew, 0);
+ }
+ pMem->z = pMem->zMalloc;
++ pMem->flags &= (MEM_Null|MEM_Int|MEM_Real);
+ return SQLITE_OK;
+ }
+
/*
** Make the given Mem object MEM_Dyn. In other words, make it so
** that any TEXT or BLOB content is stored in memory obtained from