/ Check-in [86bcb9aa]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Remove unreachable branches to facilitate test coverage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 86bcb9aab901713684f978479d29304cc9699e84
User & Date: drh 2010-08-31 01:09:16
Context
2010-08-31
15:02
Add the "circle" test geometry callback to test_rtree.c. And tests for the same. check-in: 169b8ba4 user: dan tags: trunk
01:09
Remove unreachable branches to facilitate test coverage. check-in: 86bcb9aa user: drh tags: trunk
2010-08-30
22:15
Provide hints to the btree layer during the creation of transient tables for when it is possible for those tables to use a hash rather than a binary tree. No use is currently made of those hints, though assert() statement verify their accuracy. check-in: 4fead8e7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  4296   4296     pPager->sjfd = (sqlite3_file*)(pPtr += ROUND8(pVfs->szOsFile));
  4297   4297     pPager->jfd =  (sqlite3_file*)(pPtr += journalFileSize);
  4298   4298     pPager->zFilename =    (char*)(pPtr += journalFileSize);
  4299   4299     assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
  4300   4300   
  4301   4301     /* Fill in the Pager.zFilename and Pager.zJournal buffers, if required. */
  4302   4302     if( zPathname ){
         4303  +    assert( nPathname>0 );
  4303   4304       pPager->zJournal =   (char*)(pPtr += nPathname + 1);
  4304   4305       memcpy(pPager->zFilename, zPathname, nPathname);
  4305   4306       memcpy(pPager->zJournal, zPathname, nPathname);
  4306   4307       memcpy(&pPager->zJournal[nPathname], "-journal", 8);
  4307         -    if( pPager->zFilename[0]==0 ){
  4308         -      pPager->zJournal[0] = 0;
  4309         -    }
  4310   4308   #ifndef SQLITE_OMIT_WAL
  4311         -    else{
  4312         -      pPager->zWal = &pPager->zJournal[nPathname+8+1];
  4313         -      memcpy(pPager->zWal, zPathname, nPathname);
  4314         -      memcpy(&pPager->zWal[nPathname], "-wal", 4);
  4315         -    }
         4309  +    pPager->zWal = &pPager->zJournal[nPathname+8+1];
         4310  +    memcpy(pPager->zWal, zPathname, nPathname);
         4311  +    memcpy(&pPager->zWal[nPathname], "-wal", 4);
  4316   4312   #endif
  4317   4313       sqlite3_free(zPathname);
  4318   4314     }
  4319   4315     pPager->pVfs = pVfs;
  4320   4316     pPager->vfsFlags = vfsFlags;
  4321   4317   
  4322   4318     /* Open the pager file.
  4323   4319     */
  4324         -  if( zFilename && zFilename[0] && !memDb ){
         4320  +  if( zFilename && zFilename[0] ){
  4325   4321       int fout = 0;                    /* VFS flags returned by xOpen() */
  4326   4322       rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
         4323  +    assert( !memDb );
  4327   4324       readOnly = (fout&SQLITE_OPEN_READONLY);
  4328   4325   
  4329   4326       /* If the file was successfully opened for read/write access,
  4330   4327       ** choose a default page size in case we have to create the
  4331   4328       ** database file. The default page size is the maximum of:
  4332   4329       **
  4333   4330       **    + SQLITE_DEFAULT_PAGE_SIZE,

Changes to src/vdbeaux.c.

  1751   1751       ** still have 'null' as the master journal pointer, so they will roll
  1752   1752       ** back independently if a failure occurs.
  1753   1753       */
  1754   1754       for(i=0; i<db->nDb; i++){
  1755   1755         Btree *pBt = db->aDb[i].pBt;
  1756   1756         if( sqlite3BtreeIsInTrans(pBt) ){
  1757   1757           char const *zFile = sqlite3BtreeGetJournalname(pBt);
  1758         -        if( zFile==0 || zFile[0]==0 ){
         1758  +        if( zFile==0 ){
  1759   1759             continue;  /* Ignore TEMP and :memory: databases */
  1760   1760           }
         1761  +        assert( zFile[0]!=0 );
  1761   1762           if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){
  1762   1763             needSync = 1;
  1763   1764           }
  1764   1765           rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset);
  1765   1766           offset += sqlite3Strlen30(zFile)+1;
  1766   1767           if( rc!=SQLITE_OK ){
  1767   1768             sqlite3OsCloseFree(pMaster);