/ Check-in [b1005ef4]
Login

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

Overview
Comment:Improved logging of master-journal name conflicts.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b1005ef46cc2b46dd8e448ae1a9a9508bd5666ab
User & Date: drh 2011-12-16 15:11:39
Context
2011-12-16
15:38
Merge the fix for [a1fa75cbdd02] from the experimental branch. Also fix the persistent-wal mode feature of truncating the WAL on close so that it always truncates the WAL to zero bytes. check-in: 09ccc4a1 user: drh tags: trunk
15:11
Improved logging of master-journal name conflicts. check-in: b1005ef4 user: drh tags: trunk
13:42
Merge the nx-devkit changes into trunk. check-in: cf3bccc2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  1838   1838   
  1839   1839       /* Select a master journal file name */
  1840   1840       nMainFile = sqlite3Strlen30(zMainFile);
  1841   1841       zMaster = sqlite3MPrintf(db, "%s-mjXXXXXX9XX", zMainFile);
  1842   1842       if( zMaster==0 ) return SQLITE_NOMEM;
  1843   1843       do {
  1844   1844         u32 iRandom;
  1845         -      if( retryCount++>100 ){
  1846         -        sqlite3_log(SQLITE_FULL, "cannot find unique master-journal");
  1847         -        sqlite3OsDelete(pVfs, zMaster, 0);
  1848         -        break;
         1845  +      if( retryCount ){
         1846  +        if( retryCount>100 ){
         1847  +          sqlite3_log(SQLITE_FULL, "MJ delete: %s", zMaster);
         1848  +          sqlite3OsDelete(pVfs, zMaster, 0);
         1849  +          break;
         1850  +        }else if( retryCount==1 ){
         1851  +          sqlite3_log(SQLITE_FULL, "MJ collide: %s", zMaster);
         1852  +        }
  1849   1853         }
         1854  +      retryCount++;
  1850   1855         sqlite3_randomness(sizeof(iRandom), &iRandom);
  1851   1856         sqlite3_snprintf(13, &zMaster[nMainFile], "-mj%06X9%02X",
  1852   1857                                  (iRandom>>8)&0xffffff, iRandom&0xff);
  1853   1858         /* The antipenultimate character of the master journal name must
  1854   1859         ** be "9" to avoid name collisions when using 8+3 filenames. */
  1855   1860         assert( zMaster[sqlite3Strlen30(zMaster)-3]=='9' );
  1856   1861         sqlite3FileSuffix3(zMainFile, zMaster);