SQLite

Check-in [22d5324073]
Login

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

Overview
Comment:Fix a #ifdefs that are used to comment-out the VACUUM command. (CVS 970)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 22d5324073a727627d4294870a441fa2316fb049
User & Date: drh 2003-05-13 00:21:59.000
Context
2003-05-13
00:24
Remove unnecessary "#include <sqliteInt.h>" from the shell code. (CVS 971) (check-in: 6e5c497a42 user: drh tags: trunk)
00:21
Fix a #ifdefs that are used to comment-out the VACUUM command. (CVS 970) (check-in: 22d5324073 user: drh tags: trunk)
2003-05-12
23:06
Make sure hash functions always return non-negative. (CVS 969) (check-in: 39a3e403f0 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vacuum.c.
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.6 2003/04/25 15:37:58 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"

#define SQLITE_OMIT_VACUUM 1

/*
** A structure for holding a dynamic string - a string that can grow
** without bound. 
*/
typedef struct dynStr dynStr;
struct dynStr {
  char *z;        /* Text of the string in space obtained from sqliteMalloc() */







|




<
<







10
11
12
13
14
15
16
17
18
19
20
21


22
23
24
25
26
27
28
**
*************************************************************************
** 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.7 2003/05/13 00:21:59 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"



/*
** A structure for holding a dynamic string - a string that can grow
** without bound. 
*/
typedef struct dynStr dynStr;
struct dynStr {
  char *z;        /* Text of the string in space obtained from sqliteMalloc() */
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  sqlite *dbNew;       /* New database */
  Parse *pParse;       /* The parser context */
  const char *zTable;  /* Name of a table being copied */
  const char *zPragma; /* Pragma to execute with results */
  dynStr s1, s2;       /* Two dynamic strings */
};

#ifdef SQLITE_OMIT_VACUUM
/*
** Append text to a dynamic string
*/
static void appendText(dynStr *p, const char *zText, int nText){
  if( nText<0 ) nText = strlen(zText);
  if( p->z==0 || p->nUsed + nText + 1 >= p->nAlloc ){
    char *zNew;







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  sqlite *dbNew;       /* New database */
  Parse *pParse;       /* The parser context */
  const char *zTable;  /* Name of a table being copied */
  const char *zPragma; /* Pragma to execute with results */
  dynStr s1, s2;       /* Two dynamic strings */
};

#if !defined(SQLITE_OMIT_VACUUM) || SQLITE_OMIT_VACUUM
/*
** Append text to a dynamic string
*/
static void appendText(dynStr *p, const char *zText, int nText){
  if( nText<0 ) nText = strlen(zText);
  if( p->z==0 || p->nUsed + nText + 1 >= p->nAlloc ){
    char *zNew;
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
**
** In version 1.0.x of SQLite, the VACUUM command would call
** gdbm_reorganize() on all the database tables.  But beginning
** with 2.0.0, SQLite no longer uses GDBM so this command has
** become a no-op.
*/
void sqliteVacuum(Parse *pParse, Token *pTableName){
#ifdef SQLITE_OMIT_VACUUM
  const char *zFilename;  /* full pathname of the database file */
  int nFilename;          /* number of characters  in zFilename[] */
  char *zTemp = 0;        /* a temporary file in same directory as zFilename */
  sqlite *dbNew = 0;      /* The new vacuumed database */
  sqlite *db;             /* The original database */
  int rc = SQLITE_OK;     /* Return code from service routines */
  int i;                  /* Loop counter */







|







199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
**
** In version 1.0.x of SQLite, the VACUUM command would call
** gdbm_reorganize() on all the database tables.  But beginning
** with 2.0.0, SQLite no longer uses GDBM so this command has
** become a no-op.
*/
void sqliteVacuum(Parse *pParse, Token *pTableName){
#if !defined(SQLITE_OMIT_VACUUM) || SQLITE_OMIT_VACUUM
  const char *zFilename;  /* full pathname of the database file */
  int nFilename;          /* number of characters  in zFilename[] */
  char *zTemp = 0;        /* a temporary file in same directory as zFilename */
  sqlite *dbNew = 0;      /* The new vacuumed database */
  sqlite *db;             /* The original database */
  int rc = SQLITE_OK;     /* Return code from service routines */
  int i;                  /* Loop counter */