/ Check-in [2737505f]
Login

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

Overview
Comment:Bugfix for previous checkin. (CVS 1587)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2737505f28e37627ed6091e356d005624e1f49fa
User & Date: danielk1977 2004-06-14 09:41:18
Context
2004-06-14
11:35
Don't invoke authorisation callback during database initialisation. (CVS 1588) check-in: 293fbf0a user: danielk1977 tags: trunk
09:41
Bugfix for previous checkin. (CVS 1587) check-in: 2737505f user: danielk1977 tags: trunk
09:35
Ensure master journal file is deleted when a transaction is committed. (CVS 1586) check-in: cb3cbe00 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  1110   1110             sqlite3OsClose(&master);
  1111   1111             sqliteFree(zMaster);
  1112   1112             return rc;
  1113   1113           }
  1114   1114         }
  1115   1115       }
  1116   1116       sqlite3OsClose(&master);
  1117         -    sqliteFree(zMaster);
  1118         -    zMaster = 0;
  1119   1117   
  1120   1118       /* Delete the master journal file. This commits the transaction. After
  1121   1119       ** doing this the directory is synced again before any individual
  1122   1120       ** transaction files are deleted.
  1123   1121       */
  1124   1122       rc = sqlite3OsDelete(zMaster);
  1125   1123       assert( rc==SQLITE_OK );
         1124  +    sqliteFree(zMaster);
         1125  +    zMaster = 0;
  1126   1126       rc = sqlite3OsSyncDirectory(zMainFile);
  1127   1127       if( rc!=SQLITE_OK ){
  1128   1128         /* This is not good. The master journal file has been deleted, but
  1129   1129         ** the directory sync failed. There is no completely safe course of
  1130   1130         ** action from here. The individual journals contain the name of the
  1131   1131         ** master journal file, but there is no way of knowing if that
  1132   1132         ** master journal exists now or if it will exist after the operating

Changes to test/attach2.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the ATTACH and DETACH commands
    13     13   # and related functionality.
    14     14   #
    15         -# $Id: attach2.test,v 1.17 2004/06/14 09:35:17 danielk1977 Exp $
           15  +# $Id: attach2.test,v 1.18 2004/06/14 09:41:18 danielk1977 Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   
    22     22   # Ticket #354
................................................................................
   300    300     execsql {SELECT * FROM t1} db2
   301    301   } {1 2 1 2}
   302    302   
   303    303   db close
   304    304   db2 close
   305    305   file delete -force test2.db
   306    306   
   307         -if 0 {
   308         -
   309    307   # These tests - attach2-5.* - check that the master journal file is deleted
   310    308   # correctly when a multi-file transaction is committed or rolled back.
   311    309   #
   312    310   # Update: It's not actually created if a rollback occurs, so that test
   313    311   # doesn't really prove too much.
   314    312   foreach f [glob test.db*] {file delete -force $f}
   315    313   do_test attach2-5.1 {
................................................................................
   338    336     }
   339    337   } {}
   340    338   do_test attach2-5.5 {
   341    339     glob test.db*
   342    340   } {test.db test.db2}
   343    341   
   344    342   db close
   345         -
   346         -}
   347         -
   348    343   
   349    344   finish_test
   350    345   
   351    346   
   352    347   
   353    348   
   354    349   
   355    350