/ Check-in [a4c3ac98]
Login

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

Overview
Comment:Simplifications to the sqlite3ResetInternalSchema() logic to eliminate unreachable branches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a4c3ac989d4e93f0279172901b9ece822d137700
User & Date: drh 2011-04-05 19:26:30
Context
2011-04-05
19:27
Simplifications to the sqlite3BtreeEnterAll() and LeaveAll() routines. Just have them call BtreeEnter and BtreeLeave() repeatedly rather than trying to be clever. check-in: 51039b35 user: drh tags: trunk
19:26
Simplifications to the sqlite3ResetInternalSchema() logic to eliminate unreachable branches. check-in: a4c3ac98 user: drh tags: trunk
18:34
Remove dead code from the OP_JournalMode opcode in the VDBE. This code seems to have been useless since [f88c6367d2] on 2010-08-07. check-in: a89f24e2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

   410    410     int i, j;
   411    411     assert( iDb<db->nDb );
   412    412   
   413    413     if( iDb>=0 ){
   414    414       /* Case 1:  Reset the single schema identified by iDb */
   415    415       Db *pDb = &db->aDb[iDb];
   416    416       assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
   417         -    if( ALWAYS(pDb->pSchema) ){
   418         -      sqlite3SchemaClear(pDb->pSchema);
   419         -    }
          417  +    assert( pDb->pSchema!=0 );
          418  +    sqlite3SchemaClear(pDb->pSchema);
          419  +
   420    420       /* If any database other than TEMP is reset, then also reset TEMP
   421    421       ** since TEMP might be holding triggers that reference tables in the
   422    422       ** other database.
   423    423       */
   424         -    if( iDb!=1 && (pDb = &db->aDb[1])!=0 && ALWAYS(pDb->pSchema) ){
          424  +    if( iDb!=1 ){
          425  +      pDb = &db->aDb[1];
          426  +      assert( pDb->pSchema!=0 );
   425    427         sqlite3SchemaClear(pDb->pSchema);
   426    428       }
   427    429       return;
   428    430     }
   429    431     /* Case 2 (from here to the end): Reset all schemas for all attached
   430    432     ** databases. */
   431    433     assert( iDb<0 );