/ Check-in [437c7e21]
Login

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

Overview
Comment:Add header comments for new methods in pager.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA1: 437c7e219d3240767a28f73487bc26c3be3044b3
User & Date: dan 2015-08-27 19:57:16
Wiki:begin-concurrent
Context
2015-08-28
09:27
Merge latest trunk changes with this branch. check-in: 57bc0194 user: dan tags: begin-concurrent
2015-08-27
19:57
Add header comments for new methods in pager.c. check-in: 437c7e21 user: dan tags: begin-concurrent
19:22
Add test cases for concurrent transactions and long-lived SELECT statements. check-in: fd4798cb user: dan tags: begin-concurrent
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1738   1738         assert( rc==SQLITE_OK || rc==SQLITE_NOMEM );
  1739   1739       }
  1740   1740     }
  1741   1741     return rc;
  1742   1742   }
  1743   1743   
  1744   1744   #ifdef SQLITE_ENABLE_CONCURRENT
         1745  +/*
         1746  +** If they are not already, begin recording all pages read from the pager layer
         1747  +** by the b-tree layer This is used by concurrent transactions. Return
         1748  +** SQLITE_OK if successful, or an SQLite error code (SQLITE_NOMEM) if an error
         1749  +** occurs.
         1750  +*/
  1745   1751   int sqlite3PagerBeginConcurrent(Pager *pPager){
  1746   1752     int rc = SQLITE_OK;
  1747   1753     if( pPager->pAllRead==0 ){
  1748   1754       pPager->pAllRead = sqlite3BitvecCreate(pPager->dbSize);
  1749   1755       if( pPager->pAllRead==0 ){
  1750   1756         rc = SQLITE_NOMEM;
  1751   1757       }
  1752   1758     }
  1753   1759     return rc;
  1754   1760   }
  1755   1761   
         1762  +/*
         1763  +** Stop recording all pages read from the pager layer by the b-tree layer
         1764  +** and discard any current records.
         1765  +*/
  1756   1766   void sqlite3PagerEndConcurrent(Pager *pPager){
  1757   1767     sqlite3BitvecDestroy(pPager->pAllRead);
  1758   1768     pPager->pAllRead = 0;
  1759   1769   }
  1760   1770   
         1771  +/*
         1772  +** Return true if the database is in wal mode. False otherwise.
         1773  +*/
  1761   1774   int sqlite3PagerIsWal(Pager *pPager){
  1762   1775     return pPager->pWal!=0;
  1763   1776   }
  1764   1777   #endif
  1765   1778   
  1766   1779   /*
  1767   1780   ** Free the Pager.pInJournal and Pager.pAllRead bitvec objects.