summaryrefslogtreecommitdiff
path: root/db/test
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-11-11 15:58:46 +0000
committerjbj <devnull@localhost>2004-11-11 15:58:46 +0000
commitacf19af1ab27ad071c1614f9610ae29eb5c902c1 (patch)
treeeec4be5e0c491d0171d25c17eaa136ce62a90417 /db/test
parentf9473219d523ace837a3ef5a1212bb6dcad2a690 (diff)
downloadrpm-acf19af1ab27ad071c1614f9610ae29eb5c902c1.tar.gz
rpm-acf19af1ab27ad071c1614f9610ae29eb5c902c1.tar.bz2
rpm-acf19af1ab27ad071c1614f9610ae29eb5c902c1.zip
Upgrade to db-4.3.21.
CVS patchset: 7578 CVS date: 2004/11/11 15:58:46
Diffstat (limited to 'db/test')
-rw-r--r--db/test/TESTS17
-rw-r--r--db/test/recd008.tcl37
-rw-r--r--db/test/rep005.tcl28
-rw-r--r--db/test/rep012.tcl90
-rw-r--r--db/test/reputils.tcl7
-rw-r--r--db/test/scr001/chk.code4
-rw-r--r--db/test/scr008/chk.pubdef2
-rw-r--r--db/test/scr010/spell.ok13
-rw-r--r--db/test/scr013/chk.stats4
-rw-r--r--db/test/scr021/chk.flags166
-rw-r--r--db/test/scr030/chk.build17
-rw-r--r--db/test/sdb010.tcl8
-rw-r--r--db/test/sdb013.tcl185
-rw-r--r--db/test/sec002.tcl3
-rw-r--r--db/test/si001.tcl4
-rw-r--r--db/test/si002.tcl4
-rw-r--r--db/test/si003.tcl4
-rw-r--r--db/test/si004.tcl4
-rw-r--r--db/test/si005.tcl4
-rw-r--r--db/test/sijointest.tcl15
-rw-r--r--db/test/siutils.tcl80
-rw-r--r--db/test/test.tcl9
-rw-r--r--db/test/test075.tcl205
-rw-r--r--db/test/test080.tcl129
-rw-r--r--db/test/upgrade.tcl15
25 files changed, 352 insertions, 702 deletions
diff --git a/db/test/TESTS b/db/test/TESTS
index 5885ed557..5392aa7c3 100644
--- a/db/test/TESTS
+++ b/db/test/TESTS
@@ -508,6 +508,7 @@ rep012
Replication and dead DB handles.
Run a modified version of test001 in a replicated master env.
+ Run in replicated environment with secondary indices too.
Make additional changes to master, but not to the client.
Downgrade the master and upgrade the client with open db handles.
Verify that the roll back on clients gives dead db handles.
@@ -894,13 +895,6 @@ sdb012
are open works correctly, and in the face of txns.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sdb013
- Tests in-memory subdatabases.
- Create an in-memory subdb. Test for persistence after
- overflowing the cache. Test for conflicts when we have
- two in-memory files.
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
sdbtest001
Tests multiple access methods in one subdb
Open several subdbs, each with a different access method
@@ -1632,11 +1626,6 @@ test074
Test of DB_NEXT_NODUP.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-test075
- Test of DB->rename().
- (formerly test of DB_TRUNCATE cached page invalidation [#1487])
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
test076
Test creation of many small databases in a single environment. [#1528].
@@ -1657,10 +1646,6 @@ test079
small fraction of the entries going on overflow pages.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-test080
- Test of DB->remove()
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
test081
Test off-page duplicates and overflow pages together with
very large keys (key/data as file contents).
diff --git a/db/test/recd008.tcl b/db/test/recd008.tcl
index 764fc6893..b12c75785 100644
--- a/db/test/recd008.tcl
+++ b/db/test/recd008.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 1996-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: recd008.tcl,v 1.28 2004/01/28 03:36:28 bostic Exp $
+# $Id: recd008.tcl,v 1.30 2004/11/05 00:59:01 mjc Exp $
#
# TEST recd008
# TEST Test deeply nested transactions and many-child transactions.
@@ -14,10 +14,6 @@ proc recd008 { method {breadth 4} {depth 4} args} {
set args [convert_args $method $args]
set omethod [convert_method $method]
- if { [is_record_based $method] == 1 } {
- puts "Recd008 skipping for method $method"
- return
- }
puts "Recd008: $method $breadth X $depth deeply nested transactions"
# Create the database and environment.
@@ -34,7 +30,7 @@ proc recd008 { method {breadth 4} {depth 4} args} {
set did [open $dict]
set count 0
while { [gets $did str] != -1 && $count < 1000 } {
- if { [string compare $omethod "-recno"] == 0 } {
+ if { [is_record_based $method] == 1 } {
set key [expr $count + 1]
} else {
set key $str
@@ -43,7 +39,7 @@ proc recd008 { method {breadth 4} {depth 4} args} {
set p1 $key
set kvals($p1) $str
}
- set ret [$db put $key $str]
+ set ret [$db put $key [chop_data $method $str]]
error_check_good put $ret 0
incr count
@@ -57,7 +53,8 @@ proc recd008 { method {breadth 4} {depth 4} args} {
}
puts "\tRecd008.b: create environment for $txn_max transactions"
- set eflags "-mode 0644 -create -txn_max $txn_max \
+ set lock_max 2500
+ set eflags "-mode 0644 -create -lock_max $lock_max -txn_max $txn_max \
-txn -home $testdir"
set env_cmd "berkdb_env $eflags"
set dbenv [eval $env_cmd]
@@ -66,9 +63,9 @@ proc recd008 { method {breadth 4} {depth 4} args} {
reset_env $dbenv
set rlist {
- { {recd008_parent abort ENV DB $p1 TXNID 1 1 $breadth $depth}
+ { {recd008_parent abort ENV DB $method $p1 TXNID 1 1 $breadth $depth}
"Recd008.c: child abort parent" }
- { {recd008_parent commit ENV DB $p1 TXNID 1 1 $breadth $depth}
+ { {recd008_parent commit ENV DB $method $p1 TXNID 1 1 $breadth $depth}
"Recd008.d: child commit parent" }
}
foreach pair $rlist {
@@ -95,6 +92,7 @@ proc recd008_setkval { dbfile p1 } {
set db [berkdb_open $testdir/$dbfile]
error_check_good dbopen [is_valid_db $db] TRUE
set ret [$db get $p1]
+ error_check_good dbclose [$db close] 0
set kvals($p1) [lindex [lindex $ret 0] 1]
}
@@ -114,7 +112,7 @@ proc recd008_setkval { dbfile p1 } {
# Parent commit/abort (in op_recover)
# (Final file)
# Recovery test (in op_recover)
-proc recd008_parent { op env db p1key parent b0 d0 breadth depth } {
+proc recd008_parent { op env db method p1key parent b0 d0 breadth depth } {
global kvals
source ./include.tcl
@@ -122,7 +120,7 @@ proc recd008_parent { op env db p1key parent b0 d0 breadth depth } {
# Save copy of original data
# Acquire lock on data
#
- set olddata $kvals($p1key)
+ set olddata [pad_data $method $kvals($p1key)]
set ret [$db get -rmw -txn $parent $p1key]
set Dret [lindex [lindex $ret 0] 1]
error_check_good get_parent_RMW $Dret $olddata
@@ -130,7 +128,7 @@ proc recd008_parent { op env db p1key parent b0 d0 breadth depth } {
#
# Parent spawns off children
#
- set ret [recd008_txn $op $env $db $p1key $parent \
+ set ret [recd008_txn $op $env $db $method $p1key $parent \
$b0 $d0 $breadth $depth]
puts "Child runs complete. Parent modifies data."
@@ -139,7 +137,7 @@ proc recd008_parent { op env db p1key parent b0 d0 breadth depth } {
# Parent modifies p1
#
set newdata $olddata.parent
- set ret [$db put -txn $parent $p1key $newdata]
+ set ret [$db put -txn $parent $p1key [chop_data $method $newdata]]
error_check_good db_put $ret 0
#
@@ -156,7 +154,7 @@ proc recd008_parent { op env db p1key parent b0 d0 breadth depth } {
return 0
}
-proc recd008_txn { op env db p1key parent b0 d0 breadth depth } {
+proc recd008_txn { op env db method p1key parent b0 d0 breadth depth } {
global log_log_record_types
global kvals
source ./include.tcl
@@ -176,7 +174,7 @@ proc recd008_txn { op env db p1key parent b0 d0 breadth depth } {
error_check_good txn_begin [is_valid_txn $t $env] TRUE
set startd [expr $d0 + 1]
set child $b:$startd:$t
- set olddata $kvals($p1key)
+ set olddata [pad_data $method $kvals($p1key)]
set newdata $olddata.$child
set ret [$db get -rmw -txn $t $p1key]
set Dret [lindex [lindex $ret 0] 1]
@@ -186,15 +184,15 @@ proc recd008_txn { op env db p1key parent b0 d0 breadth depth } {
# Recursively call to set up nested transactions/children
#
for {set d $startd} {$d <= $depth} {incr d} {
- set ret [recd008_txn commit $env $db $p1key $t \
+ set ret [recd008_txn commit $env $db $method $p1key $t \
$b $d $breadth $depth]
- set ret [recd008_txn abort $env $db $p1key $t \
+ set ret [recd008_txn abort $env $db $method $p1key $t \
$b $d $breadth $depth]
}
#
# Modifies p1.
#
- set ret [$db put -txn $t $p1key $newdata]
+ set ret [$db put -txn $t $p1key [chop_data $method $newdata]]
error_check_good db_put $ret 0
#
@@ -210,6 +208,7 @@ proc recd008_txn { op env db p1key parent b0 d0 breadth depth } {
}
set ret [$db get -rmw -txn $parent $p1key]
set Dret [lindex [lindex $ret 0] 1]
+ set newdata [pad_data $method $newdata]
switch $op {
"commit" {
puts "Command executed and committed."
diff --git a/db/test/rep005.tcl b/db/test/rep005.tcl
index 82bbb32f8..517fa955d 100644
--- a/db/test/rep005.tcl
+++ b/db/test/rep005.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2002-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: rep005.tcl,v 11.40 2004/09/22 18:01:05 bostic Exp $
+# $Id: rep005.tcl,v 11.41 2004/10/15 15:41:56 sue Exp $
#
# TEST rep005
# TEST Replication election test with error handling.
@@ -139,7 +139,7 @@ proc rep005_sub { method tnum niter nclients logset recargs largs } {
foreach c2 $c2err {
set elist [list $c0 $c1 $c2]
rep005_elect env_cmd envlist $qdir \
- $m $count win last_win $elist
+ $m $count win last_win $elist $logset
incr count
}
}
@@ -156,7 +156,8 @@ proc rep005_sub { method tnum niter nclients logset recargs largs } {
puts [clock format [clock seconds] -format "%H:%M %D"]
}
-proc rep005_elect { ecmd celist qdir msg count winner lsn_lose elist } {
+proc rep005_elect { ecmd celist qdir msg count \
+ winner lsn_lose elist logset} {
global elect_timeout elect_serial
global is_windows_test
upvar $ecmd env_cmd
@@ -240,6 +241,8 @@ proc rep005_elect { ecmd celist qdir msg count winner lsn_lose elist } {
set lsn_len [expr [llength $lsn_win] - 1]
set lsn_index [berkdb random_int 0 $lsn_len]
set rec_arg ""
+ set win_inmem [expr [string compare [lindex $logset \
+ [expr $win + 1]] in-memory] == 0]
if { [lindex $lsn_win $lsn_index] == 1 } {
set last_win $win
set dirindex [lsearch -exact $env_cmd($win) "-home"]
@@ -248,7 +251,6 @@ proc rep005_elect { ecmd celist qdir msg count winner lsn_lose elist } {
env_cleanup $lsn_dir
puts -nonewline "and cleaning "
} else {
- set last_win -1
#
# If we're not cleaning the env, decide if we should
# run recovery upon reopening the env. This causes
@@ -265,6 +267,22 @@ proc rep005_elect { ecmd celist qdir msg count winner lsn_lose elist } {
if { [lindex $rec_win $rec_index] == 1 } {
puts -nonewline "and recovering "
set rec_arg "-recover"
+ #
+ # If we're in memory and about to run
+ # recovery, we force ourselves not to win
+ # the next election because recovery will
+ # blow away the entire log in memory.
+ # However, we don't skip this entirely
+ # because we still want to force reading
+ # of __db.rep.egen.
+ #
+ if { $win_inmem } {
+ set last_win $win
+ } else {
+ set last_win -1
+ }
+ } else {
+ set last_win -1
}
}
puts "new master, new client $win"
@@ -276,7 +294,7 @@ proc rep005_elect { ecmd celist qdir msg count winner lsn_lose elist } {
# new Tcl handle name in there.
set newel "$clientenv($win) [expr $win + 2]"
set envlist [lreplace $envlist $win $win $newel]
- if { $rec_arg == "" } {
+ if { $rec_arg == "" || $win_inmem } {
set win -1
}
#
diff --git a/db/test/rep012.tcl b/db/test/rep012.tcl
index 640f2dbd9..c2e16cc2f 100644
--- a/db/test/rep012.tcl
+++ b/db/test/rep012.tcl
@@ -3,12 +3,13 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: rep012.tcl,v 11.12 2004/09/22 18:01:06 bostic Exp $
+# $Id: rep012.tcl,v 11.14 2004/10/18 14:46:35 carol Exp $
#
# TEST rep012
# TEST Replication and dead DB handles.
# TEST
# TEST Run a modified version of test001 in a replicated master env.
+# TEST Run in replicated environment with secondary indices too.
# TEST Make additional changes to master, but not to the client.
# TEST Downgrade the master and upgrade the client with open db handles.
# TEST Verify that the roll back on clients gives dead db handles.
@@ -38,6 +39,8 @@ proc rep012 { method { niter 10 } { tnum "012" } args } {
proc rep012_sub { method niter tnum logset recargs largs } {
global testdir
+ global verbose_check_secondaries
+
env_cleanup $testdir
set orig_tdir $testdir
@@ -104,11 +107,30 @@ proc rep012_sub { method niter tnum logset recargs largs } {
error_check_good client2_env [is_valid_env $cl2env] TRUE
set testfile "test$tnum.db"
+ set pname "primary$tnum.db"
+ set sname "secondary$tnum.db"
set omethod [convert_method $method]
set env0db [eval {berkdb_open_noerr -env $env0 -auto_commit \
- -create -mode 0644} $largs $omethod $testfile]
- set masterdb $env0db
+ -create -mode 0644} $largs $omethod $testfile]
error_check_good dbopen [is_valid_db $env0db] TRUE
+ set masterdb $env0db
+
+ set do_secondary 0
+ if { [is_btree $method] || [is_hash $method] } {
+ set do_secondary 1
+ # Open the primary
+ set mpdb [eval {berkdb_open_noerr -env $env0 -auto_commit \
+ -create -mode 0644} $largs $omethod $pname]
+ error_check_good dbopen [is_valid_db $mpdb] TRUE
+
+ # Open the secondary
+ # Open a 2nd handle to the same secondary
+ set msdb [eval {berkdb_open_noerr -env $env0 -auto_commit \
+ -create -mode 0644} $largs $omethod $sname]
+ error_check_good dbopen [is_valid_db $msdb] TRUE
+ error_check_good associate [$mpdb associate -auto_commit \
+ [callback_n 0] $msdb] 0
+ }
# Bring the clients online by processing the startup messages.
set envlist "{$env0 1} {$env1 2} {$cl2env 3}"
@@ -123,12 +145,23 @@ proc rep012_sub { method niter tnum logset recargs largs } {
error_check_good dbopen [is_valid_db $env2db] TRUE
# Run a modified test001 in the master (and update clients).
- puts "\tRep$tnum.a: Running test001 in replicated env."
+ puts "\tRep$tnum.a.0: Running rep_test in replicated env."
eval rep_test $method $masterenv $masterdb $niter 0 0
process_msgs $envlist
+ if { $do_secondary } {
+ # Put some data into the primary
+ puts "\tRep$tnum.a.1: Putting primary/secondary data on master."
+ eval rep012_sec $method $mpdb $niter keys data
+ process_msgs $envlist
+
+ set verbose_check_secondaries 1
+ check_secondaries $mpdb $msdb $niter keys data "Rep$tnum.b"
+ } else {
+ puts "\tRep$tnum.b: Skipping secondaries for method $method"
+ }
set nstart $niter
- puts "\tRep$tnum.b: Run test in master and client 2 only"
+ puts "\tRep$tnum.c: Run test in master and client 2 only"
eval rep_test $method $masterenv $masterdb $niter $nstart $nstart
# Ignore messages for $env1.
@@ -138,7 +171,7 @@ proc rep012_sub { method niter tnum logset recargs largs } {
# Nuke those for client about to become master.
replclear 2
tclsleep 3
- puts "\tRep$tnum.c: Swap envs"
+ puts "\tRep$tnum.d: Swap envs"
set tmp $masterenv
set masterenv $clientenv
set clientenv $tmp
@@ -151,7 +184,7 @@ proc rep012_sub { method niter tnum logset recargs largs } {
# At this point, env0 should have rolled back across a txn commit.
# If we do any operation on env0db, we should get an error that
# the handle is dead.
- puts "\tRep$tnum.d: Try to access db handle after rollback"
+ puts "\tRep$tnum.e: Try to access db handle after rollback"
set stat1 [catch {$env0db stat} ret1]
error_check_good stat1 $stat1 1
error_check_good dead1 [is_substr $ret1 DB_REP_HANDLE_DEAD] 1
@@ -160,7 +193,24 @@ proc rep012_sub { method niter tnum logset recargs largs } {
error_check_good stat3 $stat3 1
error_check_good dead3 [is_substr $ret3 DB_REP_HANDLE_DEAD] 1
- puts "\tRep$tnum.e: Closing"
+ if { $do_secondary } {
+ #
+ # Check both secondary get and close to detect DEAD_HANDLE.
+ #
+ puts "\tRep$tnum.f: Try to access secondary db handles after rollback"
+ set verbose_check_secondaries 1
+ check_secondaries $mpdb $msdb $niter \
+ keys data "Rep$tnum.f" errp errs errsg
+ error_check_good deadp [is_substr $errp DB_REP_HANDLE_DEAD] 1
+ error_check_good deads [is_substr $errs DB_REP_HANDLE_DEAD] 1
+ error_check_good deadsg [is_substr $errsg DB_REP_HANDLE_DEAD] 1
+ puts "\tRep$tnum.g: Closing"
+ error_check_good mpdb [$mpdb close] 0
+ error_check_good msdb [$msdb close] 0
+ } else {
+ puts "\tRep$tnum.f: Closing"
+ }
+
error_check_good env0db [$env0db close] 0
error_check_good env1db [$env1db close] 0
error_check_good cl2db [$env2db close] 0
@@ -168,6 +218,30 @@ proc rep012_sub { method niter tnum logset recargs largs } {
error_check_good env1_close [$env1 close] 0
error_check_good cl2_close [$cl2env close] 0
replclose $testdir/MSGQUEUEDIR
+ set verbose_check_secondaries 0
set testdir $orig_tdir
return
}
+
+proc rep012_sec {method pdb niter keysp datap} {
+ source ./include.tcl
+
+ upvar $keysp keys
+ upvar $datap data
+ set did [open $dict]
+ for { set n 0 } { [gets $did str] != -1 && $n < $niter } { incr n } {
+ if { [is_record_based $method] == 1 } {
+ set key [expr $n + 1]
+ set datum $str
+ } else {
+ set key $str
+ gets $did datum
+ }
+ set keys($n) $key
+ set data($n) [pad_data $method $datum]
+
+ set ret [$pdb put -auto_commit $key [chop_data $method $datum]]
+ error_check_good put($n) $ret 0
+ }
+ close $did
+}
diff --git a/db/test/reputils.tcl b/db/test/reputils.tcl
index 2bff9623b..f25da575a 100644
--- a/db/test/reputils.tcl
+++ b/db/test/reputils.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: reputils.tcl,v 11.83 2004/09/22 18:01:06 bostic Exp $
+# $Id: reputils.tcl,v 11.84 2004/11/03 18:50:52 carol Exp $
#
# Replication testing utilities
@@ -871,6 +871,7 @@ proc setpriority { priority nclients winner {start 0} } {
proc run_election { ecmd celist errcmd priority crsh qdir msg elector \
nsites nvotes nclients win {reopen 0} {dbname "test.db"} } {
global elect_timeout elect_serial
+ global is_hp_test
global is_windows_test
global rand_init
upvar $ecmd env_cmd
@@ -903,8 +904,8 @@ proc run_election { ecmd celist errcmd priority crsh qdir msg elector \
expected winner is $win (eid [expr $win + 2])"
incr elect_serial
set pfx "CHILD$elector.$elect_serial"
- # Windows requires a longer timeout.
- if { $is_windows_test == 1 } {
+ # Windows and HP-UX require a longer timeout.
+ if { $is_windows_test == 1 || $is_hp_test == 1 } {
set elect_timeout [expr $elect_timeout * 3]
}
set elect_pipe($elector) [start_election \
diff --git a/db/test/scr001/chk.code b/db/test/scr001/chk.code
index af1af5ab3..159524d27 100644
--- a/db/test/scr001/chk.code
+++ b/db/test/scr001/chk.code
@@ -1,10 +1,10 @@
#!/bin/sh -
#
-# $Id: chk.code,v 1.13 2003/11/21 02:10:42 bostic Exp $
+# $Id: chk.code,v 1.14 2004/11/08 14:45:07 bostic Exp $
#
# Check to make sure that the code samples in the documents build.
-d=../../../db.docs
+d=../../../db_docs
[ -d $d ] || {
echo 'FAIL: cannot find source distribution directory.'
diff --git a/db/test/scr008/chk.pubdef b/db/test/scr008/chk.pubdef
index 027e701d5..f5e66ccbc 100644
--- a/db/test/scr008/chk.pubdef
+++ b/db/test/scr008/chk.pubdef
@@ -3,7 +3,7 @@
# Reconcile the list of public defines with the man pages and the Java files.
d=../..
-docs=$d/../docs_src
+docs=$d/../db_docs
[ -f $d/LICENSE ] || {
echo 'FAIL: cannot find source distribution directory.'
diff --git a/db/test/scr010/spell.ok b/db/test/scr010/spell.ok
index 36d096d41..6a557279b 100644
--- a/db/test/scr010/spell.ok
+++ b/db/test/scr010/spell.ok
@@ -113,6 +113,7 @@ CKPLSN
CL
CLASSPATH
CLOSEFP
+CLR
CLRDBC
CLpsvxX
CMP
@@ -320,6 +321,7 @@ DeadlockException
Debian
DeleteInfo
Deref'ing
+Dir
Dups
EAGAIN
EBUSY
@@ -743,7 +745,7 @@ Malloc
MapEntry
MapViewOfFile
Margo
-MarshalledEntity
+MarshalledEnt
MarshalledEntityBinding
MarshalledKey
MarshalledKeyBinding
@@ -1242,6 +1244,7 @@ TPS
TRU
TRUNC
TRUNCDATA
+TSTRING
TXN
TXNAPP
TXNHEAD
@@ -1336,6 +1339,7 @@ UMRW
UNAVAIL
UNDEF
UNDOC
+UNICODE
UNISTD
UNREF
UOC
@@ -1725,6 +1729,7 @@ curslen
curslist
cursp
cursq
+cutlim
cxx
cxxproc
cxxthis
@@ -1883,6 +1888,7 @@ dst
dsync
dtab
dtabsize
+dumptree
dup
dup'ed
dupcompare
@@ -2642,6 +2648,7 @@ msg's
msgadd
msgbuf
msgcall
+msgdbt
msgfile
msgfp
msgs
@@ -2697,6 +2704,7 @@ ndeadlocks
ndir
ndx
needswap
+neg
nelem
nelemp
nentries
@@ -2775,6 +2783,7 @@ np
npages
npgno
nprocs
+nptr
nr
nread
nreaders
@@ -3544,6 +3553,7 @@ umalloc
uncorrect
undef
undeleting
+undo'ing
undodup
undosplit
uni
@@ -3684,3 +3694,4 @@ zero'd
zeroeth
zerofill
zipcode
+zl
diff --git a/db/test/scr013/chk.stats b/db/test/scr013/chk.stats
index 0b320757b..7ee71392e 100644
--- a/db/test/scr013/chk.stats
+++ b/db/test/scr013/chk.stats
@@ -1,13 +1,13 @@
#!/bin/sh -
#
-# $Id: chk.stats,v 1.8 2004/09/28 18:29:59 bostic Exp $
+# $Id: chk.stats,v 1.9 2004/11/08 14:49:42 bostic Exp $
#
# Check to make sure all of the stat structure members are included in
# all of the possible formats.
# Top-level directory.
d=../..
-docs=../../../db.docs
+docs=../../../db_docs
# Path names are from a top-level directory.
[ -f $d/README ] || {
diff --git a/db/test/scr021/chk.flags b/db/test/scr021/chk.flags
index fe291b577..2f32b82e6 100644
--- a/db/test/scr021/chk.flags
+++ b/db/test/scr021/chk.flags
@@ -1,115 +1,109 @@
#!/bin/sh -
#
-# $Id: chk.flags,v 1.11 2004/03/12 14:57:15 bostic Exp $
+# $Id: chk.flags,v 1.12 2004/10/19 02:28:19 bostic Exp $
#
# Check flag name-spaces.
d=../..
-
t1=__1
+t2=__2
-echo ===============================================
-echo Checking for DB_ENV flags.
-echo ===============================================
-# Check for DB_ENV flags.
-(grep 'F_ISSET([^ ]*dbenv,' $d/*/*.[chys];
- grep 'F_SET([^ ]*dbenv,' $d/*/*.[chys];
- grep 'F_CLR([^ ]*dbenv,' $d/*/*.[chys]) |
- sed -e '/DB_ENV_/d' \
- -e '/env_method.c.*mapped_flag/d' \
- -e '/F_SET([^ ]*dbenv, db_env_reset)/d' > $t1
-[ -s $t1 ] && {
- cat $t1
+if cc -g -Wall -I.. t.c -o t; then
+ :
+else
+ echo "FAIL: unable to compile test program t.c"
+ exit 1
+fi
+
+if ./t $d/*/*.[ch] $d/*/*.in > $t1; then
+ :
+else
+ echo "FAIL: test program failed"
+ exit 1
+fi
+
+echo Checking DB_ENV flags...
+cat $t1 |
+grep '(dbenv,' |
+sed -e '/DB_ENV_/d' \
+ -e '/env_method.c.*, mapped_flags*)/d' \
+ -e '/env_region.c.*, db_env_reset)/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-grep 'DB_ENV_' $d/*/*.c |
-sed -e '/F_.*dbenv,/d' \
- -e '/DB_ENV_TEST_RECOVERY(.*DB_TEST_/d' \
- -e '/env_method.c.*outflagsp,/d' \
- -e '/\/libdb_java\//d' \
- -e '/{ DB_ENV_/d' > $t1
-[ -s $t1 ] && {
- cat $t1
+grep 'DB_ENV_' $t1 |
+sed -e '/((*dbenv)*,/d' \
+ -e '/((*dbp)*->dbenv,/d' \
+ -e '/((*infop)*->dbenv,/d' \
+ -e '/((*reginfop)*->dbenv,/d' \
+ -e '/((*sdbp)*->dbenv,/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-echo ===============================================
-echo Checking for DB flags.
-echo ===============================================
-# Check for DB flags.
-(grep 'F_ISSET([^ ]*dbp,' $d/*/*.[chys];
- grep 'F_SET([^ ]*dbp,' $d/*/*.[chys];
- grep 'F_CLR([^ ]*dbp,' $d/*/*.[chys]) |
- sed -e '/DB_AM_/d' \
- -e '/db_method.c.*mapped_flag/d' \
- -e '/db.c:.*F_SET.*F_ISSET(subdbp,/d' \
- -e '/db.c:.*F_ISSET(dbp,/d' > $t1
-[ -s $t1 ] && {
- cat $t1
+echo Checking DB flags...
+cp $t1 /tmp/_f
+cat $t1 |
+grep '(dbp,' |
+sed -e '/DB_AM_/d' \
+ -e '/dbp, mapped_flag)/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-grep 'DB_AM_' $d/*/*.c |
-sed -e '/ DB_AM_RECNUM\./d' \
- -e '/ DB_AM_RECOVER set\./d' \
- -e '/"DB->open", dbp->flags, DB_AM_DUP,/d' \
- -e '/"DB_NODUPDATA" behavior for databases with/d' \
- -e '/:[ {]*DB_AM_/d' \
- -e '/DB_AM_RECOVER bit in this handle, so that the/d' \
- -e '/F_.*db_rep->rep_db,/d' \
- -e '/F_.*dbp/d' \
- -e '/If DB_AM_OPEN_CALLED is not set, then we/d' \
- -e '/This was checked in set_flags when DB_AM_ENCRYPT/d' \
- -e '/XA_ABORT, we can safely set DB_AM_RECOVER/d' \
- -e '/_method.c.*outflagsp,/d' \
- -e '/db_pr.c:.*LF_ISSET(DB_AM_FIXEDLEN)/d' \
- -e '/db_pr.c:.*LF_ISSET(DB_AM_RENUMBER)/d' \
- -e '/isdup = dbp->flags & DB_AM_DUP/d' \
- -e '/otherwise we simply do/d' \
- -e '/pginfo/d' \
- -e '/qam_method.c:.*LF_ISSET(DB_AM_DISCARD)/d' \
- -e '/setting DB_AM_RECOVER, we guarantee that we don/d' \
- -e '/the DB_AM_SWAP flag. However, we use/d' \
- > $t1
-[ -s $t1 ] && {
- cat $t1
+grep 'DB_AM_' $t1 |
+sed -e '/((*[ ]*db_rep->rep_db)*,/d' \
+ -e '/((*[ ]*dbc)*->dbp,/d' \
+ -e '/((*[ ]*dbc_arg->dbp)*,/d' \
+ -e '/((*[ ]*dbp)*,/d' \
+ -e '/((*[ ]*dbp)*->s_primary,/d' \
+ -e '/((D),/d' \
+ -e '/(mdbp,/d' \
+ -e '/(pdbp,/d' \
+ -e '/(pginfo, /d' \
+ -e '/(sdbp,/d' \
+ -e '/(subdbp,/d' \
+ -e '/fop_util.c:.*(t2dbp,/d' \
+ -e '/rep_backup.c.*(rfp,/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-echo ===============================================
-echo Checking for DBC flags.
-echo ===============================================
-# Check for DBC flags.
-(grep 'F_ISSET([^ ]*dbc,' $d/*/*.[chys];
- grep 'F_SET([^ ]*dbc,' $d/*/*.[chys];
- grep 'F_CLR([^ ]*dbc,' $d/*/*.[chys]) |
- sed -e '/DBC_/d' > $t1
-[ -s $t1 ] && {
- cat $t1
+echo Checking DBC flags...
+cat $t1 |
+grep '(dbc,' |
+sed -e '/DBC_/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-grep 'DBC_' $d/*/*.c |
-sed -e '/F_.*dbc/d' \
- -e '/DBC_INTERNAL/d' \
- -e '/DBC_LOGGING/d' \
- -e '/Do the actual get. Set DBC_TRANSIENT/d' \
- -e '/If DBC_WRITEDUP is set, the cursor is an in/d' \
- -e '/The DBC_TRANSIENT flag indicates that we/d' \
- -e '/This function replaces the DBC_CONTINUE and DBC_KEYSET/d' \
- -e '/dbc_n->flags .. dbc_orig->flags . .DBC_OWN_LID/d' \
- -e '/db_cam.c:.*F_CLR(opd, DBC_ACTIVE);/d' \
- -e '/{ DBC_/d' > $t1
-[ -s $t1 ] && {
- cat $t1
+grep 'DBC_' $t1 |
+sed -e '/((*dbc)*,/d' \
+ -e '/(dbc_arg,/d' \
+ -e '/(dbc_c,/d' \
+ -e '/(dbc_n,/d' \
+ -e '/(dbc_orig,/d' \
+ -e '/(opd,/d' \
+ -e '/(pdbc,/d' \
+ -e '/(sdbc,/d' \
+ > $t2
+[ -s $t2 ] && {
+ cat $t2
exit 1
}
-echo ===============================================
-echo Checking macros.
-echo ===============================================
-# Check for bad use of macros.
+echo Checking for bad use of macros...
egrep 'case .*F_SET\(|case .*F_CLR\(' $d/*/*.c > $t1
egrep 'for .*F_SET\(|for .*F_CLR\(' $d/*/*.c >> $t1
egrep 'if .*F_SET\(|if .*F_CLR\(' $d/*/*.c >> $t1
diff --git a/db/test/scr030/chk.build b/db/test/scr030/chk.build
index 1dddc52f4..a77f6957c 100644
--- a/db/test/scr030/chk.build
+++ b/db/test/scr030/chk.build
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: chk.build,v 1.2 2004/09/28 17:18:24 bostic Exp $
+# $Id: chk.build,v 1.4 2004/10/29 20:03:49 bostic Exp $
#
# Build a program that calls the run-time API configuration functions.
@@ -48,6 +48,21 @@ r()
echo "$i: FAILED in configure"
exit 1
fi
+ (echo /^CFLAGS=/ &&
+ echo \
+ 's/-c /-c -W -Werror -Wall -Wpointer-arith -Wmissing-prototypes /p' &&
+ echo '/^db_server_svc.*: db_server_svc.c$/' &&
+ echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
+ echo '/^db_server_xdr.*: db_server_xdr.c$/' &&
+ echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
+ echo '/^gen_db_server.*: gen_db_server.c$/' &&
+ echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
+ echo '/^db_java_wrap.*: .*db_java_wrap.c$/' &&
+ echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
+ echo '/^tcl_db_pkg.*: .*tcl_db_pkg.c$/' &&
+ echo '+1s/\$(CFLAGS)/-c \$(CPPFLAGS)/' &&
+ echo w &&
+ echo q) | ed Makefile > /dev/null
make > mklog 2>&1
if test $? -ne 0; then
echo "$i: FAILED in make"
diff --git a/db/test/sdb010.tcl b/db/test/sdb010.tcl
index 73ff8292c..8f1d6f8a1 100644
--- a/db/test/sdb010.tcl
+++ b/db/test/sdb010.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2000-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: sdb010.tcl,v 11.18 2004/09/24 14:55:26 carol Exp $
+# $Id: sdb010.tcl,v 11.19 2004/10/18 17:34:17 carol Exp $
#
# TEST sdb010
# TEST Test DB->remove() method and DB->truncate() for subdbs
@@ -162,5 +162,9 @@ proc sdb010 { method args } {
error_check_good db_close [$db close] 0
error_check_good db_close [$db2 close] 0
- puts "\tSubdb010 succeeded."
+
+ # If we created our env, close it.
+ if { $eindex == -1 } {
+ error_check_good env_close [$env close] 0
+ }
}
diff --git a/db/test/sdb013.tcl b/db/test/sdb013.tcl
deleted file mode 100644
index 70d23413e..000000000
--- a/db/test/sdb013.tcl
+++ /dev/null
@@ -1,185 +0,0 @@
-# See the file LICENSE for redistribution information.
-#
-# Copyright (c) 1999-2004
-# Sleepycat Software. All rights reserved.
-#
-# $Id: sdb013.tcl,v 1.3 2004/09/22 18:01:06 bostic Exp $
-#
-# TEST sdb013
-# TEST Tests in-memory subdatabases.
-# TEST Create an in-memory subdb. Test for persistence after
-# TEST overflowing the cache. Test for conflicts when we have
-# TEST two in-memory files.
-
-proc sdb013 { method { nentries 10 } args } {
- source ./include.tcl
-
- set tnum "013"
- set args [convert_args $method $args]
- set omethod [convert_method $method]
-
- if { [is_queue $method] == 1 } {
- puts "Subdb$tnum: skipping for method $method"
- return
- }
- puts "Subdb$tnum: $method ($args) in-memory subdb tests"
-
- # If we are using an env, then skip this test. It needs its own.
- set eindex [lsearch -exact $args "-env"]
- if { $eindex != -1 } {
- set env NULL
- incr eindex
- set env [lindex $args $eindex]
- puts "Subdb013 skipping for env $env"
- return
- }
-
- # Create the env, with a very small cache that we can easily
- # fill.
- env_cleanup $testdir
- set csize {0 32768 1}
- set env [berkdb_env -create -cachesize $csize -home $testdir -txn]
- error_check_good dbenv [is_valid_env $env] TRUE
-
- # Set filename to NULL; this causes the creation of an in-memory
- # subdb.
- set testfile ""
- set subdb subdb0
-
- puts "\tSubdb$tnum.a: Create in-mem subdb, add data, close."
- set sdb [eval {berkdb_open -create -mode 0644} \
- $args -env $env {$omethod $testfile $subdb}]
- error_check_good dbopen [is_valid_db $sdb] TRUE
-
- sdb013_populate $sdb $method $nentries
- error_check_good sdb_close [$sdb close] 0
-
- # Do a bunch of writing to evict all pages from the memory pool.
- puts "\tSubdb$tnum.b: Create another db, overflow the cache."
- set dummyfile foo.db
- set db [eval {berkdb_open -create -mode 0644} $args -env $env\
- $omethod $dummyfile]
- error_check_good dummy_open [is_valid_db $db] TRUE
-
- set entries [expr $nentries * 100]
- sdb013_populate $db $method $entries
- error_check_good dummy_close [$db close] 0
-
- # Make sure we can still open the in-memory subdb.
- puts "\tSubdb$tnum.c: Check we can still open the in-mem subdb."
- set sdb [eval {berkdb_open} \
- $args -env $env {$omethod $testfile $subdb}]
- error_check_good sdb_reopen [is_valid_db $sdb] TRUE
- error_check_good sdb_close [$sdb close] 0
-
- puts "\tSubdb$tnum.d: Remove in-mem subdb."
- error_check_good \
- sdb_remove [berkdb dbremove -env $env $testfile $subdb] 0
-
- puts "\tSubdb$tnum.e: Check we cannot open the in-mem subdb."
- set ret [catch {eval {berkdb_open_noerr} -env $env $args \
- {$omethod $testfile $subdb}} db]
- error_check_bad dbopen $ret 0
-
- # Create two in-memory subdb and test for conflicts. Try all the
- # combinations of named (NULL/NAME) and purely temporary
- # (NULL/NULL) databases.
- #
- foreach s1 { S1 "" } {
- foreach s2 { S2 "" } {
- puts "\tSubdb$tnum.f:\
- 2 in-memory subdbs (NULL/$s1, NULL/$s2)."
- set sdb1 [eval {berkdb_open -create -mode 0644} \
- $args -env $env {$omethod $testfile $s1}]
-puts "sdb1 open"
- error_check_good sdb1_open [is_valid_db $sdb1] TRUE
-puts "open sdb2 with testfile $testfile s2 $s2"
- set sdb2 [eval {berkdb_open -create -mode 0644} \
- $args -env $env {$omethod $testfile $s2}]
-puts "sdb2 open"
- error_check_good sdb1_open [is_valid_db $sdb2] TRUE
-
- # Subdatabases are open, now put something in.
- set string1 STRING1
- set string2 STRING2
-puts "populate"
- for { set i 1 } { $i <= $nentries } { incr i } {
- set key $i
- error_check_good sdb1_put \
- [$sdb1 put $key $string1.$key] 0
- error_check_good sdb2_put \
- [$sdb2 put $key $string2.$key] 0
- }
-puts "check contents"
- # If the subs are both NULL/NULL, we have two handles
- # on the same db. Skip testing the contents.
- if { $s1 != "" || $s2 != "" } {
- # This can't work when both subs are NULL/NULL.
- # Check contents.
- for { set i 1 } { $i <= $nentries } { incr i } {
- set key $i
- set ret1 [lindex \
- [lindex [$sdb1 get $key] 0] 1]
- error_check_good \
- sdb1_get $ret1 $string1.$key
- set ret2 [lindex \
- [lindex [$sdb2 get $key] 0] 1]
- error_check_good \
- sdb2_get $ret2 $string2.$key
- }
-puts "close sdb1"
- error_check_good sdb1_close [$sdb1 close] 0
-puts "close sdb2"
- error_check_good sdb2_close [$sdb2 close] 0
-
- # Reopen, make sure we get the right data.
- set sdb1 [eval {berkdb_open -mode 0644} \
- $args -env $env {$omethod $testfile $s1}]
- error_check_good \
- sdb1_open [is_valid_db $sdb1] TRUE
- set sdb2 [eval {berkdb_open -mode 0644} \
- $args -env $env {$omethod $testfile $s2}]
- error_check_good \
- sdb1_open [is_valid_db $sdb2] TRUE
-
- for { set i 1 } { $i <= $nentries } { incr i } {
- set key $i
- set ret1 [lindex \
- [lindex [$sdb1 get $key] 0] 1]
- error_check_good \
- sdb1_get $ret1 $string1.$key
- set ret2 [lindex \
- [lindex [$sdb2 get $key] 0] 1]
- error_check_good \
- sdb2_get $ret2 $string2.$key
- }
- }
- error_check_good sdb1_close [$sdb1 close] 0
- error_check_good sdb2_close [$sdb2 close] 0
- }
- }
- error_check_good env_close [$env close] 0
-}
-
-proc sdb013_populate { db method nentries } {
- source ./include.tcl
-
- set did [open $dict]
- set count 0
- while { [gets $did str] != -1 && $count < $nentries } {
- if { [is_record_based $method] == 1 } {
- set key [expr $count + 1]
- } else {
- set key $str
- }
- set ret [eval \
- {$db put $key [chop_data $method $str]}]
- error_check_good put $ret 0
-
- set ret [eval {$db get $key}]
- error_check_good \
- get $ret [list [list $key [pad_data $method $str]]]
- incr count
- }
- close $did
-}
diff --git a/db/test/sec002.tcl b/db/test/sec002.tcl
index 80d5a5879..5bdd4af3b 100644
--- a/db/test/sec002.tcl
+++ b/db/test/sec002.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 1999-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: sec002.tcl,v 11.12 2004/02/20 19:47:58 sue Exp $
+# $Id: sec002.tcl,v 11.13 2004/11/02 16:12:04 carol Exp $
#
# TEST sec002
# TEST Test of security interface and catching errors in the
@@ -130,6 +130,7 @@ proc sec002 { } {
# Forcing the error which causes DB_RUNRECOVERY to be
# returned ends up leaving open files that cannot be removed.
if { $is_windows_test == 1 } {
+ cleanup $testdir NULL 1
puts "Skipping remainder of test for Windows"
return
}
diff --git a/db/test/si001.tcl b/db/test/si001.tcl
index 4aca7e449..e5cffc0e1 100644
--- a/db/test/si001.tcl
+++ b/db/test/si001.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: si001.tcl,v 1.16 2004/09/22 18:01:06 bostic Exp $
+# $Id: si001.tcl,v 1.18 2004/10/27 20:40:25 carol Exp $
#
# TEST si001
# TEST Basic secondary index put/delete test
@@ -37,7 +37,7 @@ proc si001 { methods {nentries 200} {tnum "001"} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Si$tnum ($pmethod/$methods) $nentries equal key/data pairs"
+ puts "si$tnum \{\[ list $pmethod $methods \]\} $nentries"
env_cleanup $testdir
set pname "primary$tnum.db"
diff --git a/db/test/si002.tcl b/db/test/si002.tcl
index 039fbb6a7..9e38c8a98 100644
--- a/db/test/si002.tcl
+++ b/db/test/si002.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: si002.tcl,v 1.12 2004/05/28 14:33:26 carol Exp $
+# $Id: si002.tcl,v 1.14 2004/10/27 20:40:25 carol Exp $
#
# TEST si002
# TEST Basic cursor-based secondary index put/delete test
@@ -37,7 +37,7 @@ proc si002 { methods {nentries 200} {tnum "002"} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Si$tnum ($pmethod/$methods) $nentries equal key/data pairs"
+ puts "si$tnum \{\[ list $pmethod $methods \]\} $nentries"
env_cleanup $testdir
set pname "primary$tnum.db"
diff --git a/db/test/si003.tcl b/db/test/si003.tcl
index c80583ea2..60ddba6a3 100644
--- a/db/test/si003.tcl
+++ b/db/test/si003.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: si003.tcl,v 1.10 2004/01/28 03:36:30 bostic Exp $
+# $Id: si003.tcl,v 1.12 2004/10/27 20:40:25 carol Exp $
#
# TEST si003
# TEST si001 with secondaries created and closed mid-test
@@ -37,7 +37,7 @@ proc si003 { methods {nentries 200} {tnum "003"} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Si$tnum ($pmethod/$methods) $nentries equal key/data pairs"
+ puts "si$tnum \{\[ list $pmethod $methods \]\} $nentries"
env_cleanup $testdir
set pname "primary$tnum.db"
diff --git a/db/test/si004.tcl b/db/test/si004.tcl
index 99db2061d..08af8b261 100644
--- a/db/test/si004.tcl
+++ b/db/test/si004.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: si004.tcl,v 1.10 2004/01/28 03:36:30 bostic Exp $
+# $Id: si004.tcl,v 1.12 2004/10/27 20:40:25 carol Exp $
#
# TEST si004
# TEST si002 with secondaries created and closed mid-test
@@ -37,7 +37,7 @@ proc si004 { methods {nentries 200} {tnum "004"} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Si$tnum ($pmethod/$methods) $nentries equal key/data pairs"
+ puts "si$tnum \{\[ list $pmethod $methods \]\} $nentries"
env_cleanup $testdir
set pname "primary$tnum.db"
diff --git a/db/test/si005.tcl b/db/test/si005.tcl
index 31e99ede9..292cf1f60 100644
--- a/db/test/si005.tcl
+++ b/db/test/si005.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: si005.tcl,v 11.9 2004/01/28 03:36:30 bostic Exp $
+# $Id: si005.tcl,v 11.11 2004/10/27 20:40:25 carol Exp $
#
# TEST si005
# TEST Basic secondary index put/delete test with transactions
@@ -35,7 +35,7 @@ proc si005 { methods {nentries 200} {tnum "005"} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Si$tnum ($pmethod/$methods) $nentries equal key/data pairs"
+ puts "si$tnum \{\[ list $pmethod $methods \]\} $nentries"
puts "\twith transactions"
env_cleanup $testdir
diff --git a/db/test/sijointest.tcl b/db/test/sijointest.tcl
index b89a1da71..eca46cf86 100644
--- a/db/test/sijointest.tcl
+++ b/db/test/sijointest.tcl
@@ -3,11 +3,11 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: sijointest.tcl,v 11.4 2004/01/28 03:36:30 bostic Exp $
+# $Id: sijointest.tcl,v 11.7 2004/11/01 16:01:39 carol Exp $
#
# TEST sijointest: Secondary index and join test.
# TEST This used to be si005.tcl.
-proc sijointest { methods {nitems 1000} args } {
+proc sijointest { methods {nentries 1000} args } {
source ./include.tcl
# Primary method/args.
@@ -37,7 +37,8 @@ proc sijointest { methods {nitems 1000} args } {
set argses [convert_argses $methods $args]
set omethods [convert_methods $methods]
- puts "Sijoin ($pmethod/$methods) Secondary index join test."
+ puts "Secondary index join test."
+ puts "sijoin \{\[ list $pmethod $methods \]\} $nentries"
env_cleanup $testdir
set pname "sijoin-primary.db"
@@ -63,8 +64,8 @@ proc sijointest { methods {nitems 1000} args } {
error_check_good name_open [is_valid_db $namedb] TRUE
error_check_good name_associate [$pdb associate sj_getname $namedb] 0
- puts "\tSijoin.a: Populate database with $nitems \"names\""
- sj_populate $pdb $nitems
+ puts "\tSijoin.a: Populate database with $nentries \"names\""
+ sj_populate $pdb $nentries
puts "\tSijoin.b: Perform a join on each \"name\" and \"ZIP\""
sj_jointest $pdb $zipdb $namedb
@@ -122,11 +123,11 @@ proc sj_dojoin { item pdb zipdb namedb } {
error_check_good zipc_close($item) [$zipc close] 0
}
-proc sj_populate { db nitems } {
+proc sj_populate { db nentries } {
global dict
set did [open $dict]
- for { set i 1 } { $i <= $nitems } { incr i } {
+ for { set i 1 } { $i <= $nentries } { incr i } {
gets $did word
if { [string length $word] < 3 } {
gets $did word
diff --git a/db/test/siutils.tcl b/db/test/siutils.tcl
index ffb0de46c..271584bd3 100644
--- a/db/test/siutils.tcl
+++ b/db/test/siutils.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 2001-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: siutils.tcl,v 11.6 2004/03/02 18:44:41 mjc Exp $
+# $Id: siutils.tcl,v 11.7 2004/10/15 12:55:01 sue Exp $
#
# Secondary index utilities. This file used to be known as
# sindex.tcl.
@@ -54,18 +54,42 @@ set verbose_check_secondaries 0
# Given a primary database handle, a list of secondary handles, a
# number of entries, and arrays of keys and data, verify that all
# databases have what they ought to.
-proc check_secondaries { pdb sdbs nentries keyarr dataarr {pref "Check"} } {
+proc check_secondaries { pdb sdbs nentries keyarr dataarr {pref "Check"} \
+ {errp NONE} {errs NONE} {errsg NONE}} {
upvar $keyarr keys
upvar $dataarr data
global verbose_check_secondaries
+ if { [string compare $errp NONE] != 0 } {
+ upvar $errp errorp
+ }
+ set errorp 0
+ if { [string compare $errs NONE] != 0 } {
+ upvar $errs errors
+ }
+ set errors 0
+ if { [string compare $errsg NONE] != 0 } {
+ upvar $errsg errorsg
+ }
+ set errorsg 0
# Make sure each key/data pair is in the primary.
if { $verbose_check_secondaries } {
puts "\t\t$pref.1: Each key/data pair is in the primary"
}
for { set i 0 } { $i < $nentries } { incr i } {
- error_check_good pdb_get($i) [$pdb get $keys($i)] \
- [list [list $keys($i) $data($i)]]
+ if { [string compare $errp NONE] == 0 } {
+ error_check_good pdb_get($i) [$pdb get $keys($i)] \
+ [list [list $keys($i) $data($i)]]
+ } else {
+ set stat [catch {$pdb get $keys($i)} ret]
+ if { $stat == 1 } {
+ set errorp $ret
+ break
+ } else {
+ error_check_good pdb_get($i) $ret \
+ [list [list $keys($i) $data($i)]]
+ }
+ }
}
for { set j 0 } { $j < [llength $sdbs] } { incr j } {
@@ -78,9 +102,20 @@ proc check_secondaries { pdb sdbs nentries keyarr dataarr {pref "Check"} } {
for { set i 0 } { $i < $nentries } { incr i } {
set skey [[callback_n $j] $keys($i) $data($i)]
# Check with pget on the secondary.
- error_check_good sdb($j)_pget($i) \
- [$sdb pget -get_both $skey $keys($i)] \
- [list [list $skey $keys($i) $data($i)]]
+ set stat [catch {$sdb pget -get_both \
+ $skey $keys($i)} ret]
+ if { [string compare $errs NONE] == 0 } {
+ error_check_good stat $stat 0
+ error_check_good sdb($j)_pget($i) $ret \
+ [list [list $skey $keys($i) $data($i)]]
+ } else {
+ if { $stat == 1 } {
+ set errors $ret
+ } else {
+ error_check_good sdb($j)_pget($i) $ret \
+ [list [list $skey $keys($i) $data($i)]]
+ }
+ }
# Check again with get on the secondary.
# Since get_both is not an allowed option
# with get on a secondary handle, we can't
@@ -93,10 +128,32 @@ proc check_secondaries { pdb sdbs nentries keyarr dataarr {pref "Check"} } {
[is_substr [$sdb get $skey] \
[list [list $skey $data($i)]]] 1
} else {
- error_check_good sdb($j)_get($i) \
- [$sdb get $skey] \
- [list [list $skey $data($i)]]
+ set stat [catch {$sdb get $skey} ret]
+ if { [string compare $errs NONE] == 0 } {
+ error_check_good sdb($j)_get($i) \
+ $ret \
+ [list [list $skey $data($i)]]
+ } else {
+ if { $stat == 1 } {
+ set errorsg $ret
+ break
+ } else {
+ error_check_good sdb($j)_get($i) \
+ $ret \
+ [list [list $skey $data($i)]]
+ }
+ }
}
+ #
+ # We couldn't break above because we need to execute
+ # the errorsg error as well.
+ #
+ if { $errors != 0 } {
+ break
+ }
+ }
+ if { $errors != 0 || $errorsg != 0 } {
+ break
}
# Make sure this secondary contains only $nentries
@@ -112,6 +169,9 @@ proc check_secondaries { pdb sdbs nentries keyarr dataarr {pref "Check"} } {
error_check_good numitems($i) $k $nentries
error_check_good dbc($i)_close [$dbc close] 0
}
+ if { $errorp != 0 || $errors != 0 || $errorsg != 0 } {
+ return
+ }
if { $verbose_check_secondaries } {
puts "\t\t$pref.4: Primary has $nentries items"
diff --git a/db/test/test.tcl b/db/test/test.tcl
index f36b68e7f..3bd3e4d9c 100644
--- a/db/test/test.tcl
+++ b/db/test/test.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 1996-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: test.tcl,v 11.271 2004/09/22 18:01:06 bostic Exp $
+# $Id: test.tcl,v 11.273 2004/11/01 14:48:23 carol Exp $
source ./include.tcl
@@ -396,11 +396,12 @@ proc check_output { file } {
^\t*Run_rpcmethod.*|
^\t*Running\srecovery\son\s.*|
^\t*[s|S]ec[0-9][0-9][0-9].*|
- ^\t*Si[0-9][0-9][0-9].*|
+ ^\t*[s|S]i[0-9][0-9][0-9].*|
^\t*Sijoin.*|
^\t*sdb[0-9][0-9][0-9].*|
^\t*Skipping\s.*|
^\t*Subdb[0-9][0-9][0-9].*|
+ ^\t*Subdbtest[0-9][0-9][0-9].*|
^\t*Syncing$|
^\t*[t|T]est[0-9][0-9][0-9].*|
^\t*[t|T]xn[0-9][0-9][0-9].*|
@@ -633,10 +634,10 @@ proc r { args } {
sdb {
if { $one_test == "ALL" } {
if { $display } {
- puts "eval r $saveflags sdbtest"
+ run_subsystem sdbtest 1 0
}
if { $run } {
- eval r $saveflags sdbtest
+ run_subsystem sdbtest 0 1
}
}
foreach test $test_names(sdb) {
diff --git a/db/test/test075.tcl b/db/test/test075.tcl
deleted file mode 100644
index 20760944b..000000000
--- a/db/test/test075.tcl
+++ /dev/null
@@ -1,205 +0,0 @@
-# See the file LICENSE for redistribution information.
-#
-# Copyright (c) 2000-2004
-# Sleepycat Software. All rights reserved.
-#
-# $Id: test075.tcl,v 11.24 2004/01/28 03:36:31 bostic Exp $
-#
-# TEST test075
-# TEST Test of DB->rename().
-# TEST (formerly test of DB_TRUNCATE cached page invalidation [#1487])
-proc test075 { method { tnum "075" } args } {
- global encrypt
- global errorCode
- global errorInfo
-
- source ./include.tcl
- set omethod [convert_method $method]
- set args [convert_args $method $args]
-
- puts "Test$tnum: $method ($args): Test of DB->rename()"
- # If we are using an env, then testfile should just be the
- # db name. Otherwise it is the test directory and the name.
- set eindex [lsearch -exact $args "-env"]
- if { $eindex != -1 } {
- # If we are using an env, then skip this test.
- # It needs its own.
- incr eindex
- set env [lindex $args $eindex]
- puts "Skipping test075 for env $env"
- return
- }
- if { $encrypt != 0 } {
- puts "Skipping test075 for security"
- return
- }
-
- # Define absolute pathnames
- set curdir [pwd]
- cd $testdir
- set fulldir [pwd]
- cd $curdir
- set reldir $testdir
-
- # Set up absolute and relative pathnames for test
- set paths [list $fulldir $reldir]
- foreach path $paths {
- puts "\tTest$tnum: starting test of $path path"
- set oldfile $path/test$tnum-old.db
- set newfile $path/test$tnum.db
- set env NULL
- set envargs ""
-
- # Loop through test using the following rename options
- # 1. no environment, not in transaction
- # 2. with environment, not in transaction
- # 3. rename with auto-commit
- # 4. rename in committed transaction
- # 5. rename in aborted transaction
-
- foreach op "noenv env auto commit abort" {
-
- puts "\tTest$tnum.a: Create/rename file with $op"
-
- # Make sure we're starting with a clean slate.
-
- if { $op == "noenv" } {
- cleanup $path $env
- if { $env == "NULL" } {
- error_check_bad "$oldfile exists" \
- [file exists $oldfile] 1
- error_check_bad "$newfile exists" \
- [file exists $newfile] 1
- }
- }
-
- if { $op == "env" } {
- env_cleanup $path
- set env [berkdb_env -create -home $path]
- set envargs "-env $env"
- error_check_good env_open [is_valid_env $env] TRUE
- }
-
- if { $op == "auto" || $op == "commit" || $op == "abort" } {
- env_cleanup $path
- set env [berkdb_env -create -home $path -txn]
- set envargs "-env $env"
- error_check_good env_open [is_valid_env $env] TRUE
- }
-
- puts "\t\tTest$tnum.a.1: create"
- set db [eval {berkdb_open -create -mode 0644} \
- $omethod $envargs $args $oldfile]
- error_check_good dbopen [is_valid_db $db] TRUE
-
- if { $env == "NULL" } {
- error_check_bad \
- "$oldfile exists" [file exists $oldfile] 0
- error_check_bad \
- "$newfile exists" [file exists $newfile] 1
- }
-
- # The nature of the key and data are unimportant;
- # use numeric key to record-based methods don't need
- # special treatment.
- set key 1
- set data [pad_data $method data]
-
- error_check_good dbput [$db put $key $data] 0
- error_check_good dbclose [$db close] 0
-
- puts "\t\tTest$tnum.a.2: rename"
- if { $env == "NULL" } {
- error_check_bad \
- "$oldfile exists" [file exists $oldfile] 0
- error_check_bad \
- "$newfile exists" [file exists $newfile] 1
- }
-
- # Regular renames use berkdb dbrename but transaction
- # protected renames must use $env dbrename.
- if { $op == "noenv" || $op == "env" } {
- error_check_good rename_file [eval {berkdb dbrename} \
- $envargs $oldfile $newfile] 0
- } elseif { $op == "auto" } {
- error_check_good rename_file [eval {$env dbrename} \
- -auto_commit $oldfile $newfile] 0
- } else {
- # $op is "abort" or "commit"
- set txn [$env txn]
- error_check_good rename_file [eval {$env dbrename} \
- -txn $txn $oldfile $newfile] 0
- error_check_good txn_$op [$txn $op] 0
- }
-
- if { $env == "NULL" } {
- error_check_bad \
- "$oldfile exists" [file exists $oldfile] 1
- error_check_bad \
- "$newfile exists" [file exists $newfile] 0
- }
-
- puts "\t\tTest$tnum.a.3: check"
- # Open again with create to make sure we're not caching or
- # anything silly. In the normal case (no env), we already
- # know the file doesn't exist.
- set odb [eval {berkdb_open -create -mode 0644} \
- $envargs $omethod $args $oldfile]
- set ndb [eval {berkdb_open -create -mode 0644} \
- $envargs $omethod $args $newfile]
- error_check_good odb_open [is_valid_db $odb] TRUE
- error_check_good ndb_open [is_valid_db $ndb] TRUE
-
- # The DBT from the "old" database should be empty,
- # not the "new" one, except in the case of an abort.
- set odbt [$odb get $key]
- if { $op == "abort" } {
- error_check_good odbt_has_data [llength $odbt] 1
- } else {
- set ndbt [$ndb get $key]
- error_check_good odbt_empty [llength $odbt] 0
- error_check_bad ndbt_empty [llength $ndbt] 0
- error_check_good ndbt [lindex \
- [lindex $ndbt 0] 1] $data
- }
- error_check_good odb_close [$odb close] 0
- error_check_good ndb_close [$ndb close] 0
-
- # Now there's both an old and a new. Rename the
- # "new" to the "old" and make sure that fails.
- #
- # XXX Ideally we'd do this test even when there's
- # an external environment, but that env has
- # errpfx/errfile set now. :-(
- puts "\tTest$tnum.b: Make sure rename fails\
- instead of overwriting"
- if { $env != "NULL" } {
- error_check_good env_close [$env close] 0
- set env [berkdb_env_noerr -home $path]
- error_check_good env_open2 \
- [is_valid_env $env] TRUE
- set ret [catch {eval {berkdb dbrename} \
- -env $env $newfile $oldfile} res]
- error_check_bad rename_overwrite $ret 0
- error_check_good rename_overwrite_ret \
- [is_substr $errorCode EEXIST] 1
- }
-
- # Verify and then start over from a clean slate.
- verify_dir $path "\tTest$tnum.c: "
- cleanup $path $env
- if { $env != "NULL" } {
- error_check_good env_close [$env close] 0
- }
- if { $env == "NULL" } {
- error_check_bad "$oldfile exists" \
- [file exists $oldfile] 1
- error_check_bad "$newfile exists" \
- [file exists $newfile] 1
-
- set oldfile test$tnum-old.db
- set newfile test$tnum.db
- }
- }
- }
-}
diff --git a/db/test/test080.tcl b/db/test/test080.tcl
deleted file mode 100644
index cfa6d3653..000000000
--- a/db/test/test080.tcl
+++ /dev/null
@@ -1,129 +0,0 @@
-# See the file LICENSE for redistribution information.
-#
-# Copyright (c) 2000-2004
-# Sleepycat Software. All rights reserved.
-#
-# $Id: test080.tcl,v 11.22 2004/01/28 03:36:31 bostic Exp $
-#
-# TEST test080
-# TEST Test of DB->remove()
-proc test080 { method {tnum "080"} args } {
- source ./include.tcl
-
- set args [convert_args $method $args]
- set omethod [convert_method $method]
-
- puts "Test$tnum: Test of DB->remove()"
-
- # Determine full path
- set curdir [pwd]
- cd $testdir
- set fulldir [pwd]
- cd $curdir
-
- # Test both relative and absolute path
- set paths [list $fulldir $testdir]
-
- set encrypt 0
- set encargs ""
- set args [split_encargs $args encargs]
-
- # If we are using an env, then skip this test.
- # It needs its own.
- set eindex [lsearch -exact $args "-env"]
- if { $eindex != -1 } {
- incr eindex
- set e [lindex $args $eindex]
- puts "Skipping test080 for env $e"
- return
- }
-
- foreach path $paths {
-
- set dbfile test$tnum.db
- set testfile $path/$dbfile
- set eargs $encargs
-
- # Loop through test using the following remove options
- # 1. no environment, not in transaction
- # 2. with environment, not in transaction
- # 3. remove with auto-commit
- # 4. remove in committed transaction
- # 5. remove in aborted transaction
-
- foreach op "noenv env auto commit abort" {
-
- # Make sure we're starting with a clean slate.
- env_cleanup $testdir
- if { $op == "noenv" } {
- set dbfile $testfile
- set e NULL
- set envargs ""
- } else {
- if { $op == "env" } {
- set largs ""
- } else {
- set largs " -txn"
- }
- if { $encargs != "" } {
- set eargs " -encrypt "
- }
- set e [eval {berkdb_env -create -home $path} \
- $encargs $largs]
- set envargs "-env $e"
- error_check_good env_open [is_valid_env $e] TRUE
- }
-
- puts "\tTest$tnum: dbremove with $op in $path"
- puts "\tTest$tnum.a.1: Create file"
- set db [eval {berkdb_open -create -mode 0644} \
- $omethod $envargs $eargs $args {$dbfile}]
- error_check_good db_open [is_valid_db $db] TRUE
-
- # The nature of the key and data are unimportant;
- # use numeric key so record-based methods don't need
- # special treatment.
- set key 1
- set data [pad_data $method data]
-
- error_check_good dbput [$db put $key $data] 0
- error_check_good dbclose [$db close] 0
- error_check_good file_exists_before \
- [file exists $testfile] 1
-
- # Use berkdb dbremove for non-transactional tests
- # and $env dbremove for transactional tests
- puts "\tTest$tnum.a.2: Remove file"
- if { $op == "noenv" || $op == "env" } {
- error_check_good remove_$op [eval \
- {berkdb dbremove} $eargs $envargs $dbfile] 0
- } elseif { $op == "auto" } {
- error_check_good remove_$op \
- [eval {$e dbremove} -auto_commit $dbfile] 0
- } else {
- # $op is "abort" or "commit"
- set txn [$e txn]
- error_check_good remove_$op \
- [eval {$e dbremove} -txn $txn $dbfile] 0
- error_check_good txn_$op [$txn $op] 0
- }
-
- puts "\tTest$tnum.a.3: Check that file is gone"
- # File should now be gone, unless the op is an abort.
- if { $op != "abort" } {
- error_check_good exists_after \
- [file exists $testfile] 0
- } else {
- error_check_good exists_after \
- [file exists $testfile] 1
- }
-
- if { $e != "NULL" } {
- error_check_good env_close [$e close] 0
- }
-
- set dbfile test$tnum-old.db
- set testfile $path/$dbfile
- }
- }
-}
diff --git a/db/test/upgrade.tcl b/db/test/upgrade.tcl
index e4099a231..0043c353a 100644
--- a/db/test/upgrade.tcl
+++ b/db/test/upgrade.tcl
@@ -3,7 +3,7 @@
# Copyright (c) 1999-2004
# Sleepycat Software. All rights reserved.
#
-# $Id: upgrade.tcl,v 11.34 2004/09/22 18:01:06 bostic Exp $
+# $Id: upgrade.tcl,v 11.37 2004/10/27 20:29:29 carol Exp $
source ./include.tcl
@@ -267,12 +267,17 @@ proc _log_test { temp_dir release method file } {
set ret [catch {exec $util_path/db_printlog -h $temp_dir \
-P $passwd > $temp_dir/logs.prlog} message]
if { $ret == 1 } {
- puts "db_printlog failed: $message"
+ # If the failure is because of a historic
+ # log version, that's okay.
+ if { $current_logvers <= $saved_logvers } {
+ puts "db_printlog failed: $message"
+ }
}
}
+
if { $current_logvers > $saved_logvers } {
- error_check_good unreadable_log_version \
- [is_substr $message "unreadable log version"] 1
+ error_check_good historic_log_version \
+ [is_substr $message "historic log version"] 1
} else {
error_check_good db_printlog:$message $ret 0
# Compare logs.prlog and $file.prlog (should match)
@@ -613,7 +618,7 @@ proc upgrade_dump { database file {stripnulls 0} } {
if { $encrypt == 1 } {
set encargs " -encryptany $passwd "
}
- set db [eval {berkdb open} $encargs $database]
+ set db [eval {berkdb open} -rdonly $encargs $database]
set dbc [$db cursor]
set f [open $file w+]