/ Check-in [7bb63363]
Login

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

Overview
Comment:Add comments to explain the role of the ota vfs.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update-no-pager_ota_mode
Files: files | file ages | folders
SHA1: 7bb633639d1e41067903a49653f09a823054e213
User & Date: dan 2015-02-07 20:20:32
Context
2015-02-09
20:07
Add the sqlite3ota_create_vfs() and sqlite3ota_destroy_vfs() functions. check-in: 96443ecb user: dan tags: ota-update-no-pager_ota_mode
2015-02-07
20:20
Add comments to explain the role of the ota vfs. check-in: 7bb63363 user: dan tags: ota-update-no-pager_ota_mode
19:17
Remove "PRAGMA pager_ota_mode". check-in: 8ac58e46 user: dan tags: ota-update-no-pager_ota_mode
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/ota/sqlite3ota.c.

  2149   2149     return pOta->nProgress;
  2150   2150   }
  2151   2151   
  2152   2152   /**************************************************************************
  2153   2153   ** Beginning of OTA VFS shim methods. The VFS shim modifies the behaviour
  2154   2154   ** of a standard VFS in the following ways:
  2155   2155   **
  2156         -**   TODO
         2156  +**   1. Whenever the first page of an OTA target database file is read or 
         2157  +**      written, the value of the change-counter cookie is stored in
         2158  +**      sqlite3ota.iCookie. This ensures that, so long as a read transaction
         2159  +**      is held on the db file, the value of sqlite3ota.iCookie matches
         2160  +**      that stored on disk.
         2161  +**
         2162  +**   2. When the ota handle is in OTA_STAGE_OAL or OTA_STAGE_CKPT state, all
         2163  +**      EXCLUSIVE lock attempts on the target database fail. This prevents
         2164  +**      sqlite3_close() from running an automatic checkpoint. Until the
         2165  +**      ota handle reaches OTA_STAGE_DONE - at that point the automatic
         2166  +**      checkpoint may be required to delete the *-wal file.
         2167  +**
         2168  +**   3. In OTA_STAGE_OAL, the *-shm file is stored in memory. All xShmLock()
         2169  +**      calls are noops.
         2170  +**
         2171  +**   4. In OTA_STAGE_OAL mode, when SQLite calls xAccess() to check if a
         2172  +**      *-wal file associated with the target database exists, the following
         2173  +**      special handling applies:
         2174  +**
         2175  +**        a) if the *-wal file does exist, return SQLITE_CANTOPEN. An OTA
         2176  +**           target database may not be in wal mode already.
         2177  +**
         2178  +**        b) if the *-wal file does not exist, set the output parameter to
         2179  +**           non-zero (to tell SQLite that it does exist) anyway.
         2180  +**
         2181  +**   5. In OTA_STAGE_OAL mode, if SQLite tries to open a *-wal file 
         2182  +**      associated with a target database, open the corresponding *-oal file
         2183  +**      instead.
  2157   2184   */
  2158   2185   
  2159         -#if 0
  2160         -#define OTA_FILE_VANILLA    0
  2161         -#define OTA_FILE_TARGET_DB  1
  2162         -#define OTA_FILE_TARGET_WAL 2
  2163         -#endif
  2164         -
  2165   2186   typedef struct ota_file ota_file;
  2166   2187   typedef struct ota_vfs ota_vfs;
  2167   2188   
  2168   2189   struct ota_file {
  2169   2190     sqlite3_file base;              /* sqlite3_file methods */
  2170   2191     sqlite3_file *pReal;            /* Underlying file handle */
  2171   2192     ota_vfs *pOtaVfs;               /* Pointer to the ota_vfs object */