/ Check-in [e48b9f24]
Login

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

Overview
Comment:Open windows files in binary mode. (CVS 193)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e48b9f24faeee606aa2bda1666016d8a00b430a7
User & Date: drh 2001-03-20 12:55:13
Context
2001-03-20
12:55
Open windows files in binary mode. (CVS 1717) check-in: 3adf884b user: drh tags: trunk
12:55
Open windows files in binary mode. (CVS 193) check-in: e48b9f24 user: drh tags: trunk
2001-03-15
18:30
Version 1.0.25 (CVS 478) check-in: 7564b223 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to VERSION.

1
1.0.25
|
1
1.0.26

Changes to doc/report1.txt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48









































































The SQL database used for ACD contains 113 tables and indices implemented
in GDBM.  The following are statistics on the sizes of keys and data
within these tables and indices.

Entries:      962080
Size:         45573853
Avg Size:     48
Key Size:     11045299
Avg Key Size: 12
Max Key Size: 99

    0..8            266    0%
    9..12          5485    0%
   13..16         73633    8%
   17..24        180918   27%
   25..32        209823   48%
   33..40        148995   64%
   41..48         76304   72%
   49..56         14346   73%
   57..64         15725   75%
   65..80         44916   80%
   81..96        127815   93%
   97..112        34769   96%
  113..128        13314   98%
  129..144         8098   99%
  145..160         3355   99%
  161..176         1159   99%
  177..192          629   99%
  193..208          221   99%
  209..224          210   99%
  225..240          129   99%
  241..256           57   99%
  257..288          496   99%
  289..320           60   99%
  321..352           37   99%
  353..384           46   99%
  385..416           22   99%
  417..448           24   99%
  449..480           26   99%
  481..512           27   99%
  513..1024         471   99%
 1025..2048         389   99%
 2049..4096         182   99%
 4097..8192          74   99%
 8193..16384         34   99%
16385..32768         17   99%
32769..65536          5   99%
65537..131073         3  100%









































































|



|
|

|



|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|



|
|
|
|
|

|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
The SQL database used for ACD contains 105 tables and indices implemented
in GDBM.  The following are statistics on the sizes of keys and data
within these tables and indices.

Entries:      967089
Size:         45896104
Avg Size:     48
Key Size:     11112265
Avg Key Size: 12
Max Key Size: 99

    0..8            263    0%
    9..12          5560    0%
   13..16         71394    7%
   17..24        180717   26%
   25..32        215442   48%
   33..40        151118   64%
   41..48         77479   72%
   49..56         13983   74%
   57..64         14481   75%
   65..80         41342   79%
   81..96        127098   92%
   97..112        38054   96%
  113..128        14197   98%
  129..144         8208   99%
  145..160         3326   99%
  161..176         1242   99%
  177..192          604   99%
  193..208          222   99%
  209..224          213   99%
  225..240          132   99%
  241..256           58   99%
  257..288          515   99%
  289..320           64   99%
  321..352           39   99%
  353..384           44   99%
  385..416           25   99%
  417..448           24   99%
  449..480           26   99%
  481..512           27   99%
  513..1024         470   99%
 1025..2048         396   99%
 2049..4096         187   99%
 4097..8192          78   99%
 8193..16384         35   99%
16385..32768         17   99%
32769..65536          6   99%
65537..65541          3  100%

If the indices are omitted, the statistics for the 49 tables
become the following:

Entries:      451103
Size:         30930282
Avg Size:     69
Key Size:     1804412
Avg Key Size: 4
Max Key Size: 4

    0..24            89    0%
   25..32          9417    2%
   33..40        119162   28%
   41..48         68710   43%
   49..56          9539   45%
   57..64         12435   48%
   65..80         38650   57%
   81..96        126877   85%
   97..112        38030   93%
  113..128        14183   96%
  129..144         7668   98%
  145..160         3302   99%
  161..176         1238   99%
  177..192          597   99%
  193..208          217   99%
  209..224          211   99%
  225..240          130   99%
  241..256           57   99%
  257..288          100   99%
  289..320           62   99%
  321..352           34   99%
  353..384           43   99%
  385..416           24   99%
  417..448           24   99%
  449..480           25   99%
  481..512           27   99%
  513..1024         153   99%
 1025..2048          92   99%
 2049..4096           7  100%

The 56 indices have these statistics:

