/ Check-in [11693849]
Login

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

Overview
Comment:Prevent pagesize changes on VACUUM in encrypted databases even when running the VACUUM on an attached database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:11693849342a308ad929e2d9ead67faabacb523af76128c6973ed6cc8b62c11e
User & Date: drh 2017-06-16 13:43:37
Context
2017-06-16
18:31
Minor refactoring change to clarify how ATTACH works. No functional changes. check-in: 3944a32e user: drh tags: trunk
13:43
Prevent pagesize changes on VACUUM in encrypted databases even when running the VACUUM on an attached database. check-in: 11693849 user: drh tags: trunk
2017-06-15
16:56
Move the "shell_add_schema()" SQL function used by the ".schema" command of the command-line shell to a different spot in the shell.c source file so that it is not in the middle of an unrelated module. check-in: 254617a1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vacuum.c.

197
198
199
200
201
202
203
204
205
206
207
208
209
210
211

  /* A VACUUM cannot change the pagesize of an encrypted database. */
#ifdef SQLITE_HAS_CODEC
  if( db->nextPagesize ){
    extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
    int nKey;
    char *zKey;
    sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
    if( nKey ) db->nextPagesize = 0;
  }
#endif

  sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
  sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0));
  sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL);







|







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211

  /* A VACUUM cannot change the pagesize of an encrypted database. */
#ifdef SQLITE_HAS_CODEC
  if( db->nextPagesize ){
    extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
    int nKey;
    char *zKey;
    sqlite3CodecGetKey(db, iDb, (void**)&zKey, &nKey);
    if( nKey ) db->nextPagesize = 0;
  }
#endif

  sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
  sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0));
  sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL);