blob: d00bdc230918f5ee77ecf4acaa43911c2a35edcd [file] [log] [blame]
drhb19a2bc2001-09-16 00:13:26 +00001# 2001 September 15
drh348784e2000-05-29 20:41:49 +00002#
drhb19a2bc2001-09-16 00:13:26 +00003# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
drh348784e2000-05-29 20:41:49 +00005#
drhb19a2bc2001-09-16 00:13:26 +00006# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
drh348784e2000-05-29 20:41:49 +00009#
10#***********************************************************************
11# This file implements some common TCL routines used for regression
12# testing the SQLite library
13#
drhb62c3352006-11-23 09:39:16 +000014# $Id: tester.tcl,v 1.70 2006/11/23 09:39:16 drh Exp $
drhfbc3eab2001-04-06 16:13:42 +000015
drhef4ac8f2004-06-19 00:16:31 +000016# Make sure tclsqlite3 was compiled correctly. Abort now with an
drhfbc3eab2001-04-06 16:13:42 +000017# error message if not.
18#
drhef4ac8f2004-06-19 00:16:31 +000019if {[sqlite3 -tcl-uses-utf]} {
drhfbc3eab2001-04-06 16:13:42 +000020 if {"\u1234"=="u1234"} {
21 puts stderr "***** BUILD PROBLEM *****"
22 puts stderr "$argv0 was linked against an older version"
23 puts stderr "of TCL that does not support Unicode, but uses a header"
24 puts stderr "file (\"tcl.h\") from a new TCL version that does support"
25 puts stderr "Unicode. This combination causes internal errors."
26 puts stderr "Recompile using a TCL library and header file that match"
27 puts stderr "and try again.\n**************************"
28 exit 1
29 }
30} else {
31 if {"\u1234"!="u1234"} {
32 puts stderr "***** BUILD PROBLEM *****"
33 puts stderr "$argv0 was linked against an newer version"
34 puts stderr "of TCL that supports Unicode, but uses a header file"
35 puts stderr "(\"tcl.h\") from a old TCL version that does not support"
36 puts stderr "Unicode. This combination causes internal errors."
37 puts stderr "Recompile using a TCL library and header file that match"
38 puts stderr "and try again.\n**************************"
39 exit 1
40 }
41}
drh348784e2000-05-29 20:41:49 +000042
drh92febd92004-08-20 18:34:20 +000043set tcl_precision 15
drh49285702005-09-17 15:20:26 +000044set sqlite_pending_byte 0x0010000
drh92febd92004-08-20 18:34:20 +000045
drh9eb9e262004-02-11 02:18:05 +000046# Use the pager codec if it is available
47#
drhef4ac8f2004-06-19 00:16:31 +000048if {[sqlite3 -has-codec] && [info command sqlite_orig]==""} {
49 rename sqlite3 sqlite_orig
50 proc sqlite3 {args} {
drh9eb9e262004-02-11 02:18:05 +000051 if {[llength $args]==2 && [string index [lindex $args 0] 0]!="-"} {
52 lappend args -key {xyzzy}
53 }
54 uplevel 1 sqlite_orig $args
55 }
56}
57
58
drhbec2bf42000-05-29 23:48:22 +000059# Create a test database
60#
drh254cba22001-09-20 01:44:42 +000061catch {db close}
62file delete -force test.db
63file delete -force test.db-journal
drhdddca282006-01-03 00:33:50 +000064sqlite3 db ./test.db
65set ::DB [sqlite3_connection_pointer db]
drhcd61c282002-03-06 22:01:34 +000066if {[info exists ::SETUP_SQL]} {
67 db eval $::SETUP_SQL
68}
drhbec2bf42000-05-29 23:48:22 +000069
70# Abort early if this script has been run before.
71#
72if {[info exists nTest]} return
73
74# Set the test counters to zero
75#
drh348784e2000-05-29 20:41:49 +000076set nErr 0
77set nTest 0
drh767c2002000-10-19 14:10:08 +000078set skip_test 0
drha1b351a2001-09-14 16:42:12 +000079set failList {}
drhd3d39e92004-05-20 22:16:29 +000080set maxErr 1000
drhb62c3352006-11-23 09:39:16 +000081if {![info exists speedTest]} {
82 set speedTest 0
83}
drh348784e2000-05-29 20:41:49 +000084
85# Invoke the do_test procedure to run a single test
86#
87proc do_test {name cmd expected} {
drhd3d39e92004-05-20 22:16:29 +000088 global argv nErr nTest skip_test maxErr
danielk19772e588c72005-12-09 14:25:08 +000089 set ::sqlite_malloc_id $name
drh767c2002000-10-19 14:10:08 +000090 if {$skip_test} {
91 set skip_test 0
92 return
93 }
94 if {[llength $argv]==0} {
drh348784e2000-05-29 20:41:49 +000095 set go 1
96 } else {
97 set go 0
98 foreach pattern $argv {
99 if {[string match $pattern $name]} {
100 set go 1
101 break
102 }
103 }
104 }
105 if {!$go} return
106 incr nTest
drh5edc3122001-09-13 21:53:09 +0000107 puts -nonewline $name...
drh348784e2000-05-29 20:41:49 +0000108 flush stdout
109 if {[catch {uplevel #0 "$cmd;\n"} result]} {
110 puts "\nError: $result"
111 incr nErr
drha1b351a2001-09-14 16:42:12 +0000112 lappend ::failList $name
drhd3d39e92004-05-20 22:16:29 +0000113 if {$nErr>$maxErr} {puts "*** Giving up..."; finalize_testing}
drh348784e2000-05-29 20:41:49 +0000114 } elseif {[string compare $result $expected]} {
115 puts "\nExpected: \[$expected\]\n Got: \[$result\]"
116 incr nErr
drha1b351a2001-09-14 16:42:12 +0000117 lappend ::failList $name
drhd3d39e92004-05-20 22:16:29 +0000118 if {$nErr>=$maxErr} {puts "*** Giving up..."; finalize_testing}
drh348784e2000-05-29 20:41:49 +0000119 } else {
120 puts " Ok"
121 }
122}
123
drhb62c3352006-11-23 09:39:16 +0000124# Run an SQL script.
125# Return the number of microseconds per statement.
126#
127proc speed_trial {name numstmt sql} {
128 puts -nonewline [format {%-20.20s } $name...]
129 flush stdout
130 set speed [time {sqlite3_exec_nr db $sql}]
131 set tm [lindex $speed 0]
132 set per [expr {$tm/(1.0*$numstmt)}]
133 set rate [expr {1000000.0*$numstmt/$tm}]
134 puts [format {%20.1f us/stmt %20.5f stmt/s} $per $rate]
135}
136
drhdaffd0e2001-04-11 14:28:42 +0000137# The procedure uses the special "sqlite_malloc_stat" command
drhc89b91b2005-01-03 01:32:59 +0000138# (which is only available if SQLite is compiled with -DSQLITE_DEBUG=1)
drh8c82b352000-12-10 18:23:50 +0000139# to see how many malloc()s have not been free()ed. The number
140# of surplus malloc()s is stored in the global variable $::Leak.
141# If the value in $::Leak grows, it may mean there is a memory leak
142# in the library.
143#
144proc memleak_check {} {
drhdaffd0e2001-04-11 14:28:42 +0000145 if {[info command sqlite_malloc_stat]!=""} {
146 set r [sqlite_malloc_stat]
147 set ::Leak [expr {[lindex $r 0]-[lindex $r 1]}]
148 }
drh8c82b352000-12-10 18:23:50 +0000149}
150
drh348784e2000-05-29 20:41:49 +0000151# Run this routine last
152#
153proc finish_test {} {
drha1b351a2001-09-14 16:42:12 +0000154 finalize_testing
155}
156proc finalize_testing {} {
drh80788d82006-09-02 14:50:23 +0000157 global nTest nErr sqlite_open_file_count
drha1b351a2001-09-14 16:42:12 +0000158 if {$nErr==0} memleak_check
danielk19772e588c72005-12-09 14:25:08 +0000159
drh6e142f52000-06-08 13:36:40 +0000160 catch {db close}
danielk19772e588c72005-12-09 14:25:08 +0000161 catch {db2 close}
162 catch {db3 close}
163
danielk197797cb2e92005-12-09 14:39:04 +0000164 catch {
165 pp_check_for_leaks
166 }
drhb4bc7052006-01-11 23:40:33 +0000167 sqlite3 db {}
danielk1977cbb84962006-01-17 16:10:13 +0000168 # sqlite3_clear_tsd_memdebug
drhb4bc7052006-01-11 23:40:33 +0000169 db close
170 if {$::sqlite3_tsd_count} {
171 puts "Thread-specific data leak: $::sqlite3_tsd_count instances"
172 incr nErr
173 } else {
174 puts "Thread-specific data deallocated properly"
175 }
176 incr nTest
drh348784e2000-05-29 20:41:49 +0000177 puts "$nErr errors out of $nTest tests"
drha1b351a2001-09-14 16:42:12 +0000178 puts "Failures on these tests: $::failList"
drh80788d82006-09-02 14:50:23 +0000179 if {$nErr>0 && ![working_64bit_int]} {
180 puts "******************************************************************"
181 puts "N.B.: The version of TCL that you used to build this test harness"
182 puts "is defective in that it does not support 64-bit integers. Some or"
183 puts "all of the test failures above might be a result from this defect"
184 puts "in your TCL build."
185 puts "******************************************************************"
drhdb25e382001-03-15 18:21:22 +0000186 }
drh94e92032003-02-16 22:21:32 +0000187 if {$sqlite_open_file_count} {
188 puts "$sqlite_open_file_count files were left open"
189 incr nErr
190 }
drhd9910fe2006-10-04 11:55:49 +0000191 foreach f [glob -nocomplain test.db-*-journal] {
192 file delete -force $f
193 }
194 foreach f [glob -nocomplain test.db-mj*] {
195 file delete -force $f
196 }
drhdb25e382001-03-15 18:21:22 +0000197 exit [expr {$nErr>0}]
drh348784e2000-05-29 20:41:49 +0000198}
199
drh348784e2000-05-29 20:41:49 +0000200# A procedure to execute SQL
201#
drhc4a3c772001-04-04 11:48:57 +0000202proc execsql {sql {db db}} {
drhacbcdc42001-01-22 00:31:53 +0000203 # puts "SQL = $sql"
danielk19773bdca9c2006-01-17 09:35:01 +0000204 uplevel [list $db eval $sql]
drh348784e2000-05-29 20:41:49 +0000205}
drh3aadb2e2000-05-31 17:59:25 +0000206
drhadbca9c2001-09-27 15:11:53 +0000207# Execute SQL and catch exceptions.
208#
209proc catchsql {sql {db db}} {
210 # puts "SQL = $sql"
211 set r [catch {$db eval $sql} msg]
212 lappend r $msg
213 return $r
214}
215
drh04096482001-11-09 22:41:44 +0000216# Do an VDBE code dump on the SQL given
217#
218proc explain {sql {db db}} {
219 puts ""
220 puts "addr opcode p1 p2 p3 "
221 puts "---- ------------ ------ ------ ---------------"
222 $db eval "explain $sql" {} {
223 puts [format {%-4d %-12.12s %-6d %-6d %s} $addr $opcode $p1 $p2 $p3]
224 }
225}
226
drh3aadb2e2000-05-31 17:59:25 +0000227# Another procedure to execute SQL. This one includes the field
228# names in the returned list.
229#
230proc execsql2 {sql} {
231 set result {}
232 db eval $sql data {
233 foreach f $data(*) {
234 lappend result $f $data($f)
235 }
236 }
237 return $result
238}
drh17a68932001-01-31 13:28:08 +0000239
drhdde85d92003-03-01 19:45:34 +0000240# Use the non-callback API to execute multiple SQL statements
241#
242proc stepsql {dbptr sql} {
243 set sql [string trim $sql]
244 set r 0
245 while {[string length $sql]>0} {
danielk19774ad17132004-05-21 01:47:26 +0000246 if {[catch {sqlite3_prepare $dbptr $sql -1 sqltail} vm]} {
drhdde85d92003-03-01 19:45:34 +0000247 return [list 1 $vm]
248 }
249 set sql [string trim $sqltail]
danielk1977fbcd5852004-06-15 02:44:18 +0000250# while {[sqlite_step $vm N VAL COL]=="SQLITE_ROW"} {
251# foreach v $VAL {lappend r $v}
252# }
253 while {[sqlite3_step $vm]=="SQLITE_ROW"} {
254 for {set i 0} {$i<[sqlite3_data_count $vm]} {incr i} {
255 lappend r [sqlite3_column_text $vm $i]
256 }
drhdde85d92003-03-01 19:45:34 +0000257 }
danielk1977106bb232004-05-21 10:08:53 +0000258 if {[catch {sqlite3_finalize $vm} errmsg]} {
drhdde85d92003-03-01 19:45:34 +0000259 return [list 1 $errmsg]
260 }
261 }
262 return $r
263}
264
drh17a68932001-01-31 13:28:08 +0000265# Delete a file or directory
266#
267proc forcedelete {filename} {
268 if {[catch {file delete -force $filename}]} {
269 exec rm -rf $filename
270 }
271}
drh21504322002-06-25 13:16:02 +0000272
273# Do an integrity check of the entire database
274#
275proc integrity_check {name} {
drh27d258a2004-10-30 20:23:09 +0000276 ifcapable integrityck {
277 do_test $name {
278 execsql {PRAGMA integrity_check}
279 } {ok}
280 }
281}
282
283# Evaluate a boolean expression of capabilities. If true, execute the
284# code. Omit the code if false.
285#
danielk19773e8c37e2005-01-21 03:12:14 +0000286proc ifcapable {expr code {else ""} {elsecode ""}} {
drh5436dc22004-11-14 04:04:17 +0000287 regsub -all {[a-z_0-9]+} $expr {$::sqlite_options(&)} e2
danielk19773e8c37e2005-01-21 03:12:14 +0000288 if ($e2) {
289 set c [catch {uplevel 1 $code} r]
290 } else {
291 set c [catch {uplevel 1 $elsecode} r]
292 }
293 return -code $c $r
drh21504322002-06-25 13:16:02 +0000294}
danielk197745901d62004-11-10 15:27:38 +0000295
danielk1977aca790a2005-01-13 11:07:52 +0000296# This proc execs a seperate process that crashes midway through executing
297# the SQL script $sql on database test.db.
298#
299# The crash occurs during a sync() of file $crashfile. When the crash
300# occurs a random subset of all unsynced writes made by the process are
301# written into the files on disk. Argument $crashdelay indicates the
302# number of file syncs to wait before crashing.
303#
304# The return value is a list of two elements. The first element is a
305# boolean, indicating whether or not the process actually crashed or
306# reported some other error. The second element in the returned list is the
307# error message. This is "child process exited abnormally" if the crash
308# occured.
309#
310proc crashsql {crashdelay crashfile sql} {
311 if {$::tcl_platform(platform)!="unix"} {
312 error "crashsql should only be used on unix"
313 }
314 set cfile [file join [pwd] $crashfile]
315
316 set f [open crash.tcl w]
317 puts $f "sqlite3_crashparams $crashdelay $cfile"
318 puts $f "sqlite3 db test.db"
319 puts $f "db eval {pragma cache_size = 10}"
320 puts $f "db eval {"
321 puts $f "$sql"
322 puts $f "}"
323 close $f
324
325 set r [catch {
drh9c06c952005-11-26 00:25:00 +0000326 exec [info nameofexec] crash.tcl >@stdout
danielk1977aca790a2005-01-13 11:07:52 +0000327 } msg]
328 lappend r $msg
329}
330
danielk197732554c12005-01-22 03:39:39 +0000331# Usage: do_ioerr_test <test number> <options...>
332#
333# This proc is used to implement test cases that check that IO errors
334# are correctly handled. The first argument, <test number>, is an integer
335# used to name the tests executed by this proc. Options are as follows:
336#
337# -tclprep TCL script to run to prepare test.
338# -sqlprep SQL script to run to prepare test.
339# -tclbody TCL script to run with IO error simulation.
340# -sqlbody TCL script to run with IO error simulation.
341# -exclude List of 'N' values not to test.
drh4ac285a2006-09-15 07:28:50 +0000342# -erc Use extended result codes
danielk197732554c12005-01-22 03:39:39 +0000343# -start Value of 'N' to begin with (default 1)
344#
345# -cksum Boolean. If true, test that the database does
346# not change during the execution of the test case.
347#
348proc do_ioerr_test {testname args} {
349
danielk197732554c12005-01-22 03:39:39 +0000350 set ::ioerropts(-start) 1
351 set ::ioerropts(-cksum) 0
drh4ac285a2006-09-15 07:28:50 +0000352 set ::ioerropts(-erc) 0
danielk197732554c12005-01-22 03:39:39 +0000353 array set ::ioerropts $args
354
355 set ::go 1
356 for {set n $::ioerropts(-start)} {$::go} {incr n} {
357
358 # Skip this IO error if it was specified with the "-exclude" option.
359 if {[info exists ::ioerropts(-exclude)]} {
360 if {[lsearch $::ioerropts(-exclude) $n]!=-1} continue
361 }
362
363 # Delete the files test.db and test2.db, then execute the TCL and
364 # SQL (in that order) to prepare for the test case.
365 do_test $testname.$n.1 {
366 set ::sqlite_io_error_pending 0
367 catch {db close}
368 catch {file delete -force test.db}
369 catch {file delete -force test.db-journal}
370 catch {file delete -force test2.db}
371 catch {file delete -force test2.db-journal}
drha34c62d2006-01-06 22:11:20 +0000372 set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
drh4ac285a2006-09-15 07:28:50 +0000373 sqlite3_extended_result_codes $::DB $::ioerropts(-erc)
danielk197732554c12005-01-22 03:39:39 +0000374 if {[info exists ::ioerropts(-tclprep)]} {
375 eval $::ioerropts(-tclprep)
376 }
377 if {[info exists ::ioerropts(-sqlprep)]} {
378 execsql $::ioerropts(-sqlprep)
379 }
380 expr 0
381 } {0}
382
383 # Read the 'checksum' of the database.
384 if {$::ioerropts(-cksum)} {
385 set checksum [cksum]
386 }
387
388 # Set the Nth IO error to fail.
389 do_test $testname.$n.2 [subst {
390 set ::sqlite_io_error_pending $n
391 }] $n
392
393 # Create a single TCL script from the TCL and SQL specified
394 # as the body of the test.
395 set ::ioerrorbody {}
396 if {[info exists ::ioerropts(-tclbody)]} {
397 append ::ioerrorbody "$::ioerropts(-tclbody)\n"
398 }
399 if {[info exists ::ioerropts(-sqlbody)]} {
400 append ::ioerrorbody "db eval {$::ioerropts(-sqlbody)}"
401 }
402
403 # Execute the TCL Script created in the above block. If
404 # there are at least N IO operations performed by SQLite as
405 # a result of the script, the Nth will fail.
406 do_test $testname.$n.3 {
407 set r [catch $::ioerrorbody msg]
drh4ac285a2006-09-15 07:28:50 +0000408 # puts rc=[sqlite3_errcode $::DB]
drhe49f9822006-09-15 12:29:16 +0000409 set rc [sqlite3_errcode $::DB]
410 if {$::ioerropts(-erc)} {
411 # In extended result mode, all IOERRs are qualified
412 if {[regexp {^SQLITE_IOERR} $rc] && ![regexp {IOERR\+\d} $rc]} {
413 return $rc
414 }
415 } else {
416 # Not in extended result mode, no errors are qualified
417 if {[regexp {\+\d} $rc]} {
418 return $rc
419 }
420 }
danielk197732554c12005-01-22 03:39:39 +0000421 set ::go [expr {$::sqlite_io_error_pending<=0}]
drhc9ac5ca2005-11-04 22:03:30 +0000422 set s [expr $::sqlite_io_error_hit==0]
danielk1977f2fa8312006-01-24 13:09:33 +0000423 set ::sqlite_io_error_hit 0
danielk197732554c12005-01-22 03:39:39 +0000424 # puts "$::sqlite_io_error_pending $r $msg"
danielk1977f2fa8312006-01-24 13:09:33 +0000425 # puts "r=$r s=$s go=$::go msg=\"$msg\""
426 expr { ($s && !$r && !$::go) || (!$s && $r && $::go) }
danielk197732554c12005-01-22 03:39:39 +0000427 # expr {$::sqlite_io_error_pending>0 || $r!=0}
428 } {1}
429
430 # If an IO error occured, then the checksum of the database should
431 # be the same as before the script that caused the IO error was run.
432 if {$::go && $::ioerropts(-cksum)} {
433 do_test $testname.$n.4 {
434 catch {db close}
drha34c62d2006-01-06 22:11:20 +0000435 set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
danielk197732554c12005-01-22 03:39:39 +0000436 cksum
437 } $checksum
438 }
439
danielk1977c4da5b92006-01-21 12:08:54 +0000440 set ::sqlite_io_error_pending 0
danielk1977105afed2005-05-26 15:20:53 +0000441 if {[info exists ::ioerropts(-cleanup)]} {
442 catch $::ioerropts(-cleanup)
443 }
danielk197732554c12005-01-22 03:39:39 +0000444 }
445 set ::sqlite_io_error_pending 0
446 unset ::ioerropts
447}
448
449# Return a checksum based on the contents of database 'db'.
450#
451proc cksum {{db db}} {
452 set txt [$db eval {
453 SELECT name, type, sql FROM sqlite_master order by name
454 }]\n
455 foreach tbl [$db eval {
456 SELECT name FROM sqlite_master WHERE type='table' order by name
457 }] {
458 append txt [$db eval "SELECT * FROM $tbl"]\n
459 }
460 foreach prag {default_synchronous default_cache_size} {
461 append txt $prag-[$db eval "PRAGMA $prag"]\n
462 }
463 set cksum [string length $txt]-[md5 $txt]
464 # puts $cksum-[file size test.db]
465 return $cksum
466}
467
468# Copy file $from into $to. This is used because some versions of
469# TCL for windows (notably the 8.4.1 binary package shipped with the
470# current mingw release) have a broken "file copy" command.
471#
472proc copy_file {from to} {
473 if {$::tcl_platform(platform)=="unix"} {
474 file copy -force $from $to
475 } else {
476 set f [open $from]
477 fconfigure $f -translation binary
478 set t [open $to w]
479 fconfigure $t -translation binary
480 puts -nonewline $t [read $f [file size $from]]
481 close $t
482 close $f
483 }
484}
485
danielk19772e588c72005-12-09 14:25:08 +0000486# This command checks for outstanding calls to sqliteMalloc() from within
487# the current thread. A list is returned with one entry for each outstanding
488# malloc. Each list entry is itself a list of 5 items, as follows:
489#
490# { <number-bytes> <file-name> <line-number> <test-case> <stack-dump> }
491#
492proc check_for_leaks {} {
493 set ret [list]
danielk1977aef0bf62005-12-30 16:28:01 +0000494 set cnt 0
danielk19772e588c72005-12-09 14:25:08 +0000495 foreach alloc [sqlite_malloc_outstanding] {
496 foreach {nBytes file iLine userstring backtrace} $alloc {}
497 set stack [list]
498 set skip 0
499
500 # The first command in this block will probably fail on windows. This
501 # means there will be no stack dump available.
danielk1977da184232006-01-05 11:34:32 +0000502 if {$cnt < 25 && $backtrace!=""} {
danielk1977aef0bf62005-12-30 16:28:01 +0000503 catch {
504 set stuff [eval "exec addr2line -e ./testfixture -f $backtrace"]
505 foreach {func line} $stuff {
506 if {$func != "??" || $line != "??:0"} {
507 regexp {.*/(.*)} $line dummy line
508 lappend stack "${func}() $line"
509 } else {
510 if {[lindex $stack end] != "..."} {
511 lappend stack "..."
512 }
danielk19772e588c72005-12-09 14:25:08 +0000513 }
514 }
515 }
danielk1977aef0bf62005-12-30 16:28:01 +0000516 incr cnt
danielk19772e588c72005-12-09 14:25:08 +0000517 }
518
519 if {!$skip} {
520 lappend ret [list $nBytes $file $iLine $userstring $stack]
521 }
522 }
523 return $ret
524}
525
526# Pretty print a report based on the return value of [check_for_leaks] to
527# stdout.
528proc pp_check_for_leaks {} {
529 set l [check_for_leaks]
530 set n 0
531 foreach leak $l {
532 foreach {nBytes file iLine userstring stack} $leak {}
533 puts "$nBytes bytes leaked at $file:$iLine ($userstring)"
534 foreach frame $stack {
535 puts " $frame"
536 }
537 incr n $nBytes
538 }
539 puts "Memory leaked: $n bytes in [llength $l] allocations"
540 puts ""
541}
542
danielk197745901d62004-11-10 15:27:38 +0000543# If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
544# to non-zero, then set the global variable $AUTOVACUUM to 1.
545set AUTOVACUUM $sqlite_options(default_autovacuum)