mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Back out [ec8ff892ac] which is causing missed OOM errors on some tests.
FossilOrigin-Name: 0611770d6a2fcb9fa0bedee19df9916820ae8f3b
This commit is contained in:
34
src/main.c
34
src/main.c
@@ -2989,13 +2989,13 @@ static int openDatabase(
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3AutoLoadExtensions(db);
|
||||
rc = sqlite3_errcode(db);
|
||||
if( rc!=SQLITE_OK ){
|
||||
goto opendb_out;
|
||||
}
|
||||
}
|
||||
|
||||
testcase( rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
|
||||
testcase( rc!=SQLITE_OK && !db->mallocFailed );
|
||||
|
||||
#ifdef SQLITE_ENABLE_FTS1
|
||||
if( !db->mallocFailed && rc==SQLITE_OK ){
|
||||
if( !db->mallocFailed ){
|
||||
extern int sqlite3Fts1Init(sqlite3*);
|
||||
rc = sqlite3Fts1Init(db);
|
||||
}
|
||||
@@ -3038,23 +3038,23 @@ static int openDatabase(
|
||||
}
|
||||
#endif
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
/* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
|
||||
** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
|
||||
** mode. Doing nothing at all also makes NORMAL the default.
|
||||
*/
|
||||
/* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
|
||||
** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
|
||||
** mode. Doing nothing at all also makes NORMAL the default.
|
||||
*/
|
||||
#ifdef SQLITE_DEFAULT_LOCKING_MODE
|
||||
db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
|
||||
sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
|
||||
SQLITE_DEFAULT_LOCKING_MODE);
|
||||
db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
|
||||
sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
|
||||
SQLITE_DEFAULT_LOCKING_MODE);
|
||||
#endif
|
||||
|
||||
/* Enable the lookaside-malloc subsystem */
|
||||
setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
|
||||
sqlite3GlobalConfig.nLookaside);
|
||||
if( rc ) sqlite3Error(db, rc);
|
||||
|
||||
sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
|
||||
}
|
||||
/* Enable the lookaside-malloc subsystem */
|
||||
setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
|
||||
sqlite3GlobalConfig.nLookaside);
|
||||
|
||||
sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
|
||||
|
||||
opendb_out:
|
||||
if( db ){
|
||||
|
Reference in New Issue
Block a user