/ Check-in [93d92a0a]
Login

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

Overview
Comment:Merge the VACUUM simplification from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vacuum-into
Files: files | file ages | folders
SHA3-256:93d92a0a5d21a1856316c0205ecaa253691b6e5349b552d43027005676d14820
User & Date: drh 2018-12-07 20:40:12
Context
2018-12-07
23:48
Do not allow VACUUM INTO into a file that already exists. check-in: 92f70e0f user: drh tags: vacuum-into
20:40
Merge the VACUUM simplification from trunk. check-in: 93d92a0a user: drh tags: vacuum-into
20:26
Remove a line of code from VACUUM that is no longer needed, due to the change that allows ATTACH to run within a transaction. check-in: a92c398f user: drh tags: trunk
17:28
Prototype implementation for the VACUUM INTO command. check-in: 036e3320 user: drh tags: vacuum-into
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vacuum.c.

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
  nDb = db->nDb;
  rc = execSqlF(db, pzErrMsg, "ATTACH %Q AS vacuum_db", zOut ? zOut : "");
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
  assert( (db->nDb-1)==nDb );
  pDb = &db->aDb[nDb];
  assert( strcmp(pDb->zDbSName,"vacuum_db")==0 );
  pTemp = pDb->pBt;

  /* The call to execSql() to attach the temp database has left the file
  ** locked (as there was more than one active statement when the transaction
  ** to read the schema was concluded. Unlock it here so that this doesn't
  ** cause problems for the call to BtreeSetPageSize() below.  */
  sqlite3BtreeCommit(pTemp);

  nRes = sqlite3BtreeGetOptimalReserve(pMain);

  /* 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;







<
<
<
<
<
<
<







196
197
198
199
200
201
202







203
204
205
206
207
208
209
  nDb = db->nDb;
  rc = execSqlF(db, pzErrMsg, "ATTACH %Q AS vacuum_db", zOut ? zOut : "");
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
  assert( (db->nDb-1)==nDb );
  pDb = &db->aDb[nDb];
  assert( strcmp(pDb->zDbSName,"vacuum_db")==0 );
  pTemp = pDb->pBt;







  nRes = sqlite3BtreeGetOptimalReserve(pMain);

  /* 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;