/* * sqlite3_private.h */#ifndef _SQLITE3_PRIVATE_H#define _SQLITE3_PRIVATE_H/*** Pass the SQLITE_TRUNCATE_DATABASE operation code to sqlite3_file_control() ** to truncate a database and its associated journal file to zero length.*/#define SQLITE_TRUNCATE_DATABASE 101/*** Pass the SQLITE_REPLACE_DATABASE operation code to sqlite3_file_control() ** and a sqlite3 pointer to another open database file to safely copy the ** contents of that database file into the receiving database.*/#define SQLITE_REPLACE_DATABASE 102#endif

set testdir [file dirname $argv0]
source $testdir/tester.tcl
set N 300
# if we're using proxy locks, we use 5 filedescriptors for a db
# that is open and in the middle of writing changes, normally
# sqlite uses 3 (proxy locking adds the conch and the local lock)
set using_proxy 0foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { set using_proxy value}
set num_fd_per_openwrite_db 3
if {$using_proxy>0} {
set num_fd_per_openwrite_db 5
}
# First test how many file descriptors are available for use. To open a
# database for writing SQLite requires 3 file descriptors (the database, the
# journal and the directory).
set filehandles {}

<
<
<
<
<
>

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

set testdir [file dirname $argv0]
source $testdir/tester.tcl
set N 300
# if we're using proxy locks, we use 5 filedescriptors for a db
# that is open and in the middle of writing changes, normally
# sqlite uses 3 (proxy locking adds the conch and the local lock)
set num_fd_per_openwrite_db 3
if {[forced_proxy_locking]} {
set num_fd_per_openwrite_db 5
}
# First test how many file descriptors are available for use. To open a
# database for writing SQLite requires 3 file descriptors (the database, the
# journal and the directory).
set filehandles {}

break
}
}
# if we're using proxy locks, we use 2 filedescriptors for a db
# that is open but NOT yet locked, after a lock is taken we'll have 3,
# normally sqlite uses 1 (proxy locking adds the conch and the local lock)
set using_proxy 0foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { set using_proxy $value}
set extrafds_prelock 0
set extrafds_postlock 0
if {$using_proxy>0} {
set extrafds_prelock 1
set extrafds_postlock 2
}
# $av is currently 0 if this loop iteration is to test with auto-vacuum turned
# off, and 1 if it is turned on. Increment it so that (1 -> no auto-vacuum)
# and (2 -> auto-vacuum). The sole reason for this is so that it looks nicer

<
<
<
<
<
>

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

break
}
}
# if we're using proxy locks, we use 2 filedescriptors for a db
# that is open but NOT yet locked, after a lock is taken we'll have 3,
# normally sqlite uses 1 (proxy locking adds the conch and the local lock)
set extrafds_prelock 0
set extrafds_postlock 0
if {[forced_proxy_locking]} {
set extrafds_prelock 1
set extrafds_postlock 2
}
# $av is currently 0 if this loop iteration is to test with auto-vacuum turned
# off, and 1 if it is turned on. Increment it so that (1 -> no auto-vacuum)
# and (2 -> auto-vacuum). The sole reason for this is so that it looks nicer

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
ifcapable !wal {finish_test ; return }
#-------------------------------------------------------------------------
# This test case demonstrates a flaw in the wal-index manipulation that
# existed at one point: If a process crashes mid-transaction, it may have
# already added some entries to one of the hash-tables in the wal-index.
# If the transaction were to be explicitly rolled back at this point, the

>
>
>
>

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

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/wal_common.tcl
ifcapable !wal {finish_test ; return }
if { ![wal_is_ok] } { finish_test return }
#-------------------------------------------------------------------------
# This test case demonstrates a flaw in the wal-index manipulation that
# existed at one point: If a process crashes mid-transaction, it may have
# already added some entries to one of the hash-tables in the wal-index.
# If the transaction were to be explicitly rolled back at this point, the