Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | VACUUM now uses a temporary file in the official TEMP folder instead of a file in the same directory as the original database. (CVS 3470) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b743429dd54e2dcae213ec1993e9e916 |
User & Date: | drh 2006-10-10 13:07:36.000 |
Context
2006-10-10
| ||
17:37 |
Copy fts1/ to fts2/, changing reference from fts1 to fts2. For future
reference, the source versions copied were:
README.txt r1.1 fts1.c r1.37 fts1.h r1.2 fts1_hash.c r1.1 fts1_hash.h r1.1 fts1_porter.c r1.1 fts1_tokenizer.h r1.4 fts1_tokenizer1.c r1.6 (CVS 3471) (check-in: d0d1e7cdcc user: shess tags: trunk) | |
13:07 | VACUUM now uses a temporary file in the official TEMP folder instead of a file in the same directory as the original database. (CVS 3470) (check-in: b743429dd5 user: drh tags: trunk) | |
2006-10-09
| ||
00:38 | Version 3.3.8 (CVS 3469) (check-in: 0658bb9e3f user: drh tags: trunk) | |
Changes
Changes to src/vacuum.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** This file contains code used to implement the VACUUM command. ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** | | < < < < < < < < < < < < < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ** ************************************************************************* ** This file contains code used to implement the VACUUM command. ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** ** $Id: vacuum.c,v 1.64 2006/10/10 13:07:36 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" #include "os.h" #ifndef SQLITE_OMIT_VACUUM /* ** Execute zSql on database db. Return an error code. */ static int execSql(sqlite3 *db, const char *zSql){ sqlite3_stmt *pStmt; if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){ return sqlite3_errcode(db); |
︙ | ︙ | |||
88 89 90 91 92 93 94 | } /* ** This routine implements the OP_Vacuum opcode of the VDBE. */ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ int rc = SQLITE_OK; /* Return code from service routines */ | < < < | | > < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | } /* ** This routine implements the OP_Vacuum opcode of the VDBE. */ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ int rc = SQLITE_OK; /* Return code from service routines */ Btree *pMain; /* The database being vacuumed */ Btree *pTemp; /* The temporary database we vacuum into */ char *zSql = 0; /* SQL statements */ int saved_flags; /* Saved value of the db->flags */ Db *pDb = 0; /* Database to detach at end of vacuum */ char zTemp[SQLITE_TEMPNAME_SIZE+1]; /* Name of the TEMP file */ /* Save the current value of the write-schema flag before setting it. */ saved_flags = db->flags; db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks; if( !db->autoCommit ){ sqlite3SetString(pzErrMsg, "cannot VACUUM from within a transaction", (char*)0); rc = SQLITE_ERROR; goto end_of_vacuum; } pMain = db->aDb[0].pBt; sqlite3OsTempFileName(zTemp); /* Attach the temporary database as 'vacuum_db'. The synchronous pragma ** can be set to 'off' for this file, as it is not recovered if a crash ** occurs anyway. The integrity of the database is maintained by a ** (possibly synchronous) transaction opened on the main database before ** sqlite3BtreeCopyFile() is called. ** |
︙ | ︙ | |||
303 304 305 306 307 308 309 | sqlite3MallocDisallow(); sqlite3BtreeClose(pDb->pBt); sqlite3MallocAllow(); pDb->pBt = 0; pDb->pSchema = 0; } | < < < < | 255 256 257 258 259 260 261 262 263 264 265 266 267 | sqlite3MallocDisallow(); sqlite3BtreeClose(pDb->pBt); sqlite3MallocAllow(); pDb->pBt = 0; pDb->pSchema = 0; } sqliteFree( zSql ); sqlite3ResetInternalSchema(db, 0); return rc; } #endif /* SQLITE_OMIT_VACUUM */ |