From 4a86d0016225d78abd3bb170c29d6e9ffbd0985e Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 22 Dec 2014 22:02:20 +0000 Subject: [PATCH 01/29] Fix a typo in an evidence mark on a test script. No changes to code. FossilOrigin-Name: a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/pragma3.test | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 8ae7e71d4a..545fed12be 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Redefine\sthe\sway\sPRAGMA\sdata_version\sworks:\s\sIt\scontinues\sto\schange\swhen\nany\sother\sconnection\scommits,\sincluding\sshared-cache\sconnections,\sbut\sdoes\snot\nchange\sif\sthe\slocal\sconnection\scommits. -D 2014-12-22T18:41:21.243 +C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. +D 2014-12-22T22:02:20.146 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 3da08d907ba027c50ede8d6e95418f32898971a5 +F test/pragma3.test 4f141da233358783ba443eb685e6739ce0eb1d90 F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ef4b734d1ff3dbb9c802c60dc1384033fdfd87e5 -R 717423e0d3aaa97f5eb5c0e7357ce13c +P 7a97826f33460f3b4f3890c9cf97116c3355eeda +R 75921305dcdb8922f71566b00cf9fa0c U drh -Z 78337e4052167193689952903ddb287b +Z 6c9fa3fa92317b5bccccc5c856a1593a diff --git a/manifest.uuid b/manifest.uuid index 327aa0952b..9504503c19 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7a97826f33460f3b4f3890c9cf97116c3355eeda \ No newline at end of file +a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file diff --git a/test/pragma3.test b/test/pragma3.test index e6069f6e53..f3d531164b 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -32,8 +32,8 @@ do_execsql_test pragma3-102 { # EVIDENCE-OF: R-27726-60934 The "PRAGMA data_version" command provides # an indication that the database file has been modified. # -# EVIDENCE-OF: R-25838-33704 The "PRAGMA data_version" value is -# unchanced for commits made on the same database connection. +# EVIDENCE-OF: R-47505-58569 The "PRAGMA data_version" value is +# unchanged for commits made on the same database connection. # do_execsql_test pragma3-110 { PRAGMA data_version; From d477eee312abf8de89426949976fab10fbcb6e1e Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 19:40:51 +0000 Subject: [PATCH 02/29] Rework the test/releasetest.tcl script so that it uses the autoconf makefile instead of the test/releasetest.mk makefile. Also add options like --dryrun and --buildonly. Omit the --makefile option and replace it with --srcdir with the default computed relative to the releasetest.tcl script itself. FossilOrigin-Name: 7c85e831153f9aef2afaf981d53db38a28091be5 --- manifest | 16 ++-- manifest.uuid | 2 +- test/releasetest.mk | 14 ---- test/releasetest.tcl | 185 +++++++++++++++++++++++++------------------ 4 files changed, 118 insertions(+), 99 deletions(-) delete mode 100644 test/releasetest.mk diff --git a/manifest b/manifest index 545fed12be..63ed4c71f6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. -D 2014-12-22T22:02:20.146 +C Rework\sthe\stest/releasetest.tcl\sscript\sso\sthat\sit\suses\sthe\sautoconf\smakefile\ninstead\sof\sthe\stest/releasetest.mk\smakefile.\s\sAlso\sadd\soptions\slike\s--dryrun\nand\s--buildonly.\s\sOmit\sthe\s--makefile\soption\sand\sreplace\sit\swith\s--srcdir\nwith\sthe\sdefault\scomputed\srelative\sto\sthe\sreleasetest.tcl\sscript\sitself. +D 2014-12-23T19:40:51.746 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,8 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a -F test/releasetest.tcl a4279c890698584feb2ffc86735857a4e4474180 +F test/releasetest.tcl b57a20ccc7aa64be8b52906d211b1ed4c0998cc2 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1233,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7a97826f33460f3b4f3890c9cf97116c3355eeda -R 75921305dcdb8922f71566b00cf9fa0c +P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 +R d1cf8fd2536e09346a06ad4dd6ebb5ea +T *branch * releasetest-refactor +T *sym-releasetest-refactor * +T -sym-trunk * U drh -Z 6c9fa3fa92317b5bccccc5c856a1593a +Z 1d662dddfc70aa251729f355b7103297 diff --git a/manifest.uuid b/manifest.uuid index 9504503c19..f2873c82b4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file +7c85e831153f9aef2afaf981d53db38a28091be5 \ No newline at end of file diff --git a/test/releasetest.mk b/test/releasetest.mk deleted file mode 100644 index 5d217c645b..0000000000 --- a/test/releasetest.mk +++ /dev/null @@ -1,14 +0,0 @@ -######################################################## -TOP=/home/drh/sqlite/sqlite - -TCL_FLAGS=-I/home/drh/tcltk/86linux -LIBTCL=/home/drh/tcltk/86linux/libtcl8.6.a -lm -ldl -lpthread - -BCC = gcc -TCC = gcc -ansi -g $(CFLAGS) -NAWK = awk -AR = ar cr -RANLIB = ranlib -THREADLIB = -lpthread -ldl -lz -include $(TOP)/main.mk -######################################################## diff --git a/test/releasetest.tcl b/test/releasetest.tcl index d2a1bd2bb0..fae7d3c8f6 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -1,6 +1,5 @@ - -set rcsid {$Id: $} - +#!/usr/bin/tclsh +# # Documentation for this script. This may be output to stderr # if the script is invoked incorrectly. See the [process_options] # proc below. @@ -10,51 +9,23 @@ This Tcl script is used to test the various configurations required before releasing a new version. Supported command line options (all optional) are: - -makefile PATH-TO-MAKEFILE (default "releasetest.mk") - -platform PLATFORM (see below) - -quick BOOLEAN (default "0") - -config CONFIGNAME (Run only CONFIGNAME) + --srcdir TOP-OF-SQLITE-TREE (see below) + --platform PLATFORM (see below) + --config CONFIGNAME (Run only CONFIGNAME) + --quick (Run "veryquick.test" only) + --buildonly (Just build testfixture - do not run) + --dryrun (Print what would have happened) + --info (Show diagnostic info) -The default value for -makefile is "./releasetest.mk". +The default value for --srcdir is the parent of the directory holding +this script. -The script determines the default value for -platform using the +The script determines the default value for --platform using the $tcl_platform(os) and $tcl_platform(machine) variables. Supported platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". -If the -quick option is set to true, then the "veryquick.test" script -is run for all compilation configurations. Otherwise, sometimes "all.test" -is run, sometimes "veryquick.test". - -Almost any SQLite makefile (except those generated by configure - see below) -should work. The following properties are required: - - * The makefile should support the "fulltest" target. - * The makefile should support the variable "OPTS" as a way to pass - options from the make command line to lemon and the C compiler. - -More precisely, the following invocation must be supported: - - make -f $::MAKEFILE fulltest OPTS="-DSQLITE_SECURE_DELETE=1 -DSQLITE_DEBUG=1" - -Makefiles generated by the sqlite configure program cannot be used as -they do not respect the OPTS variable. - -Example Makefile contents: - - ######################################################## - TOP=/home/dan/work/sqlite/sqlite - - TCL_FLAGS=-I/home/dan/tcl/include - LIBTCL=-L/home/dan/tcl/lib -ltcl - - BCC = gcc - TCC = gcc -ansi -g $(CFLAGS) - NAWK = awk - AR = ar cr - RANLIB = ranlib - THREADLIB = -lpthread -ldl - include $(TOP)/main.mk - ######################################################## +Every test begins with a fresh run of the configure script at the top +of the SQLite source tree. } array set ::Configs { @@ -228,13 +199,12 @@ foreach {key value} [array get ::Platforms] { } proc run_test_suite {name testtarget config} { - # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS is only passed to gcc. # - set cflags "" + set cflags "-g" set opts "" foreach arg $config { if {[string match -D* $arg]} { @@ -258,30 +228,46 @@ proc run_test_suite {name testtarget config} { append opts " -DSQLITE_OS_UNIX=1" } - # Run the test. - # - set makefile [file normalize $::MAKEFILE] - file mkdir $dir - puts -nonewline "Testing configuration \"$name\" (logfile=$dir/test.log)..." - flush stdout + dryrun file mkdir $dir + if {!$::DRYRUN} { + set n [string length $name] + puts -nonewline "${name}[string repeat . [expr {40-$n}]]" + flush stdout + } - set makecmd [concat \ - [list exec make -C $dir -f $makefile clean] \ - $testtarget \ - [list CFLAGS=$cflags OPTS=$opts >& $dir/test.log] \ - ] - - set tm1 [clock seconds] - set rc [catch $makecmd] + set tm1 [clock seconds] + set origdir [pwd] + dryrun cd $dir + set rc [catch [list dryrun exec $::SRCDIR/configure >& test.log]] + if {!$rc} { + set rc [catch [list dryrun exec make clean $testtarget \ + CFLAGS=$cflags OPTS=$opts >>& test.log]] + } set tm2 [clock seconds] + dryrun cd $origdir - set minutes [expr {($tm2-$tm1)/60}] - set seconds [expr {($tm2-$tm1)%60}] - puts -nonewline [format " (%d:%.2d) " $minutes $seconds] - if {$rc} { - puts "FAILED." + if {!$::DRYRUN} { + set minutes [expr {($tm2-$tm1)/60}] + set seconds [expr {($tm2-$tm1)%60}] + set tm [format (%02d:%02d) $minutes $seconds] + if {$rc} { + puts " FAIL $tm" + incr ::NERR + } else { + puts " Ok $tm" + } + } +} + +# The following procedure either prints its arguments (if ::DRYRUN is true) +# or executes the command of its arguments in the calling context +# (if ::DRYRUN is false). +# +proc dryrun {args} { + if {$::DRYRUN} { + puts $args } else { - puts "Ok." + uplevel 1 $args } } @@ -292,16 +278,21 @@ proc run_test_suite {name testtarget config} { # option. # proc process_options {argv} { - set ::MAKEFILE releasetest.mk ;# Default value - set ::QUICK 0 ;# Default value + set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] + set ::QUICK 0 + set ::BUILDONLY 0 + set ::DRYRUN 0 + set ::EXEC exec set config {} set platform $::tcl_platform(os)-$::tcl_platform(machine) for {set i 0} {$i < [llength $argv]} {incr i} { - switch -- [lindex $argv $i] { - -makefile { + set x [lindex $argv $i] + if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} + switch -- $x { + -srcdir { incr i - set ::MAKEFILE [lindex $argv $i] + set ::SRCDIR [file normalize [lindex $argv $i]] } -platform { @@ -310,14 +301,40 @@ proc process_options {argv} { } -quick { - incr i - set ::QUICK [lindex $argv $i] + set ::QUICK 1 } -config { incr i set config [lindex $argv $i] } + + -buildonly { + set ::BUILDONLY 1 + } + + -dryrun { + set ::DRYRUN 1 + } + + -info { + puts "Command-line Options:" + puts " --srcdir $::SRCDIR" + puts " --platform [list $platform]" + puts " --config [list $config]" + if {$::QUICK} {puts " --quick"} + if {$::BUILDONLY} {puts " --buildonly"} + if {$::DRYRUN} {puts " --dryrun"} + puts "\nAvailable --platform options:" + foreach y [lsort [array names ::Platforms]] { + puts " [list $y]" + } + puts "\nAvailable --config options:" + foreach y [lsort [array names ::Configs]] { + puts " [list $y]" + } + exit + } default { puts stderr "" @@ -327,8 +344,6 @@ proc process_options {argv} { } } - set ::MAKEFILE [file normalize $::MAKEFILE] - if {0==[info exists ::Platforms($platform)]} { puts "Unknown platform: $platform" puts -nonewline "Set the -platform option to " @@ -347,8 +362,13 @@ proc process_options {argv} { } else { set ::CONFIGLIST $::Platforms($platform) } - puts "Running the following configurations for $platform:" + puts "Running the following test configurations for $platform:" puts " [string trim $::CONFIGLIST]" + puts -nonewline "Flags:" + if {$::DRYRUN} {puts -nonewline " --dryrun"} + if {$::BUILDONLY} {puts -nonewline " --buildonly"} + if {$::QUICK} {puts -nonewline " --quick"} + puts "" } # Main routine. @@ -357,30 +377,41 @@ proc main {argv} { # Process any command line options. process_options $argv + puts [string repeat * 70] + set NERR 0 + set NTEST 0 + set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} + if {$::BUILDONLY} {set target testfixture} set config_options $::Configs($zConfig) + incr NTEST run_test_suite $zConfig $target $config_options # If the configuration included the SQLITE_DEBUG option, then remove # it and run veryquick.test. If it did not include the SQLITE_DEBUG option # add it and run veryquick.test. - if {$target!="checksymbols"} { + if {$target!="checksymbols" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] if {$debug_idx < 0} { + incr NTEST run_test_suite "${zConfig}_debug" test [ concat $config_options -DSQLITE_DEBUG=1 ] } else { + incr NTEST run_test_suite "${zConfig}_ndebug" test [ lreplace $config_options $debug_idx $debug_idx ] } } - } + + set elapsetime [expr {[clock seconds]-$STARTTIME}] + puts [string repeat * 70] + puts "$NERR failures of $NTEST test suites run in $elapsetime seconds" } main $argv From 00fa334a0b698bb6fb197961d9312e05c67ae5f1 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 19:52:26 +0000 Subject: [PATCH 03/29] Add the "checksymbols" target to Makefile.in FossilOrigin-Name: 5bd73dba5e278db81f7d728c75e3142c02d37ff7 --- Makefile.in | 7 +++++++ manifest | 15 ++++++--------- manifest.uuid | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4929ce313c..db4c23b5bd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -969,6 +969,13 @@ wordcount$(TEXE): $(TOP)/test/wordcount.c sqlite3.c speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo $(LTLINK) -o $@ $(TOP)/test/speedtest1.c sqlite3.lo $(TLIBS) +# This target will fail if the SQLite amalgamation contains any exported +# symbols that do not begin with "sqlite3_". It is run as part of the +# releasetest.tcl script. +# +checksymbols: sqlite3.o + nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 + # Standard install and cleanup targets # lib_install: libsqlite3.la diff --git a/manifest b/manifest index 63ed4c71f6..d608fa8851 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Rework\sthe\stest/releasetest.tcl\sscript\sso\sthat\sit\suses\sthe\sautoconf\smakefile\ninstead\sof\sthe\stest/releasetest.mk\smakefile.\s\sAlso\sadd\soptions\slike\s--dryrun\nand\s--buildonly.\s\sOmit\sthe\s--makefile\soption\sand\sreplace\sit\swith\s--srcdir\nwith\sthe\sdefault\scomputed\srelative\sto\sthe\sreleasetest.tcl\sscript\sitself. -D 2014-12-23T19:40:51.746 +C Add\sthe\s"checksymbols"\starget\sto\sMakefile.in +D 2014-12-23T19:52:26.814 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 +F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -1233,10 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 -R d1cf8fd2536e09346a06ad4dd6ebb5ea -T *branch * releasetest-refactor -T *sym-releasetest-refactor * -T -sym-trunk * +P 7c85e831153f9aef2afaf981d53db38a28091be5 +R c05ea3aeb104c4afb51e4fdc443cf2a6 U drh -Z 1d662dddfc70aa251729f355b7103297 +Z 02c9f8fd295b123fa2397cb2b2094ed6 diff --git a/manifest.uuid b/manifest.uuid index f2873c82b4..47558f25fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7c85e831153f9aef2afaf981d53db38a28091be5 \ No newline at end of file +5bd73dba5e278db81f7d728c75e3142c02d37ff7 \ No newline at end of file From e5d7bf1e4c0f20277b5d98227dcc8461919f7853 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:05:19 +0000 Subject: [PATCH 04/29] Fix a potential segfault following OOM error in the test harness. The SQLite core itself is not at fault. FossilOrigin-Name: 1bb26695ff28a96d740752e327c2e0a0da1d067e --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/test1.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 545fed12be..eb52499b91 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\san\sevidence\smark\son\sa\stest\sscript.\s\sNo\schanges\sto\scode. -D 2014-12-22T22:02:20.146 +C Fix\sa\spotential\ssegfault\sfollowing\sOOM\serror\sin\sthe\stest\sharness.\s\sThe\nSQLite\score\sitself\sis\snot\sat\sfault. +D 2014-12-23T20:05:19.241 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -238,7 +238,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 56e33bf6b1827c6ca7520c189131ddd778fb2267 +F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7a97826f33460f3b4f3890c9cf97116c3355eeda -R 75921305dcdb8922f71566b00cf9fa0c +P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 +R 6f17c6ca29a22c9a696402dcec6c7766 U drh -Z 6c9fa3fa92317b5bccccc5c856a1593a +Z 3a6a677c416cfd077a0efd463f488c83 diff --git a/manifest.uuid b/manifest.uuid index 9504503c19..83787366b0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 \ No newline at end of file +1bb26695ff28a96d740752e327c2e0a0da1d067e \ No newline at end of file diff --git a/src/test1.c b/src/test1.c index 40acac8360..032e3f338c 100644 --- a/src/test1.c +++ b/src/test1.c @@ -3670,7 +3670,7 @@ static int test_prepare_v2( assert(rc==SQLITE_OK || pStmt==0); Tcl_ResetResult(interp); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( zTail && objc>=5 ){ + if( rc==SQLITE_OK && zTail && objc>=5 ){ if( bytes>=0 ){ bytes = bytes - (int)(zTail-zSql); } From 7284056ad665013f991eaa74e6c23bcd69bab68f Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 20:22:57 +0000 Subject: [PATCH 05/29] Draft of changes necessary to make releasetest work on Windows via MinGW. FossilOrigin-Name: af166c5c64216d845269410d1ac2493310694b86 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 44 ++++++++++++++++++++++++++++++++++---------- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index d608fa8851..ac6be8ffcb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"checksymbols"\starget\sto\sMakefile.in -D 2014-12-23T19:52:26.814 +C Draft\sof\schanges\snecessary\sto\smake\sreleasetest\swork\son\sWindows\svia\sMinGW. +D 2014-12-23T20:22:57.094 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl b57a20ccc7aa64be8b52906d211b1ed4c0998cc2 +F test/releasetest.tcl ed2f3293c318e0c80f6dfd099dde529f60e6d048 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 7c85e831153f9aef2afaf981d53db38a28091be5 -R c05ea3aeb104c4afb51e4fdc443cf2a6 -U drh -Z 02c9f8fd295b123fa2397cb2b2094ed6 +P 5bd73dba5e278db81f7d728c75e3142c02d37ff7 +R 9f40447b09389fdd147e8f95f68f235c +U mistachkin +Z 2d56af309587de973049953da48ad3d0 diff --git a/manifest.uuid b/manifest.uuid index 47558f25fb..5a8726daed 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5bd73dba5e278db81f7d728c75e3142c02d37ff7 \ No newline at end of file +af166c5c64216d845269410d1ac2493310694b86 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index fae7d3c8f6..e0738d9c4f 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -6,7 +6,7 @@ # set ::USAGE_MESSAGE { This Tcl script is used to test the various configurations required -before releasing a new version. Supported command line options (all +before releasing a new version. Supported command line options (all optional) are: --srcdir TOP-OF-SQLITE-TREE (see below) @@ -14,14 +14,14 @@ optional) are: --config CONFIGNAME (Run only CONFIGNAME) --quick (Run "veryquick.test" only) --buildonly (Just build testfixture - do not run) - --dryrun (Print what would have happened) + --dryrun (Print what would have happened) --info (Show diagnostic info) The default value for --srcdir is the parent of the directory holding this script. The script determines the default value for --platform using the -$tcl_platform(os) and $tcl_platform(machine) variables. Supported +$tcl_platform(os) and $tcl_platform(machine) variables. Supported platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". Every test begins with a fresh run of the configure script at the top @@ -132,7 +132,7 @@ array set ::Configs { -DSQLITE_DEFAULT_CACHE_SIZE=1000 -DSQLITE_MAX_LENGTH=2147483645 -DSQLITE_MAX_VARIABLE_NUMBER=500000 - -DSQLITE_DEBUG=1 + -DSQLITE_DEBUG=1 -DSQLITE_PREFER_PROXY_LOCKING=1 } "Extra-Robustness" { @@ -182,6 +182,9 @@ array set ::Platforms { "Locking-Style" test "OS-X" "threadtest fulltest" } + "Windows NT-intel" { + "Default" "threadtest fulltest" + } } @@ -199,7 +202,7 @@ foreach {key value} [array get ::Platforms] { } proc run_test_suite {name testtarget config} { - # Tcl variable $opts is used to build up the value used to set the + # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS is only passed to gcc. @@ -238,10 +241,9 @@ proc run_test_suite {name testtarget config} { set tm1 [clock seconds] set origdir [pwd] dryrun cd $dir - set rc [catch [list dryrun exec $::SRCDIR/configure >& test.log]] + set rc [catch [configureCommand]] if {!$rc} { - set rc [catch [list dryrun exec make clean $testtarget \ - CFLAGS=$cflags OPTS=$opts >>& test.log]] + set rc [catch [makeCommand $testtarget $cflags $opts]] } set tm2 [clock seconds] dryrun cd $origdir @@ -259,8 +261,30 @@ proc run_test_suite {name testtarget config} { } } +# The following procedure returns the "configure" command to be exectued for +# the current platform, which may be Windows (via MinGW, etc). +# +proc configureCommand {} { + set result [list dryrun exec] + if {$::tcl_platform(platform)=="windows"} { + lappend result sh + } + lappend result $::SRCDIR/configure >& test.log +} + +# The following procedure returns the "make" command to be executed for the +# specified targets, compiler flags, and options. +# +proc makeCommand { targets cflags opts } { + set result [list dryrun exec make clean] + foreach target $targets { + lappend result $target + } + lappend result CFLAGS=$cflags OPTS=$opts >>& test.log +} + # The following procedure either prints its arguments (if ::DRYRUN is true) -# or executes the command of its arguments in the calling context +# or executes the command of its arguments in the calling context # (if ::DRYRUN is false). # proc dryrun {args} { @@ -335,7 +359,7 @@ proc process_options {argv} { } exit } - + default { puts stderr "" puts stderr [string trim $::USAGE_MESSAGE] From 069b8f2cb3623b9b0905673433b1ada1325fbcb5 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:31:43 +0000 Subject: [PATCH 06/29] Add the threadtest target to Makefile.in. Add --enable-load-extension to the configure issued by releasetest.tcl. FossilOrigin-Name: cb128067faabf0503dff1298ed29934f484f71bb --- Makefile.in | 17 +++++++++++++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index db4c23b5bd..04305350be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -976,6 +976,23 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo checksymbols: sqlite3.o nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 +# The next two rules are used to support the "threadtest" target. Building +# threadtest runs a few thread-safety tests that are implemented in C. This +# target is invoked by the releasetest.tcl script. +# +THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ + $(TOP)/test/tt3_checkpoint.c \ + $(TOP)/test/tt3_index.c \ + $(TOP)/test/tt3_vacuum.c \ + $(TOP)/test/tt3_stress.c \ + $(TOP)/test/tt3_lookaside1.c + +threadtest3$(TEXE): sqlite3.o $(THREADTEST3_SRC) + $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.o -o $@ $(TLIBS) + +threadtest: threadtest3$(TEXE) + ./threadtest3$(TEXE) + # Standard install and cleanup targets # lib_install: libsqlite3.la diff --git a/manifest b/manifest index ac6be8ffcb..36c6416518 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Draft\sof\schanges\snecessary\sto\smake\sreleasetest\swork\son\sWindows\svia\sMinGW. -D 2014-12-23T20:22:57.094 +C Add\sthe\sthreadtest\starget\sto\sMakefile.in.\s\sAdd\s--enable-load-extension\sto\nthe\sconfigure\sissued\sby\sreleasetest.tcl. +D 2014-12-23T20:31:43.428 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 37aec21b4fbb469ba42985a4454adf424c84f8e4 +F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl ed2f3293c318e0c80f6dfd099dde529f60e6d048 +F test/releasetest.tcl 8563ba7df4b8cb9a9ee9ccd042f14f0553e62f63 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5bd73dba5e278db81f7d728c75e3142c02d37ff7 -R 9f40447b09389fdd147e8f95f68f235c -U mistachkin -Z 2d56af309587de973049953da48ad3d0 +P af166c5c64216d845269410d1ac2493310694b86 +R 84b62c16990cff93a3eab955a0ae7d8d +U drh +Z 40c138478ca76e8e420aceec7c5661be diff --git a/manifest.uuid b/manifest.uuid index 5a8726daed..5424c8d2ee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -af166c5c64216d845269410d1ac2493310694b86 \ No newline at end of file +cb128067faabf0503dff1298ed29934f484f71bb \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index e0738d9c4f..f7aef83c1c 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -269,7 +269,7 @@ proc configureCommand {} { if {$::tcl_platform(platform)=="windows"} { lappend result sh } - lappend result $::SRCDIR/configure >& test.log + lappend result $::SRCDIR/configure -enable-load-extension >& test.log } # The following procedure returns the "make" command to be executed for the From e43ff920ceeac2fb2c2127e639cbde892d7033bf Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 23 Dec 2014 20:41:13 +0000 Subject: [PATCH 07/29] In the releasetest.tcl script, show the test target for each configuration that is run. And show the time in HH:MM:SS. FossilOrigin-Name: 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 10 ++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 36c6416518..e882294d9d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sthreadtest\starget\sto\sMakefile.in.\s\sAdd\s--enable-load-extension\sto\nthe\sconfigure\sissued\sby\sreleasetest.tcl. -D 2014-12-23T20:31:43.428 +C In\sthe\sreleasetest.tcl\sscript,\sshow\sthe\stest\starget\sfor\seach\sconfiguration\nthat\sis\srun.\s\sAnd\sshow\sthe\stime\sin\sHH:MM:SS. +D 2014-12-23T20:41:13.506 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 8563ba7df4b8cb9a9ee9ccd042f14f0553e62f63 +F test/releasetest.tcl 84b224e46e8d31c26591518ff91daf88c602decb F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P af166c5c64216d845269410d1ac2493310694b86 -R 84b62c16990cff93a3eab955a0ae7d8d +P cb128067faabf0503dff1298ed29934f484f71bb +R e47d011ee548c05856b81e40855ed9d3 U drh -Z 40c138478ca76e8e420aceec7c5661be +Z 930cf73b25702ad0596e5aa07bf5b1dd diff --git a/manifest.uuid b/manifest.uuid index 5424c8d2ee..8208554d56 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -cb128067faabf0503dff1298ed29934f484f71bb \ No newline at end of file +2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index f7aef83c1c..b7090143cc 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -233,8 +233,9 @@ proc run_test_suite {name testtarget config} { dryrun file mkdir $dir if {!$::DRYRUN} { - set n [string length $name] - puts -nonewline "${name}[string repeat . [expr {40-$n}]]" + set title ${name}($testtarget) + set n [string length $title] + puts -nonewline "${title}[string repeat . [expr {54-$n}]]" flush stdout } @@ -249,9 +250,10 @@ proc run_test_suite {name testtarget config} { dryrun cd $origdir if {!$::DRYRUN} { - set minutes [expr {($tm2-$tm1)/60}] + set hours [expr {($tm2-$tm2)/3600}] + set minutes [expr {(($tm2-$tm1)/60)%60}] set seconds [expr {($tm2-$tm1)%60}] - set tm [format (%02d:%02d) $minutes $seconds] + set tm [format (%02d:%02d:%02d) $hours $minutes $seconds] if {$rc} { puts " FAIL $tm" incr ::NERR From 054450f0bdc3bdae1da45281d96659a60aaebac8 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 20:42:48 +0000 Subject: [PATCH 08/29] Permit sqlite3_shutdown() to be called with OMIT_WSD enabled and without having called sqlite3_initialize() first. FossilOrigin-Name: 3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/main.c | 7 +++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index eb52499b91..46ba432235 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\spotential\ssegfault\sfollowing\sOOM\serror\sin\sthe\stest\sharness.\s\sThe\nSQLite\score\sitself\sis\snot\sat\sfault. -D 2014-12-23T20:05:19.241 +C Permit\ssqlite3_shutdown()\sto\sbe\scalled\swith\sOMIT_WSD\senabled\sand\swithout\shaving\scalled\ssqlite3_initialize()\sfirst. +D 2014-12-23T20:42:48.779 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c ee498c89735ba7b581fbd58d2ad2e7679a0475b2 +F src/main.c 784f3d613f08d8bfba238a5baa7398770a641de2 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P a08b0c7512287ce5ae3fffe02c092d0eb25b3a25 -R 6f17c6ca29a22c9a696402dcec6c7766 -U drh -Z 3a6a677c416cfd077a0efd463f488c83 +P 1bb26695ff28a96d740752e327c2e0a0da1d067e +R 69846a8eed33bdc4ac13d4f2cdf5a199 +U mistachkin +Z c9331cbf8b5ecd4eca34d95e3015ec1f diff --git a/manifest.uuid b/manifest.uuid index 83787366b0..5e20eb47ce 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1bb26695ff28a96d740752e327c2e0a0da1d067e \ No newline at end of file +3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 76af9a2e95..16e9a1babb 100644 --- a/src/main.c +++ b/src/main.c @@ -271,6 +271,13 @@ int sqlite3_initialize(void){ ** when this routine is invoked, then this routine is a harmless no-op. */ int sqlite3_shutdown(void){ +#ifdef SQLITE_OMIT_WSD + int rc = sqlite3_wsd_init(4096, 24); + if( rc!=SQLITE_OK ){ + return rc; + } +#endif + if( sqlite3GlobalConfig.isInit ){ #ifdef SQLITE_EXTRA_SHUTDOWN void SQLITE_EXTRA_SHUTDOWN(void); From 4d03a381f82dd43250686939d88501fbafefedf9 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 21:03:09 +0000 Subject: [PATCH 09/29] Fix typo in library object file name. FossilOrigin-Name: f49566a79d05e630a86ea7b2acc04672d76d6337 --- Makefile.in | 8 ++++---- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index 04305350be..6a944fdded 100644 --- a/Makefile.in +++ b/Makefile.in @@ -973,8 +973,8 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo # symbols that do not begin with "sqlite3_". It is run as part of the # releasetest.tcl script. # -checksymbols: sqlite3.o - nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 +checksymbols: sqlite3.lo + nm -g --defined-only sqlite3.lo | grep -v " sqlite3_" ; test $$? -ne 0 # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This @@ -987,8 +987,8 @@ THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ $(TOP)/test/tt3_stress.c \ $(TOP)/test/tt3_lookaside1.c -threadtest3$(TEXE): sqlite3.o $(THREADTEST3_SRC) - $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.o -o $@ $(TLIBS) +threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC) + $(LTLINK) $(TOP)/test/threadtest3.c sqlite3.lo -o $@ $(TLIBS) threadtest: threadtest3$(TEXE) ./threadtest3$(TEXE) diff --git a/manifest b/manifest index e882294d9d..90187d60b9 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C In\sthe\sreleasetest.tcl\sscript,\sshow\sthe\stest\starget\sfor\seach\sconfiguration\nthat\sis\srun.\s\sAnd\sshow\sthe\stime\sin\sHH:MM:SS. -D 2014-12-23T20:41:13.506 +C Fix\stypo\sin\slibrary\sobject\sfile\sname. +D 2014-12-23T21:03:09.146 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in c5bad35715abe0ffcb6a11fbafb157de7405d51a +F Makefile.in 9aaaaf6b5b0e4b42aa909db5165dc042db9bfcd5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P cb128067faabf0503dff1298ed29934f484f71bb -R e47d011ee548c05856b81e40855ed9d3 -U drh -Z 930cf73b25702ad0596e5aa07bf5b1dd +P 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 +R a6e41f52bbcb02764e8ea99c7fc0d456 +U mistachkin +Z 6ab7423cea251d6a6862aa20cc19aa93 diff --git a/manifest.uuid b/manifest.uuid index 8208554d56..60a6c38f0f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 \ No newline at end of file +f49566a79d05e630a86ea7b2acc04672d76d6337 \ No newline at end of file From 29f98f307764438cef900bfe76b74c2aedab102a Mon Sep 17 00:00:00 2001 From: mistachkin Date: Tue, 23 Dec 2014 21:10:38 +0000 Subject: [PATCH 10/29] Remove 'threadtest' as a target on Windows, due to lack of pthreads. Also, change 'fulltest' to 'fulltestonly'. FossilOrigin-Name: a010c404b5140104b68087dcbb0698b7a85eef65 --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/releasetest.tcl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 90187d60b9..89f8b08461 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stypo\sin\slibrary\sobject\sfile\sname. -D 2014-12-23T21:03:09.146 +C Remove\s'threadtest'\sas\sa\starget\son\sWindows,\sdue\sto\slack\sof\spthreads.\s\sAlso,\schange\s'fulltest'\sto\s'fulltestonly'. +D 2014-12-23T21:10:38.485 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 9aaaaf6b5b0e4b42aa909db5165dc042db9bfcd5 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 84b224e46e8d31c26591518ff91daf88c602decb +F test/releasetest.tcl ba6e760aed00b829bd0718d61d9e605d56b0bd8d F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2295e9e0a22220ccb1b9cc2b031c1d8e702a1888 -R a6e41f52bbcb02764e8ea99c7fc0d456 +P f49566a79d05e630a86ea7b2acc04672d76d6337 +R 333eb3cbf92231ab2930505109652a4c U mistachkin -Z 6ab7423cea251d6a6862aa20cc19aa93 +Z 00b07e8b2b9d92ea23f97a4876d4552f diff --git a/manifest.uuid b/manifest.uuid index 60a6c38f0f..89f5792bcc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f49566a79d05e630a86ea7b2acc04672d76d6337 \ No newline at end of file +a010c404b5140104b68087dcbb0698b7a85eef65 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index b7090143cc..2459422c5e 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -183,7 +183,7 @@ array set ::Platforms { "OS-X" "threadtest fulltest" } "Windows NT-intel" { - "Default" "threadtest fulltest" + "Default" "fulltestonly" } } From 8038953c15707754a842ce4f1e9b8bc9d69ce58d Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 Dec 2014 17:17:30 +0000 Subject: [PATCH 11/29] When building the amalgamation with SQLITE_ENABLE_IOTRACE defined, do not mark symbol sqlite3IoTrace as static. FossilOrigin-Name: 5b7ca013b7171a6807b15b128e140ce160f526d3 --- manifest | 17 ++++++++--------- manifest.uuid | 2 +- src/main.c | 2 +- tool/mksqlite3c.tcl | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 7175c91a50..cb39ca6035 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sthe\snew\sand\simproved\sreleasetest.tcl\sscript\sinto\strunk.\s\sAdd\sa\n"make\sreleasetest"\starget\sto\sthe\sautoconf\smakefile. -D 2014-12-23T21:17:58.595 +C When\sbuilding\sthe\samalgamation\swith\sSQLITE_ENABLE_IOTRACE\sdefined,\sdo\snot\smark\ssymbol\ssqlite3IoTrace\sas\sstatic. +D 2014-12-24T17:17:30.707 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c 784f3d613f08d8bfba238a5baa7398770a641de2 +F src/main.c fa2128ef7d6a3dcd6770b2b1f3c284b696f11a2a F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f @@ -1200,7 +1200,7 @@ F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkpragmatab.tcl 07a5124cf2dbafa1b375eefcf8ac4227028b0f8b F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 F tool/mksqlite3c-noext.tcl 88a1e3b0c769773fb7a9ebb363ffc603a4ac21d8 -F tool/mksqlite3c.tcl e72c0c97fe1a105fa9616483e652949be2199fe6 +F tool/mksqlite3c.tcl e94bdc37b531bba50d421e82efbe3738d0c1e950 F tool/mksqlite3h.tcl ba24038056f51fde07c0079c41885ab85e2cff12 F tool/mksqlite3internalh.tcl b6514145a7d5321b47e64e19b8116cc44f973eb1 F tool/mkvsix.tcl 52a4c613707ac34ae9c226e5ccc69cb948556105 @@ -1233,8 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3f7dbdb5df38bd4b8cd49d22a23b8412b8d506e5 a010c404b5140104b68087dcbb0698b7a85eef65 -R c03b15cfdf1585f3588eb5fb232886aa -T +closed a010c404b5140104b68087dcbb0698b7a85eef65 -U drh -Z 23d8a858cc383cd4bc2fa2df9f7a8bc3 +P 1deb00ec758c6d213da71ef64294cc816e204338 +R 94b7be58e117bbe257a3aeec77eff05b +U dan +Z 725f19b25ac60ae68e0c4f9942138bfa diff --git a/manifest.uuid b/manifest.uuid index 9aa2bbe3dc..0b171fb5d1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1deb00ec758c6d213da71ef64294cc816e204338 \ No newline at end of file +5b7ca013b7171a6807b15b128e140ce160f526d3 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 16e9a1babb..3220cfe8f6 100644 --- a/src/main.c +++ b/src/main.c @@ -62,7 +62,7 @@ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } ** I/O active are written using this function. These messages ** are intended for debugging activity only. */ -void (*sqlite3IoTrace)(const char*, ...) = 0; +/* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0; #endif /* diff --git a/tool/mksqlite3c.tcl b/tool/mksqlite3c.tcl index 0e979234f3..72098c7357 100644 --- a/tool/mksqlite3c.tcl +++ b/tool/mksqlite3c.tcl @@ -212,7 +212,7 @@ proc copy_file {filename} { } } elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} { regsub {^SQLITE_EXTERN } $line {} line - puts $out "SQLITE_PRIVATE $line" + puts $out $line } elseif {[regexp {^void \(\*sqlite3Os} $line]} { puts $out "SQLITE_PRIVATE $line" } else { From ee7172f12ad51ee528da22fa5ea72073c23dd5f4 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 Dec 2014 18:11:50 +0000 Subject: [PATCH 12/29] Fix a failing assert() in balance_nonroot(). FossilOrigin-Name: e2e323145f66cca31babe1a979db6ef97038b879 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/btree.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index cb39ca6035..d97e03238b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\sbuilding\sthe\samalgamation\swith\sSQLITE_ENABLE_IOTRACE\sdefined,\sdo\snot\smark\ssymbol\ssqlite3IoTrace\sas\sstatic. -D 2014-12-24T17:17:30.707 +C Fix\sa\sfailing\sassert()\sin\sbalance_nonroot(). +D 2014-12-24T18:11:50.466 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,7 +173,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c 1de0560426ecde85ff3ea95d7c94261d7652e284 +F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1deb00ec758c6d213da71ef64294cc816e204338 -R 94b7be58e117bbe257a3aeec77eff05b +P 5b7ca013b7171a6807b15b128e140ce160f526d3 +R b11f421779b35c3a19d382d5b3ba189c U dan -Z 725f19b25ac60ae68e0c4f9942138bfa +Z 0b37a721b79ad0d2f596c72e79efffa8 diff --git a/manifest.uuid b/manifest.uuid index 0b171fb5d1..8989984104 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5b7ca013b7171a6807b15b128e140ce160f526d3 \ No newline at end of file +e2e323145f66cca31babe1a979db6ef97038b879 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index e6a7e2c2b9..0554f3fa3c 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6865,8 +6865,8 @@ static int balance_nonroot( /* Do not allow any cells smaller than 4 bytes. If a smaller cell ** does exist, pad it with 0x00 bytes. */ assert( szCell[nCell]==3 ); - assert( apCell[nCell]==&pTemp[iSpace1-3] ); - pTemp[iSpace1++] = 0x00; + assert( apCell[nCell]==&aSpace1[iSpace1-3] ); + aSpace1[iSpace1++] = 0x00; szCell[nCell] = 4; } } From 97876ee666274615c4034cc3658a52b976aa2493 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 24 Dec 2014 23:35:36 +0000 Subject: [PATCH 13/29] Fix the error counter in releasetest.tcl. And report the total time in HH:MM:SS instead of just seconds. FossilOrigin-Name: 6396f8046242286298fecd1748a6e8e786e6794e --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 10 +++++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index d97e03238b..f5b01362a2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sfailing\sassert()\sin\sbalance_nonroot(). -D 2014-12-24T18:11:50.466 +C Fix\sthe\serror\scounter\sin\sreleasetest.tcl.\s\sAnd\sreport\sthe\stotal\stime\sin\nHH:MM:SS\sinstead\sof\sjust\sseconds. +D 2014-12-24T23:35:36.745 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl ba6e760aed00b829bd0718d61d9e605d56b0bd8d +F test/releasetest.tcl 80d10f058667e6d0c8ab379d6e5bb0a60ecb40e2 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 5b7ca013b7171a6807b15b128e140ce160f526d3 -R b11f421779b35c3a19d382d5b3ba189c -U dan -Z 0b37a721b79ad0d2f596c72e79efffa8 +P e2e323145f66cca31babe1a979db6ef97038b879 +R 5d68ae4c7a1de514625f0040c5883c44 +U drh +Z 5948198e5a17f619d6c7388ef4763f03 diff --git a/manifest.uuid b/manifest.uuid index 8989984104..70b92936b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2e323145f66cca31babe1a979db6ef97038b879 \ No newline at end of file +6396f8046242286298fecd1748a6e8e786e6794e \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 2459422c5e..879b7f8fb9 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -405,8 +405,8 @@ proc main {argv} { process_options $argv puts [string repeat * 70] - set NERR 0 - set NTEST 0 + set ::NERR 0 + set ::NTEST 0 set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} @@ -436,8 +436,12 @@ proc main {argv} { } set elapsetime [expr {[clock seconds]-$STARTTIME}] + set hr [expr {$elapsetime/3600}] + set min [expr {($elapsetime/60)%60}] + set sec [expr {$elapsetime%60}] + set etime [format (%02d:%02d:%02d) $hr $min $sec] puts [string repeat * 70] - puts "$NERR failures of $NTEST test suites run in $elapsetime seconds" + puts "$::NERR failures of $::NTEST test suites run in $etime" } main $argv From 0ab0e05c6b3b5eee7f16bd76f8a59f397449c4d8 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 25 Dec 2014 12:19:56 +0000 Subject: [PATCH 14/29] Update the SQLITE_CONFIG_PAGECACHE documentation so that the maximum page size is correctly stated to be 65536. FossilOrigin-Name: 3286424b4d30035de69b88ef0b2897365ff848f9 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/sqlite.h.in | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index f5b01362a2..50e33c046d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\serror\scounter\sin\sreleasetest.tcl.\s\sAnd\sreport\sthe\stotal\stime\sin\nHH:MM:SS\sinstead\sof\sjust\sseconds. -D 2014-12-24T23:35:36.745 +C Update\sthe\sSQLITE_CONFIG_PAGECACHE\sdocumentation\sso\sthat\sthe\smaximum\spage\nsize\sis\scorrectly\sstated\sto\sbe\s65536. +D 2014-12-25T12:19:56.744 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -230,7 +230,7 @@ F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c f377fb8a5c73c10678ea74f3400f7913943e3d75 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf -F src/sqlite.h.in 116dc731361549ee3fc79dcebace11b57d24dcfd +F src/sqlite.h.in 47cb601ed2b2ea7f01119e2763185c809d8e82fa F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqliteInt.h d36da9a07130cae13cbfee0986bf20028cb01465 @@ -1233,7 +1233,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e2e323145f66cca31babe1a979db6ef97038b879 -R 5d68ae4c7a1de514625f0040c5883c44 +P 6396f8046242286298fecd1748a6e8e786e6794e +R 6fef442856f5d39a46d82b3795b528e7 U drh -Z 5948198e5a17f619d6c7388ef4763f03 +Z 07073e8eb87986ae3ece689929973238 diff --git a/manifest.uuid b/manifest.uuid index 70b92936b1..e53bf043df 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6396f8046242286298fecd1748a6e8e786e6794e \ No newline at end of file +3286424b4d30035de69b88ef0b2897365ff848f9 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 701e6de2e3..b525b396f4 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -1565,7 +1565,7 @@ struct sqlite3_mem_methods { ** 8-byte aligned ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument should be the size of the largest database page -** (a power of two between 512 and 32768) plus some extra bytes for each +** (a power of two between 512 and 65536) plus some extra bytes for each ** page header. ^The number of extra bytes needed by the page header ** can be determined using the [SQLITE_CONFIG_PCACHE_HDRSZ] option ** to [sqlite3_config()]. From e385d8876e86b8b8e615f2437112f10560ac427c Mon Sep 17 00:00:00 2001 From: drh Date: Sun, 28 Dec 2014 22:10:51 +0000 Subject: [PATCH 15/29] Fix WITHOUT ROWID tables so that they correctly deal with PRIMARY KEYs that contain redundant columns. FossilOrigin-Name: 0dfef6757056ef0bdea8f049f7469ccf6960e2cb --- manifest | 13 +++++++------ manifest.uuid | 2 +- src/build.c | 13 +++++++++++++ test/without_rowid6.test | 41 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 test/without_rowid6.test diff --git a/manifest b/manifest index 50e33c046d..ab14a67a57 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sSQLITE_CONFIG_PAGECACHE\sdocumentation\sso\sthat\sthe\smaximum\spage\nsize\sis\scorrectly\sstated\sto\sbe\s65536. -D 2014-12-25T12:19:56.744 +C Fix\sWITHOUT\sROWID\stables\sso\sthat\sthey\scorrectly\sdeal\swith\sPRIMARY\sKEYs\sthat\ncontain\sredundant\scolumns. +D 2014-12-28T22:10:51.114 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -176,7 +176,7 @@ F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 -F src/build.c 162d84e4833b03f9d07192ef06057b0226f6e543 +F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0 F src/complete.c 198a0066ba60ab06fc00fba1998d870a4d575463 F src/ctime.c df19848891c8a553c80e6f5a035e768280952d1a @@ -1178,6 +1178,7 @@ F test/without_rowid2.test af260339f79d13cb220288b67cd287fbcf81ad99 F test/without_rowid3.test 1081aabf60a1e1123b7f9a8f6ae19954351843b0 F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a F test/without_rowid5.test 61256715b686359df48ca1742db50cc7e3e7b862 +F test/without_rowid6.test deddb78ef539c355bddec00cdfaea6c56efd8b3f F test/wordcount.c 9915e06cb33d8ca8109b8700791afe80d305afda F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac @@ -1233,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6396f8046242286298fecd1748a6e8e786e6794e -R 6fef442856f5d39a46d82b3795b528e7 +P 3286424b4d30035de69b88ef0b2897365ff848f9 +R fdb1da8fdb04c896d0536c98941bdfa0 U drh -Z 07073e8eb87986ae3ece689929973238 +Z ccbcde8f60a3b3f04760cafd27073216 diff --git a/manifest.uuid b/manifest.uuid index e53bf043df..e8065acc31 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3286424b4d30035de69b88ef0b2897365ff848f9 \ No newline at end of file +0dfef6757056ef0bdea8f049f7469ccf6960e2cb \ No newline at end of file diff --git a/src/build.c b/src/build.c index db954647cc..f02989bffe 100644 --- a/src/build.c +++ b/src/build.c @@ -1713,6 +1713,19 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ pTab->iPKey = -1; }else{ pPk = sqlite3PrimaryKeyIndex(pTab); + /* + ** Remove all redundant columns from the PRIMARY KEY. For example, change + ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later + ** code assumes the PRIMARY KEY contains no repeated columns. + */ + for(i=j=1; inKeyCol; i++){ + if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){ + pPk->nColumn--; + }else{ + pPk->aiColumn[j++] = pPk->aiColumn[i]; + } + } + pPk->nKeyCol = j; } pPk->isCovering = 1; assert( pPk!=0 ); diff --git a/test/without_rowid6.test b/test/without_rowid6.test new file mode 100644 index 0000000000..e827ccab90 --- /dev/null +++ b/test/without_rowid6.test @@ -0,0 +1,41 @@ +# 2014-12-28 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# Verify that WITHOUT ROWID tables work correctly when the PRIMARY KEY +# has redundant columns. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_execsql_test without_rowid6-100 { + CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,a,b,c,d,a,b,c)) WITHOUT ROWID; + CREATE INDEX t1a ON t1(b, b); + WITH RECURSIVE + c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<1000) + INSERT INTO t1(a,b,c,d,e) SELECT i, i+1000, printf('x%dy',i), 0, 0 FROM c; + ANALYZE; +} {} +do_execsql_test without_rowid6-110 { + SELECT c FROM t1 WHERE a=123; +} {x123y} +do_execsql_test without_rowid6-120 { + SELECT c FROM t1 WHERE b=1123; +} {x123y} +do_execsql_test without_rowid6-130 { + SELECT c FROM t1 ORDER BY a DESC LIMIT 5; +} {x1000y x999y x998y x997y x996y} +do_execsql_test without_rowid6-140 { + SELECT c FROM t1 ORDER BY b LIMIT 5; +} {x1y x2y x3y x4y x5y} + + +finish_test From 277b4e446cb4400b107df38fb91553d8585e5ff1 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 02:55:58 +0000 Subject: [PATCH 16/29] Fix the "checksymbols" target in Makefile.in so that it actually works. Enhance the releasetest.tcl script to count the total number of tests run over all configurations. FossilOrigin-Name: 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 --- Makefile.in | 3 ++- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 39 +++++++++++++++++++++++++++++++++++++-- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 887f99e0ee..6867afcf52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -974,7 +974,8 @@ speedtest1$(TEXE): $(TOP)/test/wordcount.c sqlite3.lo # releasetest.tcl script. # checksymbols: sqlite3.lo - nm -g --defined-only sqlite3.lo | grep -v " sqlite3_" ; test $$? -ne 0 + nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 + echo '0 errors out of 1 tests' # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This diff --git a/manifest b/manifest index ab14a67a57..8891c37497 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Fix\sWITHOUT\sROWID\stables\sso\sthat\sthey\scorrectly\sdeal\swith\sPRIMARY\sKEYs\sthat\ncontain\sredundant\scolumns. -D 2014-12-28T22:10:51.114 +C Fix\sthe\s"checksymbols"\starget\sin\sMakefile.in\sso\sthat\sit\sactually\sworks.\nEnhance\sthe\sreleasetest.tcl\sscript\sto\scount\sthe\stotal\snumber\sof\stests\nrun\sover\sall\sconfigurations. +D 2014-12-29T02:55:58.026 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in c20e37499a3d664a3732257ed042352eba777a4d +F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 80d10f058667e6d0c8ab379d6e5bb0a60ecb40e2 +F test/releasetest.tcl 14552a8741165a0489cd9ec3e9a651ba1f1b3567 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3286424b4d30035de69b88ef0b2897365ff848f9 -R fdb1da8fdb04c896d0536c98941bdfa0 +P 0dfef6757056ef0bdea8f049f7469ccf6960e2cb +R 74cab324b9af5a87ce922fe9e97d1a6b U drh -Z ccbcde8f60a3b3f04760cafd27073216 +Z 3ab79c0378fea7c029a9124c0c9f4912 diff --git a/manifest.uuid b/manifest.uuid index e8065acc31..5ec8724985 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0dfef6757056ef0bdea8f049f7469ccf6960e2cb \ No newline at end of file +4eda1c746043acbdb7ef3e1f95bf8b01ee976479 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 879b7f8fb9..6a91ac585b 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -65,7 +65,6 @@ array set ::Configs { -DSQLITE_SECURE_DELETE=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_ATOMIC_WRITE=1 - -DSQLITE_ENABLE_IOTRACE=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 } @@ -201,6 +200,37 @@ foreach {key value} [array get ::Platforms] { } } +# Open the file $logfile and look for a report on the number of errors +# and the number of test cases run. Add these values to the global +# $::NERRCASE and $::NTESTCASE variables. +# +# If any errors occur, then write into $errmsgVar the text of an appropriate +# one-line error message to show on the output. +# +proc count_tests_and_errors {logfile rcVar errmsgVar} { + upvar 1 $rcVar rc $errmsgVar errmsg + set fd [open $logfile rb] + set seen 0 + while {![eof $fd]} { + set line [gets $fd] + if {[regexp {^(\d+) errors out of (\d+) tests} $line all nerr ntest]} { + incr ::NERRCASE $nerr + incr ::NTESTCASE $ntest + set seen 1 + if {$nerr>0} { + set rc 1 + set errmsg $line + } + break; + } + } + close $fd + if {!$seen} { + set rc 1 + set errmsg "Test did not complete" + } +} + proc run_test_suite {name testtarget config} { # Tcl variable $opts is used to build up the value used to set the # OPTS Makefile variable. Variable $cflags holds the value for @@ -242,9 +272,11 @@ proc run_test_suite {name testtarget config} { set tm1 [clock seconds] set origdir [pwd] dryrun cd $dir + set errmsg {} set rc [catch [configureCommand]] if {!$rc} { set rc [catch [makeCommand $testtarget $cflags $opts]] + count_tests_and_errors test.log rc errmsg } set tm2 [clock seconds] dryrun cd $origdir @@ -257,6 +289,7 @@ proc run_test_suite {name testtarget config} { if {$rc} { puts " FAIL $tm" incr ::NERR + if {$errmsg!=""} {puts " $errmsg"} } else { puts " Ok $tm" } @@ -407,6 +440,8 @@ proc main {argv} { set ::NERR 0 set ::NTEST 0 + set ::NTESTCASE 0 + set ::NERRCASE 0 set STARTTIME [clock seconds] foreach {zConfig target} $::CONFIGLIST { if {$::QUICK} {set target test} @@ -441,7 +476,7 @@ proc main {argv} { set sec [expr {$elapsetime%60}] set etime [format (%02d:%02d:%02d) $hr $min $sec] puts [string repeat * 70] - puts "$::NERR failures of $::NTEST test suites run in $etime" + puts "$::NERRCASE failures of $::NTESTCASE tests run in $etime" } main $argv From 622a53d54aa4f585ab8e465b9b9e7a208146ad9d Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 11:50:39 +0000 Subject: [PATCH 17/29] Reinstate an assert() by adding an "|| CORRUPT_DB" term. FossilOrigin-Name: 95ce20348d9b868a0407adccdb222a0e4c762945 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/wal.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 8891c37497..c6dc73b170 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\s"checksymbols"\starget\sin\sMakefile.in\sso\sthat\sit\sactually\sworks.\nEnhance\sthe\sreleasetest.tcl\sscript\sto\scount\sthe\stotal\snumber\sof\stests\nrun\sover\sall\sconfigurations. -D 2014-12-29T02:55:58.026 +C Reinstate\san\sassert()\sby\sadding\san\s"||\sCORRUPT_DB"\sterm. +D 2014-12-29T11:50:39.465 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -301,7 +301,7 @@ F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c c150803a3e98fbc68bd07772cbbd4328a0a7212d F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 -F src/wal.c 847692349eb6e1fb8543dbc97e69ddbfa4cc7ea7 +F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c d46de821bc604a4fd36fa3928c086950e91aafb1 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0dfef6757056ef0bdea8f049f7469ccf6960e2cb -R 74cab324b9af5a87ce922fe9e97d1a6b +P 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 +R 110d8f73632ac0551fa4d638f24a9811 U drh -Z 3ab79c0378fea7c029a9124c0c9f4912 +Z b99a612326485f12a8c134680408ea8b diff --git a/manifest.uuid b/manifest.uuid index 5ec8724985..bf6224e944 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4eda1c746043acbdb7ef3e1f95bf8b01ee976479 \ No newline at end of file +95ce20348d9b868a0407adccdb222a0e4c762945 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 2b80c7a95e..f2738a6727 100644 --- a/src/wal.c +++ b/src/wal.c @@ -2412,7 +2412,7 @@ int sqlite3WalFindFrame( for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){ u32 iFrame = aHash[iKey] + iZero; if( iFrame<=iLast && aPgno[aHash[iKey]]==pgno ){ - /* assert( iFrame>iRead ); -- not true if there is corruption */ + assert( iFrame>iRead || CORRUPT_DB ); iRead = iFrame; } if( (nCollide--)==0 ){ From 620315840c0f9797b85a09cebe94672575602caa Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 29 Dec 2014 12:02:31 +0000 Subject: [PATCH 18/29] Fix some recently added tests so that they work with SQLITE_DEFAULT_AUTOVACUUM=1. FossilOrigin-Name: ef0626ab20f753f01090ca8e8a94e8b516eea55e --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/e_walauto.test | 1 + test/e_walckpt.test | 2 ++ test/wal5.test | 11 ++++++----- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index c6dc73b170..ff08366760 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Reinstate\san\sassert()\sby\sadding\san\s"||\sCORRUPT_DB"\sterm. -D 2014-12-29T11:50:39.465 +C Fix\ssome\srecently\sadded\stests\sso\sthat\sthey\swork\swith\sSQLITE_DEFAULT_AUTOVACUUM=1. +D 2014-12-29T12:02:31.823 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -478,8 +478,8 @@ F test/e_update.test 312cb8f5ccfe41515a6bb092f8ea562a9bd54d52 F test/e_uri.test 5ae33760fb2039c61aa2d90886f1664664173585 F test/e_vacuum.test 5bfbdc21b65c0abf24398d0ba31dc88d93ca77a9 F test/e_wal.test 0967f0b8f1dfda871dc7b9b5574198f1f4f7d69a -F test/e_walauto.test eab3bedddbc3fd19795d51e618da41a48e19a3e3 -F test/e_walckpt.test 3116a98fa0dd9b2c9e493de7c59730adfe436746 +F test/e_walauto.test d2dfc6681aade1f1306a8a336f5a258d8b62becd +F test/e_walckpt.test 65e29b6631e51f210f83e4ff11571e647ba93608 F test/e_walhook.test da3ea8b3483d1af72190337bda50155a91a4b664 F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc2.test 83437a79ba1545a55fb549309175c683fb334473 @@ -1123,7 +1123,7 @@ F test/wal.test 885f32b2b390b30b4aa3dbb0e568f8f78d40f5cc F test/wal2.test 1f841d2048080d32f552942e333fd99ce541dada F test/wal3.test b22eb662bcbc148c5f6d956eaf94b047f7afe9c0 F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c -F test/wal5.test 174cc1512e304a7dfa28ac30527e28ea02fc37df +F test/wal5.test 11b8658dd4d5448f4604124bebd9b68be5bc3e66 F test/wal6.test 527581f5527bf9c24394991e2be83000aace5f9e F test/wal64k.test 163655ecd2cb8afef4737cac2a40fdd2eeaf20b8 F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 4eda1c746043acbdb7ef3e1f95bf8b01ee976479 -R 110d8f73632ac0551fa4d638f24a9811 -U drh -Z b99a612326485f12a8c134680408ea8b +P 95ce20348d9b868a0407adccdb222a0e4c762945 +R 0db2cbd8617dad79686d47ebce6896f7 +U dan +Z 03a26819b4fc4a14b459978f03e3e164 diff --git a/manifest.uuid b/manifest.uuid index bf6224e944..57a4b2b13b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -95ce20348d9b868a0407adccdb222a0e4c762945 \ No newline at end of file +ef0626ab20f753f01090ca8e8a94e8b516eea55e \ No newline at end of file diff --git a/test/e_walauto.test b/test/e_walauto.test index 79a2702d04..239adc3b95 100644 --- a/test/e_walauto.test +++ b/test/e_walauto.test @@ -66,6 +66,7 @@ foreach {tn code} { eval $code reset_db + execsql { PRAGMA auto_vacuum = 0 } do_execsql_test 1.$tn.0 { PRAGMA journal_mode = WAL } {wal} do_execsql_test 1.$tn.1 { CREATE TABLE t1(a, b) } set shmfd [open "test.db-shm" rb] diff --git a/test/e_walckpt.test b/test/e_walckpt.test index e6b6566bed..e022f840cf 100644 --- a/test/e_walckpt.test +++ b/test/e_walckpt.test @@ -247,6 +247,7 @@ foreach {tn script} { do_test $tn.3.2.1 { db2 eval { + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(x, y); INSERT INTO t1 VALUES(1,2); @@ -706,6 +707,7 @@ sqlite3 db2 test.db do_test 6.1 { execsql { + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); diff --git a/test/wal5.test b/test/wal5.test index 09c7d76040..8c1ec8bcc7 100644 --- a/test/wal5.test +++ b/test/wal5.test @@ -363,9 +363,10 @@ foreach {testprefix do_wal_checkpoint} { code2 $do_wal_checkpoint code3 $do_wal_checkpoint - do_test 3.$tn.1 { + do_test 4.$tn.1 { sql1 { PRAGMA page_size = 1024; + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; PRAGMA synchronous = normal; CREATE TABLE t1(x, y); @@ -376,14 +377,14 @@ foreach {testprefix do_wal_checkpoint} { file size test.db-wal } [wal_file_size 8 1024] - do_test 3.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0} - do_test 3.$tn.3 { file size test.db-wal } 0 + do_test 4.$tn.2 { do_wal_checkpoint db -mode truncate } {0 0 0} + do_test 4.$tn.3 { file size test.db-wal } 0 - do_test 3.$tn.4 { + do_test 4.$tn.4 { sql2 { SELECT * FROM t1 } } {1 2 3 4} - do_test 3.$tn.5 { + do_test 4.$tn.5 { sql2 { INSERT INTO t1 VALUES('a', 'b') } file size test.db-wal } [wal_file_size 2 1024] From cb281a9a2c3887f2e80aed8a59bcdf8c241c141b Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 29 Dec 2014 19:54:10 +0000 Subject: [PATCH 19/29] Fix the --dryrun option in releasetest.tcl. FossilOrigin-Name: 0f9e549643ab94b0465e6891384dd20506708a8f --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/releasetest.tcl | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index ff08366760..101d767d16 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\srecently\sadded\stests\sso\sthat\sthey\swork\swith\sSQLITE_DEFAULT_AUTOVACUUM=1. -D 2014-12-29T12:02:31.823 +C Fix\sthe\s--dryrun\soption\sin\sreleasetest.tcl. +D 2014-12-29T19:54:10.833 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 14552a8741165a0489cd9ec3e9a651ba1f1b3567 +F test/releasetest.tcl 3ffd8d99da7a087917f057147053ed35ce1bf90b F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 95ce20348d9b868a0407adccdb222a0e4c762945 -R 0db2cbd8617dad79686d47ebce6896f7 -U dan -Z 03a26819b4fc4a14b459978f03e3e164 +P ef0626ab20f753f01090ca8e8a94e8b516eea55e +R fa81eb180b12cb206ba390f700c75ee2 +U drh +Z 819655494d4a64bf8e32c2a6559858d5 diff --git a/manifest.uuid b/manifest.uuid index 57a4b2b13b..8a65bd3f3d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ef0626ab20f753f01090ca8e8a94e8b516eea55e \ No newline at end of file +0f9e549643ab94b0465e6891384dd20506708a8f \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 6a91ac585b..bcd7d3d060 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -208,6 +208,7 @@ foreach {key value} [array get ::Platforms] { # one-line error message to show on the output. # proc count_tests_and_errors {logfile rcVar errmsgVar} { + if {$::DRYRUN} return upvar 1 $rcVar rc $errmsgVar errmsg set fd [open $logfile rb] set seen 0 From 37c057b8ff93ad750623b0a4f032722849954551 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 00:57:29 +0000 Subject: [PATCH 20/29] Round all object sizes that go into computing SQLITE_CONFIG_PCACHE_HDRSZ up to a multiple of 8 bytes. FossilOrigin-Name: b28ce75f2d3a6343dc20d581dc55afae89ab5efa --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/btree.c | 2 +- src/pcache.c | 2 +- src/pcache1.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 101d767d16..750bbbaad6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\s--dryrun\soption\sin\sreleasetest.tcl. -D 2014-12-29T19:54:10.833 +C Round\sall\sobject\ssizes\sthat\sgo\sinto\scomputing\sSQLITE_CONFIG_PCACHE_HDRSZ\sup\nto\sa\smultiple\sof\s8\sbytes. +D 2014-12-30T00:57:29.979 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,7 +173,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c 7ddee9c7d505e07e959a575b18498f17c71e53ea F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb F src/btmutex.c 49ca66250c7dfa844a4d4cb8272b87420d27d3a5 -F src/btree.c 904d30478685fe0723ad9092fc800a655544c69a +F src/btree.c 4c098bb6e8678e4596983862abf78f7a0fcb807e F src/btree.h 94277c1d30c0b75705974bcc8b0c05e79c03d474 F src/btreeInt.h a3d0ae1d511365e1a2b76ad10960dbe55c286f34 F src/build.c f5cfd7b32216f695b995bbc7c1a395f6d451d11f @@ -219,9 +219,9 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 -F src/pcache.c ace1b67632deeaa84859b4c16c27711dfb7db3d4 +F src/pcache.c 8ee2ce15c4f49b44e27e8ffb8ce683c5e506e736 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 -F src/pcache1.c facbdd3ecc09c8f750089d941305694301328e98 +F src/pcache1.c ff599891da0e4993c814eeae3e7e2801f47364f3 F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ef0626ab20f753f01090ca8e8a94e8b516eea55e -R fa81eb180b12cb206ba390f700c75ee2 +P 0f9e549643ab94b0465e6891384dd20506708a8f +R e296d2763d3effbc9c21b29aae15693b U drh -Z 819655494d4a64bf8e32c2a6559858d5 +Z 2369afc171a95fab3bda365a2e52134d diff --git a/manifest.uuid b/manifest.uuid index 8a65bd3f3d..51d7bf7cd2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0f9e549643ab94b0465e6891384dd20506708a8f \ No newline at end of file +b28ce75f2d3a6343dc20d581dc55afae89ab5efa \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 0554f3fa3c..f9f76c2ebb 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9146,4 +9146,4 @@ int sqlite3BtreeIsReadonly(Btree *p){ /* ** Return the size of the header added to each page by this module. */ -int sqlite3HeaderSizeBtree(void){ return sizeof(MemPage); } +int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); } diff --git a/src/pcache.c b/src/pcache.c index 13551872d1..3139429699 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -655,7 +655,7 @@ void sqlite3PcacheShrink(PCache *pCache){ ** Return the size of the header added by this middleware layer ** in the page-cache hierarchy. */ -int sqlite3HeaderSizePcache(void){ return sizeof(PgHdr); } +int sqlite3HeaderSizePcache(void){ return ROUND8(sizeof(PgHdr)); } #if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG) diff --git a/src/pcache1.c b/src/pcache1.c index cad41b1b73..990f51591f 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -984,7 +984,7 @@ void sqlite3PCacheSetDefault(void){ /* ** Return the size of the header on each page of this PCACHE implementation. */ -int sqlite3HeaderSizePcache1(void){ return sizeof(PgHdr1); } +int sqlite3HeaderSizePcache1(void){ return ROUND8(sizeof(PgHdr1)); } #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* From 8ab4b9e96459f756749edad0cfb2eb6faef771bc Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 12:03:35 +0000 Subject: [PATCH 21/29] Change notify2.test to check that sqlite3_blocking_step() uses CPU more efficiently than sqlite3_step(), not that it results in greater overall throughput for any specific number of threads. FossilOrigin-Name: d904d29354a5ed85d33bafe4a7143f3c5ecee790 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/notify2.test | 41 +++++++++++++++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index 750bbbaad6..68e968d12e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Round\sall\sobject\ssizes\sthat\sgo\sinto\scomputing\sSQLITE_CONFIG_PCACHE_HDRSZ\sup\nto\sa\smultiple\sof\s8\sbytes. -D 2014-12-30T00:57:29.979 +C Change\snotify2.test\sto\scheck\sthat\ssqlite3_blocking_step()\suses\sCPU\smore\sefficiently\sthan\ssqlite3_step(),\snot\sthat\sit\sresults\sin\sgreater\soverall\sthroughput\sfor\sany\sspecific\snumber\sof\sthreads. +D 2014-12-30T12:03:35.117 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -755,7 +755,7 @@ F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test e9648b9d007c7045242af35e11a984d4b169443a F test/nolock.test 0540dd96f39b8876e3ffdd8814fad0ea425efeee F test/notify1.test 669b2b743618efdc18ca4b02f45423d5d2304abf -F test/notify2.test ce23eb522c9e1fff6443f96376fe67872202061c +F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161 F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934 F test/notnull.test f8fcf58669ddba79274daa2770d61dfad8274f62 F test/null.test a8b09b8ed87852742343b33441a9240022108993 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 0f9e549643ab94b0465e6891384dd20506708a8f -R e296d2763d3effbc9c21b29aae15693b -U drh -Z 2369afc171a95fab3bda365a2e52134d +P b28ce75f2d3a6343dc20d581dc55afae89ab5efa +R 05d3fab766dc5317a84b8e8fc66a7683 +U dan +Z 9e6a15ccef1a8c8d1ccc67c36a60ea41 diff --git a/manifest.uuid b/manifest.uuid index 51d7bf7cd2..f0f3fc30da 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b28ce75f2d3a6343dc20d581dc55afae89ab5efa \ No newline at end of file +d904d29354a5ed85d33bafe4a7143f3c5ecee790 \ No newline at end of file diff --git a/test/notify2.test b/test/notify2.test index 9e40ed695b..12c6a537ef 100644 --- a/test/notify2.test +++ b/test/notify2.test @@ -101,6 +101,8 @@ set sql $zSql # This loop runs for ~20 seconds. # set iStart [clock_seconds] + set nOp 0 + set nAttempt 0 while { ([clock_seconds]-$iStart) < $nSecond } { # Each transaction does 3 operations. Each operation is either a read @@ -128,6 +130,7 @@ set sql $zSql # Execute the SQL transaction. # + incr nAttempt set rc [catch { execsql_blocking $::DB " BEGIN; $SQL(1); @@ -154,13 +157,14 @@ set sql $zSql # returned "1". Otherwise, the invariant was false, indicating that # some malfunction has occurred. foreach r $msg { if {$r != 1} { puts "Invariant check failed: $msg" } } + incr nOp } } # Close the database connection and return 0. # sqlite3_close $::DB - expr 0 + list $nOp $nAttempt } foreach {iTest xStep xPrepare} { @@ -204,7 +208,9 @@ foreach {iTest xStep xPrepare} { for {set ii 0} {$ii < $nThread} {incr ii} { do_test notify2-$iTest.2.$ii { if {![info exists finished($ii)]} { vwait finished($ii) } - set finished($ii) + incr anSuccess($xStep) [lindex $finished($ii) 0] + incr anAttempt($xStep) [lindex $finished($ii) 1] + expr 0 } {0} } @@ -225,17 +231,36 @@ foreach {iTest xStep xPrepare} { } # The following tests checks to make sure sqlite3_blocking_step() is -# faster than sqlite3_step(). blocking_step() is always faster on -# multi-core and is usually faster on single-core. But sometimes, by -# chance, step() will be faster on a single core, in which case the +# faster than sqlite3_step(). "Faster" in this case means uses fewer +# CPU cycles. This is not always the same as faster in wall-clock time +# for this type of test. The number of CPU cycles per transaction is +# roughly proportional to the number of attempts made (i.e. one plus the +# number of SQLITE_BUSY or SQLITE_LOCKED errors that require the transaction +# to be retried). So this test just measures that a greater percentage of +# transactions attempted using blocking_step() succeed. +# +# The blocking_step() function is almost always faster on multi-core and is +# usually faster on single-core. But sometimes, by chance, step() will be +# faster on a single core, in which case the # following test will fail. # puts "The following test seeks to demonstrate that the sqlite3_unlock_notify()" -puts "interface helps multi-core systems to run faster. This test sometimes" -puts "fails on single-core machines." +puts "interface helps multi-core systems to run more efficiently. This test" +puts "sometimes fails on single-core machines." puts [array get anWrite] do_test notify2-3 { - expr {$anWrite(sqlite3_blocking_step) > $anWrite(sqlite3_step)} + set blocking [expr { + double($anSuccess(sqlite3_blocking_step)) / + double($anAttempt(sqlite3_blocking_step)) + }] + set non [expr { + double($anSuccess(sqlite3_step)) / + double($anAttempt(sqlite3_step)) + }] + puts -nonewline [format " blocking: %.1f%% non-blocking %.1f%% ..." \ + [expr $blocking*100.0] [expr $non*100.0]] + + expr {$blocking > $non} } {1} sqlite3_enable_shared_cache $::enable_shared_cache From 51dc84eb7053963a6236e0a10dd3936bf4bd1378 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 13:04:25 +0000 Subject: [PATCH 22/29] Make SQLITE_CONFIG_PCACHE_HDRSZ accurate (not an over-estimate) on 32-bit systems. FossilOrigin-Name: 340b347758e570db3e739b56af0dcf3fc34525be --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pcache.c | 3 ++- src/pcache1.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 68e968d12e..e2c3330813 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\snotify2.test\sto\scheck\sthat\ssqlite3_blocking_step()\suses\sCPU\smore\sefficiently\sthan\ssqlite3_step(),\snot\sthat\sit\sresults\sin\sgreater\soverall\sthroughput\sfor\sany\sspecific\snumber\sof\sthreads. -D 2014-12-30T12:03:35.117 +C Make\sSQLITE_CONFIG_PCACHE_HDRSZ\saccurate\s(not\san\sover-estimate)\son\s32-bit\nsystems. +D 2014-12-30T13:04:25.944 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -219,9 +219,9 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 -F src/pcache.c 8ee2ce15c4f49b44e27e8ffb8ce683c5e506e736 +F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 F src/pcache.h b44658c9c932d203510279439d891a2a83e12ba8 -F src/pcache1.c ff599891da0e4993c814eeae3e7e2801f47364f3 +F src/pcache1.c 1e77432b40b7d3288327d9cdf399dcdfd2b6d3bf F src/pragma.c bd33aa24456f043bb6f6d32a918bbeed41d8c591 F src/prepare.c 173a5a499138451b2561614ecb87d78f9f4644b9 F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P b28ce75f2d3a6343dc20d581dc55afae89ab5efa -R 05d3fab766dc5317a84b8e8fc66a7683 -U dan -Z 9e6a15ccef1a8c8d1ccc67c36a60ea41 +P d904d29354a5ed85d33bafe4a7143f3c5ecee790 +R 10e3253f54695b7f7d1030889f62fe40 +U drh +Z 96098511eaa9438036b4e314651b0800 diff --git a/manifest.uuid b/manifest.uuid index f0f3fc30da..d790a34fba 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d904d29354a5ed85d33bafe4a7143f3c5ecee790 \ No newline at end of file +340b347758e570db3e739b56af0dcf3fc34525be \ No newline at end of file diff --git a/src/pcache.c b/src/pcache.c index 3139429699..0194f63bb9 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -196,7 +196,8 @@ int sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ if( pCache->szPage ){ sqlite3_pcache *pNew; pNew = sqlite3GlobalConfig.pcache2.xCreate( - szPage, pCache->szExtra + sizeof(PgHdr), pCache->bPurgeable + szPage, pCache->szExtra + ROUND8(sizeof(PgHdr)), + pCache->bPurgeable ); if( pNew==0 ) return SQLITE_NOMEM; sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache)); diff --git a/src/pcache1.c b/src/pcache1.c index 990f51591f..f5f7893714 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -296,7 +296,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache){ pPg = 0; } #else - pPg = pcache1Alloc(sizeof(PgHdr1) + pCache->szPage + pCache->szExtra); + pPg = pcache1Alloc(ROUND8(sizeof(PgHdr1)) + pCache->szPage + pCache->szExtra); p = (PgHdr1 *)&((u8 *)pPg)[pCache->szPage]; #endif pcache1EnterMutex(pCache->pGroup); From d348c66e2971fe9de3ec832e54c24348bfcec8ec Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 14:40:53 +0000 Subject: [PATCH 23/29] If the sorter uses mmap'd temp files, ensure all pages of the temp file have been allocated before it is accessed. Otherwise, a disk-full condition might result in a SIGBUS exception. FossilOrigin-Name: 776648412c30dce206f1024ff849c2cb025bb006 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/os_unix.c | 8 ++++---- src/vdbesort.c | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index e2c3330813..553eab2472 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sSQLITE_CONFIG_PCACHE_HDRSZ\saccurate\s(not\san\sover-estimate)\son\s32-bit\nsystems. -D 2014-12-30T13:04:25.944 +C If\sthe\ssorter\suses\smmap'd\stemp\sfiles,\sensure\sall\spages\sof\sthe\stemp\sfile\shave\sbeen\sallocated\sbefore\sit\sis\saccessed.\sOtherwise,\sa\sdisk-full\scondition\smight\sresult\sin\sa\sSIGBUS\sexception. +D 2014-12-30T14:40:53.460 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -213,7 +213,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c fb587121840f690101336879adfa6d0b2cd0e8c7 +F src/os_unix.c 7f9ed5f05e4a9eb7275d1216e46d245d0cebfebb F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb @@ -298,7 +298,7 @@ F src/vdbeapi.c 4bc511a46b9839392ae0e90844a71dc96d9dbd71 F src/vdbeaux.c 07ef87c6d4b5abdf13ff33babb10205702fdab0a F src/vdbeblob.c 4af4bfb71f6df7778397b4a0ebc1879793276778 F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f -F src/vdbesort.c c150803a3e98fbc68bd07772cbbd4328a0a7212d +F src/vdbesort.c 80e40d889ebb536cb7a5ac4c12fa2a4662bc9181 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c c08ec66f45919eaa726bf88aa53eb08379d607f9 F src/wal.c 85353539f2d9d0c91ebd057c32525b1e1aa3335e @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d904d29354a5ed85d33bafe4a7143f3c5ecee790 -R 10e3253f54695b7f7d1030889f62fe40 -U drh -Z 96098511eaa9438036b4e314651b0800 +P 340b347758e570db3e739b56af0dcf3fc34525be +R e81d03c815814a7da9c21e19ec0ae799 +U dan +Z 9955da99fb103f07b93ca8aef676d75e diff --git a/manifest.uuid b/manifest.uuid index d790a34fba..40b0399bb8 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -340b347758e570db3e739b56af0dcf3fc34525be \ No newline at end of file +776648412c30dce206f1024ff849c2cb025bb006 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index a9344ee830..8314e4f678 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3718,16 +3718,16 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ int nBlk = buf.st_blksize; /* File-system block size */ i64 iWrite; /* Next offset to write to */ - if( robust_ftruncate(pFile->h, nSize) ){ - pFile->lastErrno = errno; - return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); - } iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; while( iWriteh, nSize) ){ + pFile->lastErrno = errno; + return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); + } #endif } } diff --git a/src/vdbesort.c b/src/vdbesort.c index 78ecc1efb9..d022af9af6 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -1132,12 +1132,12 @@ void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){ */ static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){ if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ - int rc = sqlite3OsTruncate(pFd, nByte); - if( rc==SQLITE_OK ){ - void *p = 0; - sqlite3OsFetch(pFd, 0, (int)nByte, &p); - sqlite3OsUnfetch(pFd, 0, p); - } + void *p = 0; + int chunksize = 4*1024; + sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_CHUNK_SIZE, &chunksize); + sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte); + sqlite3OsFetch(pFd, 0, (int)nByte, &p); + sqlite3OsUnfetch(pFd, 0, p); } } #else From 55e115f060fae26e3f3ea3fee78cb24012035dfc Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 18:07:34 +0000 Subject: [PATCH 24/29] Fix problems with the "inmemory_journal" permutation. FossilOrigin-Name: 79693f0412ffb0486b974ee6c63b4231cfff5a77 --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/permutations.test | 2 +- test/pragma3.test | 6 ++++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 553eab2472..c8eb6467d4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C If\sthe\ssorter\suses\smmap'd\stemp\sfiles,\sensure\sall\spages\sof\sthe\stemp\sfile\shave\sbeen\sallocated\sbefore\sit\sis\saccessed.\sOtherwise,\sa\sdisk-full\scondition\smight\sresult\sin\sa\sSIGBUS\sexception. -D 2014-12-30T14:40:53.460 +C Fix\sproblems\swith\sthe\s"inmemory_journal"\spermutation. +D 2014-12-30T18:07:34.789 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,10 +782,10 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test 4e12d43f4639ea8a0e366d9c64e0009afe2eb544 +F test/permutations.test d408cd2d48e7a61c9c51ae528d94c3c48ce97477 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 4f141da233358783ba443eb685e6739ce0eb1d90 +F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 340b347758e570db3e739b56af0dcf3fc34525be -R e81d03c815814a7da9c21e19ec0ae799 +P 776648412c30dce206f1024ff849c2cb025bb006 +R d8ec23380207a0894ebd8ce1599deb6c U dan -Z 9955da99fb103f07b93ca8aef676d75e +Z 8cab0a0cf2d75b3466c28901d182f0a0 diff --git a/manifest.uuid b/manifest.uuid index 40b0399bb8..e8c8d8da23 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -776648412c30dce206f1024ff849c2cb025bb006 \ No newline at end of file +79693f0412ffb0486b974ee6c63b4231cfff5a77 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index ff61bf644b..63f8dc589e 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -690,7 +690,7 @@ test_suite "inmemory_journal" -description { zerodamage.test # WAL mode is different. - wal* tkt-2d1a5c67d.test backcompat.test + wal* tkt-2d1a5c67d.test backcompat.test e_wal* }] ifcapable mem3 { diff --git a/test/pragma3.test b/test/pragma3.test index f3d531164b..4654578df2 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -216,7 +216,12 @@ ifcapable shared_cache { # Make sure this also works in WAL mode # +# This will not work with the in-memory journal permutation, as opening +# [db2] switches the journal mode back to "memory" +# ifcapable wal { +if {[permutation]!="inmemory_journal"} { + sqlite3 db test.db db eval {PRAGMA journal_mode=WAL} sqlite3 db2 test.db @@ -242,5 +247,6 @@ ifcapable wal { } {3 111 222} db2 close } +} finish_test From 9486c1b020767a6cc5962470605cc72305717b25 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 19:26:07 +0000 Subject: [PATCH 25/29] Update the threadtest3 test program so that its output summary is compatible with releasetest.tcl. In threadtest3, do not record errors that contain the string "no such table" as being fatal errors, since they happen sometimes in a race condition in stress1. FossilOrigin-Name: 98cb56e2401ae7e113b071df8997ba62265821d3 --- manifest | 16 ++++----- manifest.uuid | 2 +- test/threadtest3.c | 80 ++++++++++++++++++++----------------------- test/tt3_checkpoint.c | 4 +-- 4 files changed, 48 insertions(+), 54 deletions(-) diff --git a/manifest b/manifest index c8eb6467d4..6c2e6952e9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sproblems\swith\sthe\s"inmemory_journal"\spermutation. -D 2014-12-30T18:07:34.789 +C Update\sthe\sthreadtest3\stest\sprogram\sso\sthat\sits\soutput\ssummary\sis\s\ncompatible\swith\sreleasetest.tcl.\s\sIn\sthreadtest3,\sdo\snot\srecord\serrors\nthat\scontain\sthe\sstring\s"no\ssuch\stable"\sas\sbeing\sfatal\serrors,\ssince\sthey\nhappen\ssometimes\sin\sa\srace\scondition\sin\sstress1. +D 2014-12-30T19:26:07.267 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -914,7 +914,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46 F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9 -F test/threadtest3.c f8c6595664a4c5ef5f28d97a612386fe14dd1940 +F test/threadtest3.c 66c2693d888f9ed256d54d70dd60f569d92c12cf F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925 F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660 @@ -1078,7 +1078,7 @@ F test/triggerB.test 56780c031b454abac2340dbb3b71ac5c56c3d7fe F test/triggerC.test a68980c5955d62ee24be6f97129d824f199f9a4c F test/triggerD.test 8e7f3921a92a5797d472732108109e44575fa650 F test/triggerE.test 355e9c5cbaed5cd039a60baad1fb2197caeb8e52 -F test/tt3_checkpoint.c 5e63ee65ed5f87176e25a996480cb02c6caec8b4 +F test/tt3_checkpoint.c 9e75cf7c1c364f52e1c47fd0f14c4340a9db0fe1 F test/tt3_index.c 39eec10a35f57672225be4d182862152896dee4a F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9 F test/tt3_stress.c c57d804716165811d979d4a719e05baccd79277f @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 776648412c30dce206f1024ff849c2cb025bb006 -R d8ec23380207a0894ebd8ce1599deb6c -U dan -Z 8cab0a0cf2d75b3466c28901d182f0a0 +P 79693f0412ffb0486b974ee6c63b4231cfff5a77 +R 5cf8bac225464c2ed58e93713858c6ef +U drh +Z 61949e8b38696d2e4ed6889c396c567f diff --git a/manifest.uuid b/manifest.uuid index e8c8d8da23..cee491506b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -79693f0412ffb0486b974ee6c63b4231cfff5a77 \ No newline at end of file +98cb56e2401ae7e113b071df8997ba62265821d3 \ No newline at end of file diff --git a/test/threadtest3.c b/test/threadtest3.c index ff8add5bf6..d700d7d47a 100644 --- a/test/threadtest3.c +++ b/test/threadtest3.c @@ -1,41 +1,41 @@ - /* +** 2010-07-22 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** ** The code in this file runs a few multi-threaded test cases using the ** SQLite library. It can be compiled to an executable on unix using the ** following command: ** ** gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm ** -** Then run the compiled program. The exit status is non-zero if any tests -** failed (hopefully there is also some output to stdout to clarify what went -** wrong). +** Even though threadtest3.c is the only C source code file mentioned on +** the compiler command-line, #include macros are used to pull in additional +** C code files named "tt3_*.c". ** -** There are three parts to the code in this file, in the following order: +** After compiling, run this program with an optional argument telling +** which test to run. All tests are run if no argument is given. The +** argument can be a glob pattern to match multiple tests. Examples: ** -** 1. Code for the SQL aggregate function md5sum() copied from -** tclsqlite.c in the SQLite distribution. The names of all the -** types and functions in this section begin with "MD5" or "md5". +** ./a.out -- Run all tests +** ./a.out walthread3 -- Run the "walthread3" test +** ./a.out 'wal*' -- Run all of the wal* tests +** ./a.out --help -- List all available tests ** -** 2. A set of utility functions that may be used to implement -** multi-threaded test cases. These are all called by test code -** via macros that help with error reporting. The macros are defined -** immediately below this comment. -** -** 3. The test code itself. And a main() routine to drive the test -** code. +** The exit status is non-zero if any test fails. */ -/************************************************************************* -** Start of test code/infrastructure interface macros. -** -** The following macros constitute the interface between the test -** programs and the test infrastructure. Test infrastructure code -** does not itself use any of these macros. Test code should not -** call any of the macroname_x() functions directly. -** -** See the header comments above the corresponding macroname_x() -** function for a description of each interface. +/* +** The "Set Error Line" macro. */ +#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__)) /* Database functions */ #define opendb(w,x,y,z) (SEL(w), opendb_x(w,x,y,z)) @@ -391,9 +391,9 @@ static void md5finalize(sqlite3_context *context){ sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); } -/************************************************************************* +/* ** End of copied md5sum() code. -*/ +**************************************************************************/ typedef sqlite3_int64 i64; @@ -448,7 +448,8 @@ static void free_err(Error *p){ static void print_err(Error *p){ if( p->rc!=SQLITE_OK ){ printf("Error: (%d) \"%s\" at line %d\n", p->rc, p->zErr, p->iLine); - nGlobalErr++; + if( sqlite3_strglob("* - no such table: *",p->zErr)!=0 ) nGlobalErr++; + fflush(stdout); } } @@ -785,6 +786,7 @@ static void join_all_threads_x( if( pErr->rc==SQLITE_OK ) system_error(pErr, rc); }else{ printf("Thread %d says: %s\n", p->iTid, (ret==0 ? "..." : (char *)ret)); + fflush(stdout); } sqlite3_free(p); } @@ -898,11 +900,6 @@ static int timetostop_x( return ret; } -/* -** The "Set Error Line" macro. -*/ -#define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__)) - /************************************************************************* ************************************************************************** @@ -1427,9 +1424,9 @@ static void dynamic_triggers(int nMs){ int main(int argc, char **argv){ struct ThreadTest { - void (*xTest)(int); - const char *zTest; - int nMs; + void (*xTest)(int); /* Routine for running this test */ + const char *zTest; /* Name of this test */ + int nMs; /* How long to run this test, in milliseconds */ } aTest[] = { { walthread1, "walthread1", 20000 }, { walthread2, "walthread2", 20000 }, @@ -1452,7 +1449,7 @@ int main(int argc, char **argv){ }; int i; - int bTestfound = 0; + int nTestfound = 0; sqlite3_config(SQLITE_CONFIG_MULTITHREAD); sqlite3_config(SQLITE_CONFIG_MULTITHREAD); @@ -1468,12 +1465,13 @@ int main(int argc, char **argv){ } printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000); + fflush(stdout); aTest[i].xTest(aTest[i].nMs); - bTestfound++; + nTestfound++; } - if( bTestfound==0 ) goto usage; + if( nTestfound==0 ) goto usage; - printf("Total of %d errors across all tests\n", nGlobalErr); + printf("%d errors out of %d tests\n", nGlobalErr, nTestfound); return (nGlobalErr>0 ? 255 : 0); usage: @@ -1485,5 +1483,3 @@ int main(int argc, char **argv){ return 254; } - - diff --git a/test/tt3_checkpoint.c b/test/tt3_checkpoint.c index db237d6d9f..060a698211 100644 --- a/test/tt3_checkpoint.c +++ b/test/tt3_checkpoint.c @@ -1,5 +1,5 @@ /* -** 2001 September 15 +** 2011-02-02 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -146,5 +146,3 @@ static void checkpoint_starvation_2(int nMs){ } print_and_free_err(&err); } - - From 592bf7faf5a855a77b04abfeab3c66d5a5f3fa7b Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 30 Dec 2014 19:58:31 +0000 Subject: [PATCH 26/29] Ensure that when a file is extended using FCNTL_SIZE_HINT the last page is allocated on disk, even if the file will only use part of it. FossilOrigin-Name: c7f84717d61197afa9e0ac607c4b349361e6e2b7 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_unix.c | 23 +++++++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index 6c2e6952e9..b8c410c164 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sthreadtest3\stest\sprogram\sso\sthat\sits\soutput\ssummary\sis\s\ncompatible\swith\sreleasetest.tcl.\s\sIn\sthreadtest3,\sdo\snot\srecord\serrors\nthat\scontain\sthe\sstring\s"no\ssuch\stable"\sas\sbeing\sfatal\serrors,\ssince\sthey\nhappen\ssometimes\sin\sa\srace\scondition\sin\sstress1. -D 2014-12-30T19:26:07.267 +C Ensure\sthat\swhen\sa\sfile\sis\sextended\susing\sFCNTL_SIZE_HINT\sthe\slast\spage\sis\sallocated\son\sdisk,\seven\sif\sthe\sfile\swill\sonly\suse\spart\sof\sit. +D 2014-12-30T19:58:31.340 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -213,7 +213,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa -F src/os_unix.c 7f9ed5f05e4a9eb7275d1216e46d245d0cebfebb +F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7 F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 79693f0412ffb0486b974ee6c63b4231cfff5a77 -R 5cf8bac225464c2ed58e93713858c6ef -U drh -Z 61949e8b38696d2e4ed6889c396c567f +P 98cb56e2401ae7e113b071df8997ba62265821d3 +R 42e94e61b93d775e47b58099deb363fd +U dan +Z 6763ecde934c72a96b9e8144b7d09293 diff --git a/manifest.uuid b/manifest.uuid index cee491506b..1e1eaa02a9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -98cb56e2401ae7e113b071df8997ba62265821d3 \ No newline at end of file +c7f84717d61197afa9e0ac607c4b349361e6e2b7 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 8314e4f678..f802d9cd19 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3709,24 +3709,27 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ }while( err==EINTR ); if( err ) return SQLITE_IOERR_WRITE; #else - /* If the OS does not have posix_fallocate(), fake it. First use - ** ftruncate() to set the file size, then write a single byte to - ** the last byte in each block within the extended region. This - ** is the same technique used by glibc to implement posix_fallocate() - ** on systems that do not have a real fallocate() system call. + /* If the OS does not have posix_fallocate(), fake it. Write a + ** single byte to the last byte in each block that falls entirely + ** within the extended region. Then, if required, a single byte + ** at offset (nSize-1), to set the size of the file correctly. + ** This is a similar technique to that used by glibc on systems + ** that do not have a real fallocate() call. */ int nBlk = buf.st_blksize; /* File-system block size */ i64 iWrite; /* Next offset to write to */ iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1; - while( iWrite=buf.st_size ); + assert( (iWrite/nBlk)==((buf.st_size+nBlk-1)/nBlk) ); + assert( ((iWrite+1)%nBlk)==0 ); + for(/*no-op*/; iWriteh, nSize) ){ - pFile->lastErrno = errno; - return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath); + if( nSize%nBlk ){ + int nWrite = seekAndWrite(pFile, nSize-1, "", 1); + if( nWrite!=1 ) return SQLITE_IOERR_WRITE; } #endif } From bd41d566292dec6f65994b7f56a6d4f508222988 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 30 Dec 2014 20:40:32 +0000 Subject: [PATCH 27/29] Add the "mptester" tests to releasetest.tcl. FossilOrigin-Name: 93094a68d3a6178779878cbbe0e5e09ef31a323f --- Makefile.in | 5 +++++ manifest | 18 +++++++++--------- manifest.uuid | 2 +- mptest/mptest.c | 2 +- test/releasetest.tcl | 22 +++++++++++----------- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6867afcf52..cd024e950a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -530,6 +530,11 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c $(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \ $(TLIBS) -rpath "$(libdir)" +mptest: mptester$(EXE) + rm -f mptest1.db + ./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test + rm -f mptest2.db + ./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test # This target creates a directory named "tsrc" and fills it with # copies of all of the C source code and header files needed to diff --git a/manifest b/manifest index b8c410c164..f0f77e4215 100644 --- a/manifest +++ b/manifest @@ -1,7 +1,7 @@ -C Ensure\sthat\swhen\sa\sfile\sis\sextended\susing\sFCNTL_SIZE_HINT\sthe\slast\spage\sis\sallocated\son\sdisk,\seven\sif\sthe\sfile\swill\sonly\suse\spart\sof\sit. -D 2014-12-30T19:58:31.340 +C Add\sthe\s"mptester"\stests\sto\sreleasetest.tcl. +D 2014-12-30T20:40:32.817 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 40326b6d788007dd5e00587c54adcd2621832bb3 +F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.msc b363b90fe1bfc3b87d190f2f728a126c00d9ce09 F Makefile.vxworks 034289efa9d591b04b1a73598623119c306cbba0 @@ -160,7 +160,7 @@ F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test cce8e306d8596d5a2e497e27112dae1f6e5e3538 F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8 -F mptest/mptest.c 499a74af4be293b7c1c7c3d40f332b67227dd739 +F mptest/mptest.c 24c5f72415df2eab7088ef8c9f99f163aed590c8 F mptest/multiwrite01.test 499ad0310da8dff8e8f98d2e272fc2a8aa741b2e F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 3ffd8d99da7a087917f057147053ed35ce1bf90b +F test/releasetest.tcl 8f35e5073901e48a634a649462fa2e7e522e9dc0 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 98cb56e2401ae7e113b071df8997ba62265821d3 -R 42e94e61b93d775e47b58099deb363fd -U dan -Z 6763ecde934c72a96b9e8144b7d09293 +P c7f84717d61197afa9e0ac607c4b349361e6e2b7 +R 0933bc5647d1041ce6d28bf44cb1ff01 +U drh +Z 8ac9cef8267dc35aa4f2371bf41435dc diff --git a/manifest.uuid b/manifest.uuid index 1e1eaa02a9..daccc74158 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c7f84717d61197afa9e0ac607c4b349361e6e2b7 \ No newline at end of file +93094a68d3a6178779878cbbe0e5e09ef31a323f \ No newline at end of file diff --git a/mptest/mptest.c b/mptest/mptest.c index 059ae102fa..7b56b61902 100644 --- a/mptest/mptest.c +++ b/mptest/mptest.c @@ -1395,7 +1395,7 @@ int main(int argc, char **argv){ maybeClose(g.pLog); maybeClose(g.pErrLog); if( iClient==0 ){ - printf("Summary: %d errors in %d tests\n", g.nError, g.nTest); + printf("Summary: %d errors out of %d tests\n", g.nError, g.nTest); } return g.nError>0; } diff --git a/test/releasetest.tcl b/test/releasetest.tcl index bcd7d3d060..e2311d8f9c 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -158,7 +158,7 @@ array set ::Configs { array set ::Platforms { Linux-x86_64 { "Check-Symbols" checksymbols - "Debug-One" test + "Debug-One" "mptest test" "Secure-Delete" test "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" "Update-Delete-Limit" test @@ -178,11 +178,11 @@ array set ::Platforms { "Default" "threadtest fulltest" } Darwin-i386 { - "Locking-Style" test + "Locking-Style" "mptest test" "OS-X" "threadtest fulltest" } "Windows NT-intel" { - "Default" "fulltestonly" + "Default" "mptest fulltestonly" } } @@ -214,7 +214,7 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set seen 0 while {![eof $fd]} { set line [gets $fd] - if {[regexp {^(\d+) errors out of (\d+) tests} $line all nerr ntest]} { + if {[regexp {(\d+) errors out of (\d+) tests} $line all nerr ntest]} { incr ::NERRCASE $nerr incr ::NTESTCASE $ntest set seen 1 @@ -222,7 +222,6 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { set rc 1 set errmsg $line } - break; } } close $fd @@ -457,16 +456,17 @@ proc main {argv} { # add it and run veryquick.test. if {$target!="checksymbols" && !$::BUILDONLY} { set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] + set xtarget $target + regsub -all {fulltest[a-z]+} $xtarget test xtarget if {$debug_idx < 0} { incr NTEST - run_test_suite "${zConfig}_debug" test [ - concat $config_options -DSQLITE_DEBUG=1 - ] + append config_options " -DSQLITE_DEBUG=1" + run_test_suite "${zConfig}_debug" $xtarget $config_options } else { incr NTEST - run_test_suite "${zConfig}_ndebug" test [ - lreplace $config_options $debug_idx $debug_idx - ] + regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $config_options { } config_options + regsub { *-DSQLITE_DEBUG[^ ]* *} $config_options { } config_options + run_test_suite "${zConfig}_ndebug" $xtarget $config_options } } } From e895b873894149268b661c14cd93adcafb5eee4e Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 31 Dec 2014 09:52:15 +0000 Subject: [PATCH 28/29] Do not run pragma3.test as part of the mmap permutation. FossilOrigin-Name: 94101011966243d599519a69c99c202ea31b928d --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/permutations.test | 8 ++++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index f0f77e4215..9942d4b320 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\s"mptester"\stests\sto\sreleasetest.tcl. -D 2014-12-30T20:40:32.817 +C Do\snot\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation. +D 2014-12-31T09:52:15.410 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 -F test/permutations.test d408cd2d48e7a61c9c51ae528d94c3c48ce97477 +F test/permutations.test e1c603ec095e29de3d1f1566d704ea270f9c3f89 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c7f84717d61197afa9e0ac607c4b349361e6e2b7 -R 0933bc5647d1041ce6d28bf44cb1ff01 -U drh -Z 8ac9cef8267dc35aa4f2371bf41435dc +P 93094a68d3a6178779878cbbe0e5e09ef31a323f +R 568e484006de3cb2669a32ac139fa8fe +U dan +Z 9ed2b5eb1c7f4568141d7b75c646d319 diff --git a/manifest.uuid b/manifest.uuid index daccc74158..9a0f1e309b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -93094a68d3a6178779878cbbe0e5e09ef31a323f \ No newline at end of file +94101011966243d599519a69c99c202ea31b928d \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index 63f8dc589e..28572ca0a7 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -141,11 +141,15 @@ test_suite "veryquick" -prefix "" -description { ] test_suite "mmap" -prefix "mm-" -description { - Similar to veryquick. Except with memory mapping disabled. + Similar to veryquick. Except with memory mapping enabled. } -presql { pragma mmap_size = 268435456; } -files [ - test_set $allquicktests -exclude *malloc* *ioerr* *fault* -include malloc.test + # Do not run pragma3.test, as it depends on the values returned by + # "PRAGMA data_version". And if mmap is being used these are often, + # but not always, one greater than if it were not. + test_set $allquicktests -exclude *malloc* *ioerr* *fault* pragma3.test \ + -include malloc.test ] test_suite "valgrind" -prefix "" -description { From 542d55865cb1ec11421783060212b4b13e9f96e4 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 31 Dec 2014 14:18:48 +0000 Subject: [PATCH 29/29] Make sure PRAGMA data_version is updated even if the cache is empty when another connection changes the database. FossilOrigin-Name: cf48eb608af9102a8def2a5b7f5f7b348548116f --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/pager.c | 21 ++++++++++----------- test/pragma3.test | 1 + 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/manifest b/manifest index 9942d4b320..18d0f09e4c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\srun\spragma3.test\sas\spart\sof\sthe\smmap\spermutation. -D 2014-12-31T09:52:15.410 +C Make\ssure\sPRAGMA\sdata_version\sis\supdated\seven\sif\sthe\scache\sis\sempty\swhen\nanother\sconnection\schanges\sthe\sdatabase. +D 2014-12-31T14:18:48.679 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 7cd23e4fc91004a6bd081623e1bc6932e44828c0 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -216,7 +216,7 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c 08c0346d2ea5e5ffd5b1a796f9becf1976d648d7 F src/os_win.c 91d3d08e33ec0258d180d4c8255492f47d15e007 F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 -F src/pager.c 2cbaf886a6157c53a8061ea7e677f81620ff46eb +F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 F src/parse.y 5dfead8aed90cb0c7c1115898ee2266804daff45 F src/pcache.c b83d160ce81ca101f98f0d27498e6d6bd49f1599 @@ -785,7 +785,7 @@ F test/percentile.test b98fc868d71eb5619d42a1702e9ab91718cbed54 F test/permutations.test e1c603ec095e29de3d1f1566d704ea270f9c3f89 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 -F test/pragma3.test 0ca2aea1499a7c2dcee235419e520d825dac958d +F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552 F test/printf2.test b4acd4bf8734243257f01ddefa17c4fb090acc8a F test/progress.test a282973d1d17f08071bc58a77d6b80f2a81c354d @@ -1234,7 +1234,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 93094a68d3a6178779878cbbe0e5e09ef31a323f -R 568e484006de3cb2669a32ac139fa8fe -U dan -Z 9ed2b5eb1c7f4568141d7b75c646d319 +P 94101011966243d599519a69c99c202ea31b928d +R ce88be0f3eb17006a4da57569dcf8731 +U drh +Z eb99526801ba8c2c5e7e84b0513387c7 diff --git a/manifest.uuid b/manifest.uuid index 9a0f1e309b..a48eb47585 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -94101011966243d599519a69c99c202ea31b928d \ No newline at end of file +cf48eb608af9102a8def2a5b7f5f7b348548116f \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 67b95f7186..2230174e5c 100644 --- a/src/pager.c +++ b/src/pager.c @@ -647,6 +647,7 @@ struct Pager { u8 doNotSpill; /* Do not spill the cache when non-zero */ u8 subjInMemory; /* True to use in-memory sub-journals */ u8 bUseFetch; /* True to use xFetch() */ + u8 hasBeenUsed; /* True if any content previously read from this pager*/ Pgno dbSize; /* Number of pages in the database */ Pgno dbOrigSize; /* dbSize before the current transaction */ Pgno dbFileSize; /* Number of pages in the database file */ @@ -3897,7 +3898,7 @@ static int pagerAcquireMapPage( PgHdr **ppPage /* OUT: Acquired page object */ ){ PgHdr *p; /* Memory mapped page to return */ - + if( pPager->pMmapFreelist ){ *ppPage = p = pPager->pMmapFreelist; pPager->pMmapFreelist = p->pDirty; @@ -5128,16 +5129,12 @@ int sqlite3PagerSharedLock(Pager *pPager){ ); } - if( !pPager->tempFile && ( - pPager->pBackup - || sqlite3PcachePagecount(pPager->pPCache)>0 - || USEFETCH(pPager) - )){ - /* The shared-lock has just been acquired on the database file - ** and there are already pages in the cache (from a previous - ** read or write transaction). Check to see if the database - ** has been modified. If the database has changed, flush the - ** cache. + if( !pPager->tempFile && pPager->hasBeenUsed ){ + /* The shared-lock has just been acquired then check to + ** see if the database has been modified. If the database has changed, + ** flush the cache. The pPager->hasBeenUsed flag prevents this from + ** occurring on the very first access to a file, in order to save a + ** single unnecessary sqlite3OsRead() call at the start-up. ** ** Database changes is detected by looking at 15 bytes beginning ** at offset 24 into the file. The first 4 of these 16 bytes are @@ -5302,6 +5299,7 @@ int sqlite3PagerAcquire( if( pgno==0 ){ return SQLITE_CORRUPT_BKPT; } + pPager->hasBeenUsed = 1; /* If the pager is in the error state, return an error immediately. ** Otherwise, request the page from the PCache layer. */ @@ -5451,6 +5449,7 @@ DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){ assert( pgno!=0 ); assert( pPager->pPCache!=0 ); pPage = sqlite3PcacheFetch(pPager->pPCache, pgno, 0); + assert( pPage==0 || pPager->hasBeenUsed ); return sqlite3PcacheFetchFinish(pPager->pPCache, pgno, pPage); } diff --git a/test/pragma3.test b/test/pragma3.test index 4654578df2..b7ea4d3fc6 100644 --- a/test/pragma3.test +++ b/test/pragma3.test @@ -64,6 +64,7 @@ do_execsql_test pragma3-130 { COMMIT; SELECT * FROM t1; PRAGMA data_version; + PRAGMA shrink_memory; } {1 1 1 100 200 300 400 500 1} # EVIDENCE-OF: R-63005-41812 The integer values returned by two