mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321)
FossilOrigin-Name: e38ef81b85feb5bff2ad8448f3438ff0ab36571e
This commit is contained in:
@@ -13,9 +13,10 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test3.c,v 1.82 2007/08/24 16:08:29 drh Exp $
|
||||
** $Id: test3.c,v 1.83 2007/08/29 12:31:28 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "btreeInt.h"
|
||||
#include "tcl.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -530,6 +531,7 @@ static int btree_pager_stats(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
pBt = sqlite3TextToPtr(argv[1]);
|
||||
sqlite3_mutex_enter(pBt->pSqlite->mutex);
|
||||
sqlite3BtreeEnter(pBt);
|
||||
a = sqlite3PagerStats(sqlite3BtreePager(pBt));
|
||||
for(i=0; i<11; i++){
|
||||
@@ -543,6 +545,7 @@ static int btree_pager_stats(
|
||||
Tcl_AppendElement(interp, zBuf);
|
||||
}
|
||||
sqlite3BtreeLeave(pBt);
|
||||
sqlite3_mutex_leave(pBt->pSqlite->mutex);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -1493,7 +1496,11 @@ static int btree_set_cache_size(
|
||||
}
|
||||
pBt = sqlite3TextToPtr(argv[1]);
|
||||
if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
|
||||
|
||||
sqlite3_mutex_enter(pBt->pSqlite->mutex);
|
||||
sqlite3BtreeSetCacheSize(pBt, nCache);
|
||||
sqlite3_mutex_leave(pBt->pSqlite->mutex);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user