/ Check-in [0611770d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Back out [ec8ff892ac] which is causing missed OOM errors on some tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0611770d6a2fcb9fa0bedee19df9916820ae8f3b
User & Date: drh 2017-02-07 03:44:42
Context
2017-02-07
12:58
Make the cellMargin() routine of R-Tree slightly smaller and faster while also fixing a harmless compiler warning. check-in: 07fe6228 user: drh tags: trunk
03:44
Back out [ec8ff892ac] which is causing missed OOM errors on some tests. check-in: 0611770d user: drh tags: trunk
00:55
Fix a minor typo in a comment in R-Tree. No changes to code. check-in: f77ee9e9 user: drh tags: trunk
2017-02-04
20:15
Simplification to the error handling to extension loading in sqlite3_open(). check-in: ec8ff892 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2985   2985   
  2986   2986     /* Load automatic extensions - extensions that have been registered
  2987   2987     ** using the sqlite3_automatic_extension() API.
  2988   2988     */
  2989   2989     if( rc==SQLITE_OK ){
  2990   2990       sqlite3AutoLoadExtensions(db);
  2991   2991       rc = sqlite3_errcode(db);
         2992  +    if( rc!=SQLITE_OK ){
         2993  +      goto opendb_out;
         2994  +    }
  2992   2995     }
  2993   2996   
  2994         -  testcase( rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
  2995         -  testcase( rc!=SQLITE_OK && !db->mallocFailed );
  2996         -
  2997   2997   #ifdef SQLITE_ENABLE_FTS1
  2998         -  if( !db->mallocFailed && rc==SQLITE_OK ){
         2998  +  if( !db->mallocFailed ){
  2999   2999       extern int sqlite3Fts1Init(sqlite3*);
  3000   3000       rc = sqlite3Fts1Init(db);
  3001   3001     }
  3002   3002   #endif
  3003   3003   
  3004   3004   #ifdef SQLITE_ENABLE_FTS2
  3005   3005     if( !db->mallocFailed && rc==SQLITE_OK ){
................................................................................
  3034   3034   
  3035   3035   #ifdef SQLITE_ENABLE_JSON1
  3036   3036     if( !db->mallocFailed && rc==SQLITE_OK){
  3037   3037       rc = sqlite3Json1Init(db);
  3038   3038     }
  3039   3039   #endif
  3040   3040   
  3041         -  if( rc==SQLITE_OK ){
  3042         -    /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
  3043         -    ** mode.  -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
  3044         -    ** mode.  Doing nothing at all also makes NORMAL the default.
  3045         -    */
         3041  +  /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
         3042  +  ** mode.  -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
         3043  +  ** mode.  Doing nothing at all also makes NORMAL the default.
         3044  +  */
  3046   3045   #ifdef SQLITE_DEFAULT_LOCKING_MODE
  3047         -    db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
  3048         -    sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
  3049         -                            SQLITE_DEFAULT_LOCKING_MODE);
         3046  +  db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
         3047  +  sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
         3048  +                          SQLITE_DEFAULT_LOCKING_MODE);
  3050   3049   #endif
  3051   3050   
  3052         -    /* Enable the lookaside-malloc subsystem */
  3053         -    setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
  3054         -                          sqlite3GlobalConfig.nLookaside);
         3051  +  if( rc ) sqlite3Error(db, rc);
  3055   3052   
  3056         -    sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
  3057         -  }
         3053  +  /* Enable the lookaside-malloc subsystem */
         3054  +  setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
         3055  +                        sqlite3GlobalConfig.nLookaside);
         3056  +
         3057  +  sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
  3058   3058   
  3059   3059   opendb_out:
  3060   3060     if( db ){
  3061   3061       assert( db->mutex!=0 || isThreadsafe==0
  3062   3062              || sqlite3GlobalConfig.bFullMutex==0 );
  3063   3063       sqlite3_mutex_leave(db->mutex);
  3064   3064     }