Entries:      512422
Size:         14879828
Avg Size:     30
Key Size:     9253204
Avg Key Size: 19
Max Key Size: 99

    0..8            246    0%
    9..12          5486    1%
   13..16         70717   14%
   17..24        178246   49%
   25..32        205722   89%
   33..40         31951   96%
   41..48          8768   97%
   49..56          4444   98%
   57..64          2046   99%
   65..80          2691   99%
   81..96           202   99%
   97..112           11   99%
  113..144          527   99%
  145..160           20   99%
  161..288          406   99%
  289..1024         316   99%
 1025..2048         304   99%
 2049..4096         180   99%
 4097..8192          78   99%
 8193..16384         35   99%
16385..32768         17   99%
32769..65536          6   99%
65537..65541          3  100%

Changes to src/dbbe.c.

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
94
95
96
97
98
99
100



101

102
103
104
105
106
107
108
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses GDBM as the database backend.  It should be
** relatively simple to convert to a different database such
** as NDBM, SDBM, or BerkeleyDB.
**
** $Id: dbbe.c,v 1.23 2001/01/15 22:51:10 drh Exp $
*/
#include "sqliteInt.h"
#include <unistd.h>

/*
** This routine opens a new database.  It looks at the first
** few characters of the database name to try to determine what
................................................................................
  zFile = 0;
  do{
    sqliteRandomName(zBuf, "/_temp_file_");
    sqliteFree(zFile);
    zFile = 0;
    sqliteSetString(&zFile, zDir, zBuf, 0);
  }while( access(zFile,0)==0 && limit-- >= 0 );



  *ppFile = pBe->apTemp[i] = fopen(zFile, "w+");

  if( pBe->apTemp[i]==0 ){
    rc = SQLITE_ERROR;
    sqliteFree(zFile);
    pBe->azTemp[i] = 0;
  }else{
    pBe->azTemp[i] = zFile;
  }







|







 







>
>
>

>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses GDBM as the database backend.  It should be
** relatively simple to convert to a different database such
** as NDBM, SDBM, or BerkeleyDB.
**
** $Id: dbbe.c,v 1.24 2001/03/20 12:55:14 drh Exp $
*/
#include "sqliteInt.h"
#include <unistd.h>

