Fix a discrepancy between the documented behavior of SQLITE_DBCONFIG_LOOKASIDE

and what it actually does.  Also add evidence marks on the DBCONFIG_LOOKASIDE
implementation.

FossilOrigin-Name: f483be441323e1cb91516964cd6ab0edecad4366
This commit is contained in:
drh 2010-09-03 03:32:46 +00:00
parent 74b617b22a
commit 9dd55f5187
3 changed files with 27 additions and 17 deletions

View File

@ -1,5 +1,8 @@
C Move\sthe\stest\sfor\san\s(illegal)\sscalar\ssub-query\sthat\sreturns\smore\sthan\sone\scolumn\sto\searlier\sin\sSELECT\sprocessing\sin\sorder\sto\savoid\san\sassert()\sthat\scan\shappen\slater\son.
D 2010-09-02T19:01:16
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Fix\sa\sdiscrepancy\sbetween\sthe\sdocumented\sbehavior\sof\sSQLITE_DBCONFIG_LOOKASIDE\nand\swhat\sit\sactually\sdoes.\s\sAlso\sadd\sevidence\smarks\son\sthe\sDBCONFIG_LOOKASIDE\nimplementation.
D 2010-09-03T03:32:47
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -138,7 +141,7 @@ F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
F src/loadext.c 6d422ea91cf3d2d00408c5a8f2391cd458da85f8
F src/main.c b92c6c9a302999975897730b2808708fbf531a56
F src/main.c 57869e792971cc202f77b69bde87454a821f8119
F src/malloc.c e0e9ca16a90215e2f0b53e7f5cc17abe01fbe34a
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
@ -853,7 +856,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 5a9591607a0a5ba4527bf2a90179651053244953
R 7b514d804097129d93b3bae4d77340bd
U dan
Z b5e46a0ab42bf67eb22bcfbf65812650
P a55842cfb56b659c88832dce9ce7bafb50258211
R 594e3dfa3a6dc8d6a5c8c27345538f42
U drh
Z ee5272a19c79aeac7c1c4ce2730a97f0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMgGxjoxKgR168RlERAhqOAJ9FP1hqTUFVkGHxgeL6o/5M5ubTIACdEZ+8
j6hDw1rJ1tox5dDUeDLXEFM=
=rovz
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
a55842cfb56b659c88832dce9ce7bafb50258211
f483be441323e1cb91516964cd6ab0edecad4366

View File

@ -453,12 +453,12 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
sz = 0;
pStart = 0;
}else if( pBuf==0 ){
sz = ROUND8(sz);
sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */
sqlite3BeginBenignMalloc();
pStart = sqlite3Malloc( sz*cnt );
pStart = sqlite3Malloc( sz*cnt ); /* IMP: R-61949-35727 */
sqlite3EndBenignMalloc();
}else{
sz = ROUNDDOWN8(sz);
sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */
pStart = pBuf;
}
db->lookaside.pStart = pStart;
@ -501,14 +501,14 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
va_start(ap, op);
switch( op ){
case SQLITE_DBCONFIG_LOOKASIDE: {
void *pBuf = va_arg(ap, void*);
int sz = va_arg(ap, int);
int cnt = va_arg(ap, int);
void *pBuf = va_arg(ap, void*); /* IMP: R-21112-12275 */
int sz = va_arg(ap, int); /* IMP: R-47871-25994 */
int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */
rc = setupLookaside(db, pBuf, sz, cnt);
break;
}
default: {
rc = SQLITE_ERROR;
rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
break;
}
}
@ -1299,8 +1299,8 @@ int sqlite3WalDefaultHook(
*/
int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
#ifdef SQLITE_OMIT_WAL
UNUSED_PARAMETER(db);
UNUSED_PARAMETER(nFrame);
UNUSED_PARAMETER(db);
UNUSED_PARAMETER(nFrame);
#else
if( nFrame>0 ){
sqlite3_wal_hook(db, sqlite3WalDefaultHook, SQLITE_INT_TO_PTR(nFrame));