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
diff --git a/src/main.c b/src/main.c
index 3dbab01..7b4fa25 100644
--- a/src/main.c
+++ b/src/main.c
@@ -453,12 +453,12 @@
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 @@
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 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));