/*
** This routine opens a new database.  It looks at the first
** few characters of the database name to try to determine what
................................................................................
  zFile = 0;
  do{
    sqliteRandomName(zBuf, "/_temp_file_");
    sqliteFree(zFile);
    zFile = 0;
    sqliteSetString(&zFile, zDir, zBuf, 0);
  }while( access(zFile,0)==0 && limit-- >= 0 );
#if OS_WIN
  *ppFile = pBe->apTemp[i] = fopen(zFile, "w+b");
#else
  *ppFile = pBe->apTemp[i] = fopen(zFile, "w+");
#endif
  if( pBe->apTemp[i]==0 ){
    rc = SQLITE_ERROR;
    sqliteFree(zFile);
    pBe->azTemp[i] = 0;
  }else{
    pBe->azTemp[i] = zFile;
  }

Changes to src/dbbemem.c.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
717
718
719
720
721
722
723

724




725
726
727
728
729
730
731
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash table as the database backend. 
**
** $Id: dbbemem.c,v 1.8 2001/02/19 23:48:17 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>

................................................................................
}

/*
** Open a temporary file.  The file is located in the current working
** directory.
*/
static int sqliteMemOpenTempFile(Dbbe *pDbbe, FILE **ppFile){

  const char *zTemps[] = { "/usr/tmp", "/var/tmp", "/tmp", "/temp", 0};




  const char *zDir;
  int i;
  struct stat statbuf;
  for(i=0; zTemps[i]; i++){
    zDir = zTemps[i];
    if( stat(zDir, &statbuf)==0 && S_ISDIR(statbuf.st_mode) 
      && access(zDir, W_OK|X_OK)==0 ){







|







 







>

>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
...
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash table as the database backend. 
**
** $Id: dbbemem.c,v 1.9 2001/03/20 12:55:14 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>

................................................................................
}

/*
** Open a temporary file.  The file is located in the current working
** directory.
*/
static int sqliteMemOpenTempFile(Dbbe *pDbbe, FILE **ppFile){
#if OS_UNIX
  const char *zTemps[] = { "/usr/tmp", "/var/tmp", "/tmp", "/temp", 0};
#endif
#if OS_WIN
  const char *zTemps[] = { "c:/temp", "c:", 0};
#endif
  const char *zDir;
  int i;
  struct stat statbuf;
  for(i=0; zTemps[i]; i++){
    zDir = zTemps[i];
    if( stat(zDir, &statbuf)==0 && S_ISDIR(statbuf.st_mode) 
      && access(zDir, W_OK|X_OK)==0 ){

Changes to test/dbbe.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67


68
69
70
71
72
73
74
..
95
96
97
98
99
100
101


102
103
104
105
106
107
108
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is exercising the code in dbbe.c.
#
# $Id: dbbe.test,v 1.5 2001/01/31 13:28:09 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to open a database that does not exist.
#
do_test dbbe-1.1 {
................................................................................
  forcedelete testdb
  set fd [open testdb w]
  puts $fd hi!
  close $fd
  set v [catch {sqlite db testdb 0666} msg]
  lappend v $msg
} {1 {not a directory: "testdb"}}



# Access permission denied on the directory.
#
do_test dbbe-1.5 {
  catch {db close}
  forcedelete testdb
  file mkdir testdb
................................................................................
  sqlite db testdb 0666
  execsql {CREATE TABLE t1(x int)}
  db close
  file attributes testdb/sqlite_master.tbl -permission 0444
  set v [catch {sqlite db testdb 0444} msg]
  lappend v $msg
} {0 {}}



# Make sure a table can be accessed by either uppercase or lowercase
# names
#
do_test dbbe-2.1 {
  catch {db close}
  forcedelete testdb







|







 







>
>







 







>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is exercising the code in dbbe.c.
#
# $Id: dbbe.test,v 1.6 2001/03/20 12:55:14 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to open a database that does not exist.
#
do_test dbbe-1.1 {
................................................................................
  forcedelete testdb
  set fd [open testdb w]
  puts $fd hi!
  close $fd
  set v [catch {sqlite db testdb 0666} msg]
  lappend v $msg
} {1 {not a directory: "testdb"}}

if {$::tcl_platform(platform)!="windows"} {

# Access permission denied on the directory.
#
do_test dbbe-1.5 {
  catch {db close}
  forcedelete testdb
  file mkdir testdb
................................................................................
  sqlite db testdb 0666
  execsql {CREATE TABLE t1(x int)}
  db close
  file attributes testdb/sqlite_master.tbl -permission 0444
  set v [catch {sqlite db testdb 0444} msg]
  lappend v $msg
} {0 {}}

} ;# End of if( platform!=windows )

# Make sure a table can be accessed by either uppercase or lowercase
# names
#
do_test dbbe-2.1 {
  catch {db close}
  forcedelete testdb

Changes to test/delete.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
74
75
76
77
78
79
80
81







































82
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the DELETE FROM statement.
#
# $Id: delete.test,v 1.6 2000/06/21 13:59:13 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to delete from a non-existant table.
#
do_test delete-1.1 {
................................................................................
  lappend v $msg
} {1 {no such column: f3}}

do_test delete-4.2 {
  set v [catch {execsql {DELETE FROM table2 WHERE xyzzy(f1+4)}} msg]
  lappend v $msg
} {1 {no such function: xyzzy}}








































finish_test







|







 








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the DELETE FROM statement.
#
# $Id: delete.test,v 1.7 2001/03/20 12:55:14 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to delete from a non-existant table.
#
do_test delete-1.1 {
................................................................................
  lappend v $msg
} {1 {no such column: f3}}

do_test delete-4.2 {
  set v [catch {execsql {DELETE FROM table2 WHERE xyzzy(f1+4)}} msg]
  lappend v $msg
} {1 {no such function: xyzzy}}

# Lots of deletes
#
do_test delete-5.1 {
  execsql {DELETE FROM table1}
  execsql {SELECT count(*) FROM table1}
} {}
do_test delete-5.2 {
  for {set i 1} {$i<=200} {incr i} {
     execsql "INSERT INTO table1 VALUES($i,[expr {$i*$i}])"
  }
  execsql {SELECT count(*) FROM table1}
} {200}
do_test delete-5.3 {
  for {set i 1} {$i<=200} {incr i 4} {
     execsql "DELETE FROM table1 WHERE f1==$i"
  }
  execsql {SELECT count(*) FROM table1}
} {150}
do_test delete-5.4 {
  execsql "DELETE FROM table1 WHERE f1>50"
  execsql {SELECT count(*) FROM table1}
} {37}
do_test delete-5.5 {
  for {set i 1} {$i<=70} {incr i 3} {
     execsql "DELETE FROM table1 WHERE f1==$i"
  }
  execsql {SELECT f1 FROM table1 ORDER BY f1}
} {2 3 6 8 11 12 14 15 18 20 23 24 26 27 30 32 35 36 38 39 42 44 47 48 50}
do_test delete-5.6 {
  for {set i 1} {$i<40} {incr i} {
     execsql "DELETE FROM table1 WHERE f1==$i"
  }
  execsql {SELECT f1 FROM table1 ORDER BY f1}
} {42 44 47 48 50}
do_test delete-5.7 {
  execsql "DELETE FROM table1 WHERE f1!=48"
  execsql {SELECT f1 FROM table1 ORDER BY f1}
} {48}

finish_test

Changes to test/lock.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is database locks.
#
# $Id: lock.test,v 1.6 2001/03/15 18:21:22 drh Exp $

if {$dbprefix=="gdbm:"} {

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Create a largish table
#
do_test lock-1.0 {







|

|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is database locks.
#
# $Id: lock.test,v 1.7 2001/03/20 12:55:14 drh Exp $

if {$dbprefix=="gdbm:" && $::tcl_platform(platform)!="windows"} {

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Create a largish table
#
do_test lock-1.0 {

Changes to test/main.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
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
107
108
109
110

111
112
113
114
115
116
117
118

119
120
121
122
123
124
125
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is exercising the code in main.c.
#
# $Id: main.test,v 1.4 2000/12/10 18:23:52 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Tests of the sqlite_complete() function.
#
do_test main-1.1 {
................................................................................
  }
} {1}

# Try to open a database with a corrupt master file.
#
do_test main-2.0 {
  catch {db close}

  file delete -force testdb
  file mkdir testdb
  set fd [open testdb/sqlite_master.tbl w]
  puts $fd hi!
  close $fd
  set v [catch {sqlite db testdb} msg]
  lappend v $msg
} {0 {}}

# Here are some tests for tokenize.c.  
#
do_test main-3.1 {
  catch {db close}

  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT * from T1 where x!!5}} msg]
  lappend v $msg
} {1 {unrecognized token: "!!"}}
do_test main-3.2 {
  catch {db close}

  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT * from T1 where ~x}} msg]
  lappend v $msg
} {1 {unrecognized token: "~"}}
do_test main-3.3 {
  catch {db close}

  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT a|b from T1 where x}} msg]
  lappend v $msg
} {1 {unrecognized token: "|"}}

do_test main-3.3 {
  catch {db close}

  file delete -force testdb
  sqlite db testdb
  execsql {
    create table T1(X REAL);
    insert into T1 values(.5);
    insert into T1 values(0.5e2);
    insert into T1 values(0.5e-002);







|







 







>













>







>







>








>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is exercising the code in main.c.
#
# $Id: main.test,v 1.5 2001/03/20 12:55:14 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Tests of the sqlite_complete() function.
#
do_test main-1.1 {
................................................................................
  }
} {1}

# Try to open a database with a corrupt master file.
#
do_test main-2.0 {
  catch {db close}
  foreach f [glob -nocomplain testdb/*] {file delete -force $f}
  file delete -force testdb
  file mkdir testdb
  set fd [open testdb/sqlite_master.tbl w]
  puts $fd hi!
  close $fd
  set v [catch {sqlite db testdb} msg]
  lappend v $msg
} {0 {}}

# Here are some tests for tokenize.c.  
#
do_test main-3.1 {
  catch {db close}
  foreach f [glob -nocomplain testdb/*] {file delete -force $f}
  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT * from T1 where x!!5}} msg]
  lappend v $msg
} {1 {unrecognized token: "!!"}}
do_test main-3.2 {
  catch {db close}
  foreach f [glob -nocomplain testdb/*] {file delete -force $f}
  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT * from T1 where ~x}} msg]
  lappend v $msg
} {1 {unrecognized token: "~"}}
do_test main-3.3 {
  catch {db close}
  foreach f [glob -nocomplain testdb/*] {file delete -force $f}
  file delete -force testdb
  sqlite db testdb
  set v [catch {execsql {SELECT a|b from T1 where x}} msg]
  lappend v $msg
} {1 {unrecognized token: "|"}}

do_test main-3.3 {
  catch {db close}
  foreach f [glob -nocomplain testdb/*] {file delete -force $f}
  file delete -force testdb
  sqlite db testdb
  execsql {
    create table T1(X REAL);
    insert into T1 values(.5);
    insert into T1 values(0.5e2);
    insert into T1 values(0.5e-002);

Changes to test/tester.tcl.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38



39
40
41
42
43
44
45
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.11 2001/03/15 18:21:22 drh Exp $

# Create a test database
#
if {![info exists dbprefix]} {
  if {[info exists env(SQLITE_PREFIX)]} {
    set dbprefix $env(SQLITE_PREFIX):
  } else {
    set dbprefix "gdbm:"
  }
}
switch $dbprefix {
  gdbm: {



   if {[catch {file delete -force testdb}]} {
     exec rm -rf testdb
   }
   file mkdir testdb
  }
  memory: {
   # do nothing







|












>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.12 2001/03/20 12:55:14 drh Exp $

# Create a test database
#
if {![info exists dbprefix]} {
  if {[info exists env(SQLITE_PREFIX)]} {
    set dbprefix $env(SQLITE_PREFIX):
  } else {
    set dbprefix "gdbm:"
  }
}
switch $dbprefix {
  gdbm: {
   foreach f [glob -nocomplain testdb/*] {
     catch {file delete -force $f}
   }
   if {[catch {file delete -force testdb}]} {
     exec rm -rf testdb
   }
   file mkdir testdb
  }
  memory: {
   # do nothing

Changes to test/vacuum.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
76
77
78
79

80
81
82
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum.test,v 1.2 2000/10/19 14:10:10 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to vacuum a non-existant table.
#
do_test vacuum-1.1 {
................................................................................
  after 1000
  execsql {VACUUM test1}
  set a1 [file mtime testdb/test1.tbl]
  set a2 [file mtime testdb/test2.tbl]
  set a3 [file mtime testdb/index1.tbl]
  expr {$a1>$b1 && $a2==$b2 && $a3==$b3}
} {1}

testif gdbm:
do_test vacuum-1.4 {
  set b1 [file mtime testdb/test1.tbl]
  set b2 [file mtime testdb/test2.tbl]
  set b3 [file mtime testdb/index1.tbl]
  after 1000
  execsql {VACUUM}
  set a1 [file mtime testdb/test1.tbl]
  set a2 [file mtime testdb/test2.tbl]
  set a3 [file mtime testdb/index1.tbl]
  expr {$a1>$b1 && $a2>$b2 && $a3>$b3}
} {1}



finish_test







|







 







>












>

<

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

83
#   drh@hwaci.com
#   http://www.hwaci.com/drh/
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum.test,v 1.3 2001/03/20 12:55:14 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Try to vacuum a non-existant table.
#
do_test vacuum-1.1 {
................................................................................
  after 1000
  execsql {VACUUM test1}
  set a1 [file mtime testdb/test1.tbl]
  set a2 [file mtime testdb/test2.tbl]
  set a3 [file mtime testdb/index1.tbl]
  expr {$a1>$b1 && $a2==$b2 && $a3==$b3}
} {1}
if {$::tcl_platform(platform)!="windows"} {
testif gdbm:
do_test vacuum-1.4 {
  set b1 [file mtime testdb/test1.tbl]
  set b2 [file mtime testdb/test2.tbl]
  set b3 [file mtime testdb/index1.tbl]
  after 1000
  execsql {VACUUM}
  set a1 [file mtime testdb/test1.tbl]
  set a2 [file mtime testdb/test2.tbl]
  set a3 [file mtime testdb/index1.tbl]
  expr {$a1>$b1 && $a2>$b2 && $a3>$b3}
} {1}
} ;# End if( platform!=windows )


finish_test

Changes to www/changes.tcl.

12
13
14
15
16
17
18





19
20
21
22
23
24
25
}


proc chng {date desc} {
  puts "<DT><B>$date</B></DT>"
  puts "<DD><P><UL>$desc</UL></P></DD>"
}






chng {2001 Mar 15 (1.0.25)} {
<li>Modify the test scripts to identify tests that depend on system
    load and processor speed and
    to warn the user that a failure of one of those (rare) tests does
    not necessarily mean the library is malfunctioning.  No changes to
    code.







>
>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
}


proc chng {date desc} {
  puts "<DT><B>$date</B></DT>"
  puts "<DD><P><UL>$desc</UL></P></DD>"
}

chng {2001 Mar 20 (1.0.26)} {
<li>A serious bug fixed on Windows.  Windows users should upgrade.
    No impact to Unix.</li>
}

chng {2001 Mar 15 (1.0.25)} {
<li>Modify the test scripts to identify tests that depend on system
    load and processor speed and
    to warn the user that a failure of one of those (rare) tests does
    not necessarily mean the library is malfunctioning.  No changes to
    code.