Merge 3.12.0 beta changes from trunk.

FossilOrigin-Name: 3296a0ceedef43c2790f0b36471f91138a575243
This commit is contained in:
drh
2016-03-21 15:32:19 +00:00
47 changed files with 1453 additions and 393 deletions
+16 -14
View File
@@ -172,14 +172,15 @@ do_test capi3-3.3 {
catch {
set db2 [sqlite3_open /bogus/path/test.db {}]
}
sqlite3_extended_errcode $db2
} {SQLITE_CANTOPEN}
set ::capi3_errno [sqlite3_system_errno $db2]
list [sqlite3_extended_errcode $db2] [expr {$::capi3_errno!=0}]
} {SQLITE_CANTOPEN 1}
do_test capi3-3.4 {
sqlite3_errmsg $db2
} {unable to open database file}
do_test capi3-3.5 {
sqlite3_close $db2
} {SQLITE_OK}
list [sqlite3_system_errno $db2] [sqlite3_close $db2]
} [list $::capi3_errno SQLITE_OK]
if {[clang_sanitize_address]==0} {
do_test capi3-3.6.1-misuse {
sqlite3_close $db2
@@ -925,19 +926,20 @@ do_test capi3-11.9.3 {
do_test capi3-11.10 {
sqlite3_step $STMT
} {SQLITE_ROW}
ifcapable !autoreset {
# If SQLITE_OMIT_AUTORESET is defined, then the statement must be
# reset() before it can be passed to step() again.
do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE}
do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT}
}
do_test capi3-11.11 {
sqlite3_step $STMT
} {SQLITE_DONE}
do_test capi3-11.12 {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_ROW}
ifcapable api_armor {
do_test capi3-11.12armor {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_MISUSE}
} else {
do_test capi3-11.12 {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_ROW}
}
do_test capi3-11.13 {
sqlite3_finalize $STMT
} {SQLITE_OK}
+11 -10
View File
@@ -865,19 +865,20 @@ do_test capi3c-11.9.3 {
do_test capi3c-11.10 {
sqlite3_step $STMT
} {SQLITE_ROW}
ifcapable !autoreset {
# If SQLITE_OMIT_AUTORESET is defined, then the statement must be
# reset() before it can be passed to step() again.
do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE}
do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT}
}
do_test capi3c-11.11 {
sqlite3_step $STMT
} {SQLITE_DONE}
do_test capi3c-11.12 {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_ROW}
ifcapable api_armor {
do_test capi3c-11.12armor {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_MISUSE}
} else {
do_test capi3c-11.12 {
sqlite3_step $STMT
sqlite3_step $STMT
} {SQLITE_ROW}
}
do_test capi3c-11.13 {
sqlite3_finalize $STMT
} {SQLITE_OK}
+3 -3
View File
@@ -423,7 +423,7 @@ do_test exclusive-5.1 {
# (2016-03-04) The statement-journal is now opened lazily
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} [expr 2 - ($TEMP_STORE>=2)]
} {2}
do_test exclusive-5.2 {
execsql {
COMMIT;
@@ -450,7 +450,7 @@ do_test exclusive-5.4 {
# 2016-03-04: The statement-journal open is deferred
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} [expr 2 - ($TEMP_STORE>=2)]
} {2}
do_test exclusive-5.5 {
execsql {
COMMIT;
@@ -459,7 +459,7 @@ do_test exclusive-5.5 {
# 2016-03-04: The statement-journal open is deferred
set sqlite_open_file_count
expr $sqlite_open_file_count-$extrafds
} [expr 2 - ($TEMP_STORE>=2)]
} {2}
do_test exclusive-5.6 {
execsql {
PRAGMA locking_mode = normal;
+1 -1
View File
@@ -296,7 +296,7 @@ do_test intpkey-3.8 {
count {
SELECT * FROM t1 WHERE c=='world' AND a>7;
}
} {11 hello world 4}
} {11 hello world 3}
do_test intpkey-3.9 {
count {
SELECT * FROM t1 WHERE 7<a;
+6 -4
View File
@@ -100,10 +100,12 @@ reset_highwater_marks
build_test_db memsubsys1-2 {PRAGMA page_size=1024; PRAGMA mmap_size=0}
#show_memstats
set MEMORY_MANAGEMENT $sqlite_options(memorymanage)
ifcapable !malloc_usable_size {
do_test memsubsys1-2.3 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} [expr ($TEMP_STORE>1 || $MEMORY_MANAGEMENT==0)*1024]
ifcapable pagecache_overflow_stats {
ifcapable !malloc_usable_size {
do_test memsubsys1-2.3 {
set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} [expr ($TEMP_STORE>1 || $MEMORY_MANAGEMENT==0)*1024]
}
}
do_test memsubsys1-2.4 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
+1 -1
View File
@@ -97,7 +97,7 @@ do_test mutex1-1.9 {
# * Multi-threaded mode,
# * Single-threaded mode.
#
ifcapable threadsafe&&shared_cache {
ifcapable threadsafe1&&shared_cache {
set enable_shared_cache [sqlite3_enable_shared_cache 1]
foreach {mode mutexes} {
singlethread {}
+48 -14
View File
@@ -174,24 +174,47 @@ array set ::Configs [strip_comments {
-O2
-DSQLITE_ENABLE_LOCKING_STYLE=1
}
"OS-X" {
"Apple" {
-O1 # Avoid a compiler bug in gcc 4.2.1 build 5658
-DSQLITE_OMIT_LOAD_EXTENSION=1
-DSQLITE_DEFAULT_MEMSTATUS=0
-DSQLITE_THREADSAFE=2
-DSQLITE_OS_UNIX=1
-DSQLITE_ENABLE_JSON1=1
-DSQLITE_ENABLE_LOCKING_STYLE=1
-DUSE_PREAD=1
-DSQLITE_ENABLE_RTREE=1
-DHAVE_GMTIME_R=1
-DHAVE_ISNAN=1
-DHAVE_LOCALTIME_R=1
-DHAVE_PREAD=1
-DHAVE_PWRITE=1
-DHAVE_USLEEP=1
-DHAVE_USLEEP=1
-DHAVE_UTIME=1
-DSQLITE_DEFAULT_CACHE_SIZE=1000
-DSQLITE_DEFAULT_CKPTFULLFSYNC=1
-DSQLITE_DEFAULT_MEMSTATUS=1
-DSQLITE_DEFAULT_PAGE_SIZE=1024
-DSQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS=1
-DSQLITE_ENABLE_API_ARMOR=1
-DSQLITE_ENABLE_AUTO_PROFILE=1
-DSQLITE_ENABLE_FLOCKTIMEOUT=1
-DSQLITE_ENABLE_FTS3=1
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1
-DSQLITE_DEFAULT_CACHE_SIZE=1000
-DSQLITE_ENABLE_FTS3_TOKENIZER=1
if:os=="Darwin" -DSQLITE_ENABLE_LOCKING_STYLE=1
-DSQLITE_ENABLE_PERSIST_WAL=1
-DSQLITE_ENABLE_PURGEABLE_PCACHE=1
-DSQLITE_ENABLE_RTREE=1
-DSQLITE_ENABLE_SNAPSHOT=1
# -DSQLITE_ENABLE_SQLLOG=1
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
-DSQLITE_MAX_LENGTH=2147483645
-DSQLITE_MAX_VARIABLE_NUMBER=500000
-DSQLITE_DEBUG=1
# -DSQLITE_MEMDEBUG=1
-DSQLITE_NO_SYNC=1
-DSQLITE_OMIT_AUTORESET=1
-DSQLITE_OMIT_LOAD_EXTENSION=1
-DSQLITE_PREFER_PROXY_LOCKING=1
-DSQLITE_ENABLE_API_ARMOR=1
-DSQLITE_SERIES_CONSTRAINT_VERIFY=1
-DSQLITE_THREADSAFE=2
-DSQLITE_USE_URI=1
-DSQLITE_WRITE_WALFRAME_PREBUFFERED=1
-DUSE_GUARDED_FD=1
-DUSE_PREAD=1
--enable-json1 --enable-fts5
}
"Extra-Robustness" {
@@ -248,6 +271,7 @@ array set ::Platforms [strip_comments {
"Device-Two" test
"No-lookaside" test
"Devkit" test
"Apple" test
"Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test}
"Device-One" fulltest
"Default" "threadtest fulltest"
@@ -264,12 +288,12 @@ array set ::Platforms [strip_comments {
Darwin-i386 {
"Locking-Style" "mptest test"
"Have-Not" test
"OS-X" "threadtest fulltest"
"Apple" "threadtest fulltest"
}
Darwin-x86_64 {
"Locking-Style" "mptest test"
"Have-Not" test
"OS-X" "threadtest fulltest"
"Apple" "threadtest fulltest"
}
"Windows NT-intel" {
"Have-Not" test
@@ -588,13 +612,23 @@ proc add_test_suite {listvar name testtarget config} {
set opts ""
set title ${name}($testtarget)
set configOpts $::WITHTCL
set skip 0
regsub -all {#[^\n]*\n} $config \n config
foreach arg $config {
if {$skip} {
set skip 0
continue
}
if {[regexp {^-[UD]} $arg]} {
lappend opts $arg
} elseif {[regexp {^[A-Z]+=} $arg]} {
lappend testtarget $arg
} elseif {[regexp {^if:([a-z]+)(.*)} $arg all key tail]} {
# Arguments of the form 'if:os=="Linux"' will cause the subsequent
# argument to be skipped if the $tcl_platform(os) is not "Linux", for
# example...
set skip [expr !(\$::tcl_platform($key)$tail)]
} elseif {[regexp {^--(enable|disable)-} $arg]} {
if {$::MSVC} {
if {$arg eq "--disable-amalgamation"} {
+2 -10
View File
@@ -14,16 +14,8 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
if {$tcl_platform(platform)=="windows"} {
set PROG "sqldiff.exe"
} else {
set PROG "./sqldiff"
}
if {![file exe $PROG]} {
puts "sqldiff cannot run because $PROG is not available"
finish_test
return
}
set PROG [test_find_sqldiff]
db close
forcedelete test.db test2.db
sqlite3 db test.db
+28 -11
View File
@@ -2142,24 +2142,41 @@ proc test_restore_config_pagecache {} {
sqlite3 db test.db
}
proc test_find_binary {nm} {
if {$::tcl_platform(platform)=="windows"} {
set ret "$nm.exe"
} else {
set ret $nm
}
set ret [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $ret]]
if {![file executable $ret]} {
finish_test
return ""
}
return $ret
}
# Find the name of the 'shell' executable (e.g. "sqlite3.exe") to use for
# the tests in shell[1-5].test. If no such executable can be found, invoke
# [finish_test ; return] in the callers context.
#
proc test_find_cli {} {
if {$::tcl_platform(platform)=="windows"} {
set ret "sqlite3.exe"
} else {
set ret "sqlite3"
}
set ret [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $ret]]
if {![file executable $ret]} {
finish_test
return -code return
}
return $ret
set prog [test_find_binary sqlite3]
if {$prog==""} { return -code return }
return $prog
}
# Find the name of the 'sqldiff' executable (e.g. "sqlite3.exe") to use for
# the tests in sqldiff tests. If no such executable can be found, invoke
# [finish_test ; return] in the callers context.
#
proc test_find_sqldiff {} {
set prog [test_find_binary sqldiff]
if {$prog==""} { return -code return }
return $prog
}
# If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
# to non-zero, then set the global variable $AUTOVACUUM to 1.
set AUTOVACUUM $sqlite_options(default_autovacuum)
+3
View File
@@ -1194,6 +1194,9 @@ foreach {tn sql reslist} {
2 { PRAGMA checkpoint_fullfsync = 1 } {10 4 4 2 6 2}
3 { PRAGMA checkpoint_fullfsync = 0 } {10 0 4 0 6 0}
} {
ifcapable default_ckptfullfsync {
if {[string trim $sql]==""} continue
}
faultsim_delete_and_reopen
execsql {PRAGMA auto_vacuum = 0; PRAGMA synchronous = FULL;}
+1
View File
@@ -220,6 +220,7 @@ foreach {tn syncmode synccount} {
sqlite3 db test.db -vfs T
execsql "PRAGMA synchronous = $syncmode"
execsql "PRAGMA checkpoint_fullfsync = 0"
execsql { PRAGMA journal_mode = WAL }
execsql { CREATE TABLE filler(a,b,c); }