1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Merge all recent trunk enhancements into the begin-concurrent branch.

FossilOrigin-Name: 7eac6136ab7fbb96c4bc2ba219191b2273a6fc0eca929bb0f12f666f7b1d12ab
This commit is contained in:
drh
2022-08-22 15:42:15 +00:00
152 changed files with 13072 additions and 4051 deletions

View File

@@ -61,17 +61,18 @@ do_malloc_test attachmalloc-2 -tclprep {
ATTACH 'test2.db' AS db1;
}
set enable_shared_cache [sqlite3_enable_shared_cache 1]
sqlite3 dbaux test3.db
dbaux eval {SELECT * FROM sqlite_master}
do_malloc_test attachmalloc-3 -sqlbody {
SELECT * FROM sqlite_master;
ATTACH 'test3.db' AS three;
} -cleanup {
db eval { DETACH three }
ifcapable shared_cache {
set enable_shared_cache [sqlite3_enable_shared_cache 1]
sqlite3 dbaux test3.db
dbaux eval {SELECT * FROM sqlite_master}
do_malloc_test attachmalloc-3 -sqlbody {
SELECT * FROM sqlite_master;
ATTACH 'test3.db' AS three;
} -cleanup {
db eval { DETACH three }
}
dbaux close
sqlite3_enable_shared_cache $enable_shared_cache
}
dbaux close
sqlite3_enable_shared_cache $enable_shared_cache
finish_test

View File

@@ -10,6 +10,7 @@
#***********************************************************************
# This file test the busy handler
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]

View File

@@ -141,12 +141,6 @@ do_test 2.0 {
| end c-b92b.txt.db
}]} {}
prng_seed 0 db
do_catchsql_test 2.1 {
SELECT count(*) FROM sqlite_schema;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<1000)
INSERT INTO t1(a) SELECT randomblob(null) FROM c;
} {0 4}
reset_db
if {![info exists ::G(perm:presql)]} {

View File

@@ -237,4 +237,43 @@ do_execsql_test 5.4 {
SELECT *, '|' FROM t5_1;
} {1 2 3 4 | one two three four | 5 6 7 8 |}
#-------------------------------------------------------------------------
proc randomtext {n} {
string range [db one {SELECT hex(randomblob($n))}] 1 $n
}
for {set ii 0} {$ii < 200} {incr ii} {
reset_db
load_static_extension db csv
set fd [open csv.data w]
puts $fd "a,b"
puts $fd "[randomtext $ii],abcd"
close $fd
do_execsql_test 6.$ii.1 {
CREATE VIRTUAL TABLE abc USING csv(filename='csv.data', header=true);
}
do_execsql_test 6.$ii.2 {
SELECT count(*) FROM abc
} 1
}
for {set ii 0} {$ii < 20} {incr ii} {
reset_db
load_static_extension db csv
set T [randomtext $ii]
set fd [open csv.data w]
puts $fd "a,b"
puts -nonewline $fd "abcd,$T"
close $fd
do_execsql_test 7.$ii.1 {
CREATE VIRTUAL TABLE abc USING csv(filename='csv.data', header=true);
}
breakpoint
do_execsql_test 7.$ii.2 {
SELECT * FROM abc
} [list abcd $T]
}
finish_test

73
test/dbpagefault.test Normal file
View File

@@ -0,0 +1,73 @@
# 2022 July 06
#
# 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.
#
#***********************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/malloc_common.tcl
if {[permutation] == "inmemory_journal"} {
finish_test
return
}
set testprefix dbpagefault
faultsim_save_and_close
do_faultsim_test 1 -prep {
faultsim_restore_and_reopen
execsql { ATTACH 'test.db2' AS aux; }
} -body {
execsql {
CREATE VIRTUAL TABLE t1 USING sqlite_dbpage();
}
} -test {
execsql { PRAGMA journal_mode = off }
faultsim_test_result {0 {}}
}
do_faultsim_test 2 -prep {
sqlite3 db "xyz.db" -vfs memdb
execsql { ATTACH 'test.db2' AS aux; }
} -body {
execsql {
CREATE VIRTUAL TABLE t1 USING sqlite_dbpage();
INSERT INTO t1 DEFAULT VALUES;
}
} -test {
execsql { PRAGMA journal_mode = off }
faultsim_test_result {1 {no such schema}} {1 {SQL logic error}}
}
reset_db
do_execsql_test 3.0 {
CREATE TABLE x1(z, b);
CREATE TRIGGER BEFORE INSERT ON x1 BEGIN
DELETE FROM sqlite_dbpage WHERE pgno=100;
UPDATE sqlite_dbpage SET data=null WHERE pgno=100;
END;
}
do_faultsim_test 3 -prep {
catch { db close }
sqlite3 db test.db
execsql { PRAGMA trusted_schema = true }
} -body {
execsql { INSERT INTO x1 DEFAULT VALUES; }
} -test {
faultsim_test_result {0 {}}
}
finish_test

View File

@@ -358,6 +358,7 @@ foreach {tn uri error} "
do_test 10.$tn { open_uri_error $uri } $error
}
ifcapable shared_cache {
# EVIDENCE-OF: R-23027-03515 Setting it to "shared" is equivalent to
# setting the SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed
# to sqlite3_open_v2().
@@ -430,6 +431,7 @@ foreach {tn uri flags shared_default isshared} {
db close
}
sqlite3_enable_shared_cache $orig
} ;# End ifcapable shared_chache
# EVIDENCE-OF: R-63472-46769 Specifying an unknown parameter in the
# query component of a URI is not an error.

View File

@@ -13,7 +13,6 @@
# The focus of this file is testing of the proper handling of conversions
# to the native text representation.
#
# $Id: enc3.test,v 1.8 2008/01/22 01:48:09 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -7033,6 +7033,8 @@ set sqlite_fts3_enable_parentheses $saved
#-------------------------------------------------------------------------
#
set saved $sqlite_fts3_enable_parentheses
set sqlite_fts3_enable_parentheses 1
reset_db
do_test 52.0 {
sqlite3 db {}
@@ -7228,5 +7230,438 @@ do_catchsql_test 52.1 {
SELECT * FROM t1, t2;
} {1 {database disk image is malformed}}
#-------------------------------------------------------------------------
#
reset_db
do_test 53.0 {
sqlite3 db {}
db deserialize [decode_hexdb {
.open --hexdb
| size 8192 pagesize 1024 filename crash-7bc.txt.db
| page 1 offset 0
| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
| 16: 04 00 01 01 00 40 20 20 00 00 00 00 00 00 00 08 .....@ ........
| 32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04 ................
| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
| 96: 00 00 00 00 0d 02 f3 00 07 01 51 00 03 c8 03 63 ..........Q....c
| 112: 02 fb 02 0a 02 c0 01 a8 01 51 00 00 00 00 00 00 .........Q......
| 336: 00 55 07 07 17 1b 1b 01 81 01 74 61 62 6c 65 74 .U........tablet
| 352: 31 5f 73 74 61 74 74 31 5f 73 74 61 74 07 43 52 1_statt1_stat.CR
| 368: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 EATE TABLE 't1_s
| 384: 74 61 74 27 28 69 64 20 49 4e 54 45 47 45 52 20 tat'(id INTEGER
| 400: 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 61 6c PRIMARY KEY, val
| 416: 75 65 20 42 4c 4f 42 29 60 06 07 17 21 21 01 81 ue BLOB)`...!!..
| 432: 0b 74 61 62 6c 65 74 31 5f 64 6f 63 73 69 7a 65 .tablet1_docsize
| 448: 74 31 5f 64 6f 63 73 69 7a 65 06 43 52 45 41 54 t1_docsize.CREAT
| 464: 45 20 54 41 42 4c 45 20 27 74 31 5f 64 6f 63 73 E TABLE 't1_docs
| 480: 69 7a 65 27 28 64 6f 63 69 64 20 49 4e 54 45 47 ize'(docid INTEG
| 496: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 ER PRIMARY KEY,
| 512: 73 69 7a 65 20 42 4c 4f 42 29 81 33 04 07 17 1f size BLOB).3....
| 528: 1f 01 82 35 74 61 62 6c 65 74 31 5f 73 65 67 64 ...5tablet1_segd
| 544: 69 72 74 31 5f 73 65 67 64 69 72 04 43 52 45 41 irt1_segdir.CREA
| 560: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67 TE TABLE 't1_seg
| 576: 64 69 72 27 28 6c 65 76 65 6c 20 49 4e 54 45 47 dir'(level INTEG
| 592: 45 52 2c 69 64 78 20 49 4e 54 45 47 45 52 2c 73 ER,idx INTEGER,s
| 608: 74 61 72 74 5f 62 6c 6f 63 6b 20 49 4e 54 45 47 tart_block INTEG
| 624: 45 52 2c 6c 65 61 76 65 73 5f 65 6e 64 5f 62 6c ER,leaves_end_bl
| 640: 6f 63 6b 20 49 4e 54 45 47 45 52 2c 65 6e 64 5f ock INTEGER,end_
| 656: 62 6c 6f 63 6b 20 49 4e 54 45 47 45 52 2c 72 6f block INTEGER,ro
| 672: 6f 74 20 42 4c 4f 42 2c 50 52 49 4d 41 52 59 20 ot BLOB,PRIMARY
| 688: 4b 45 59 28 6c 65 76 65 6c 2c 20 69 64 78 29 29 KEY(level, idx))
| 704: 31 05 06 17 45 1f 01 00 69 6e 64 65 78 73 71 6c 1...E...indexsql
| 720: 69 74 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 ite_autoindex_t1
| 736: 5f 73 65 67 64 69 72 5f 31 74 31 5f 73 65 67 64 _segdir_1t1_segd
| 752: 69 72 05 00 00 00 08 00 00 00 00 66 03 07 17 23 ir.........f...#
| 768: 23 01 81 13 74 61 62 6c 65 74 31 5f 73 65 67 6d #...tablet1_segm
| 784: 65 6e 74 73 74 31 5f 73 65 67 6d 65 6e 74 73 03 entst1_segments.
| 800: 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 CREATE TABLE 't1
| 816: 5f 73 65 67 6d 65 6e 74 73 27 28 62 6c 6f 63 6b _segments'(block
| 832: 69 64 20 49 4e 53 45 47 45 52 20 50 52 49 4d 41 id INSEGER PRIMA
| 848: 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c RY KEY, block BL
| 864: 4f 42 29 63 02 07 17 21 21 01 81 11 74 61 62 6c OB)c...!!...tabl
| 880: 65 74 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f et1_contentt1_co
| 896: 6e 74 65 6e 74 02 43 52 45 41 54 45 20 54 41 42 ntent.CREATE TAB
| 912: 4c 45 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 LE 't1_content'(
| 928: 64 6f 63 69 64 20 49 4e 54 45 47 45 52 20 50 52 docid INTEGER PR
| 944: 49 4d 41 52 59 20 4b 45 59 2c 20 27 63 30 30 27 IMARY KEY, 'c00'
| 960: 2c 20 27 63 31 62 27 29 36 01 06 17 11 11 08 5b , 'c1b')6......[
| 976: 74 61 62 6c 65 74 31 74 31 43 52 45 41 54 45 20 tablet1t1CREATE
| 992: 56 49 52 54 55 41 4c 20 54 41 42 4c 45 20 74 31 VIRTUAL TABLE t1
| 1008: 20 55 53 49 4e 47 20 66 74 73 34 28 30 2c 62 29 USING fts4(0,b)
| page 2 offset 1024
| 0: 0d 00 00 00 03 00 0f 00 00 23 00 16 00 0f 00 05 .........#......
| 16: 03 04 00 08 0f 61 0b 02 04 00 08 1b 41 54 45 20 .....a......ATE
| 32: 32 3a 50 87 5a 01 05 00 08 8f 37 66 30 30 30 30 2:P.Z.....7f0000
| 48: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 64: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 80: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 96: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 112: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 128: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 144: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 160: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 176: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 192: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 208: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 224: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 240: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 256: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 272: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 288: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 304: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 320: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 336: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 352: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 368: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 384: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 400: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 416: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 432: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 448: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 464: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 480: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 496: 30 40 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0@00000000000000
| 512: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 528: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 544: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 560: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 576: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 592: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 608: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 624: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 640: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 656: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 672: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 688: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 880: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 896: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 912: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 928: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 992: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 1008: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| page 3 offset 2048
| 0: 0d 00 00 00 02 03 86 00 03 f4 03 86 00 00 00 00 ................
| 896: 00 00 00 00 00 00 87 62 02 04 00 8f 48 00 d5 07 .......b....H...
| 912: 66 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 f000000000000000
| 928: 30 30 30 30 3a 30 30 30 30 30 30 30 30 30 30 30 0000:00000000000
| 944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 992: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 1008: 00 00 00 08 0a 01 03 00 1a 00 01 30 03 01 02 00 ...........0....
| page 4 offset 3072
| 0: 0d 00 00 00 03 03 9e 00 03 ed 03 bc 03 9e 00 00 ................
| 912: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1c 03 ................
| 928: 07 08 01 08 08 15 2c 02 30 20 31 36 00 01 30 03 ......,.0 16..0.
| 944: 03 02 00 00 01 61 05 03 01 01 02 00 2f 02 07 08 .....a....../...
| 960: 09 08 08 15 54 30 20 33 36 00 01 30 03 02 02 00 ....T0 36..0....
| 976: 00 01 32 05 02 01 01 03 00 00 03 61 74 65 05 02 ..2........ate..
| 992: 01 01 02 00 00 01 70 05 02 01 01 04 00 11 01 07 ......p.........
| 1008: 08 08 09 01 17 14 02 32 20 39 39 37 01 01 01 66 .......2 997...f
| page 5 offset 4096
| 0: 0a 00 00 00 03 03 ee 00 03 fb 03 f5 03 ee 00 00 ................
| 992: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 04 ................
| 1008: 08 01 01 02 03 05 04 08 09 01 02 04 04 08 08 09 ................
| page 6 offset 5120
| 0: 0d 00 00 00 03 03 eb 00 00 00 00 00 00 00 00 00 ................
| 992: 00 00 00 00 00 00 00 00 00 00 00 05 03 03 00 10 ................
| 1008: 01 01 05 02 03 00 10 01 03 05 01 03 00 10 01 01 ................
| page 7 offset 6144
| 0: 0d 00 00 00 01 03 f6 00 03 f6 00 00 00 00 00 00 ................
| 1008: 00 00 00 00 00 00 08 00 03 00 16 03 08 c5 e0 07 ................
| page 8 offset 7168
| 0: 00 00 00 00 30 30 30 30 30 30 30 30 30 30 30 30 ....000000000000
| 16: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 32: 30 30 30 30 30 30 30 30 30 30 30 30 30 bc 30 30 0000000000000.00
| 48: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 64: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 80: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 96: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 112: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 128: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 144: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 160: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 176: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 192: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 c0 30 00000000000000.0
| 208: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 224: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 240: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 256: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 272: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 288: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 304: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 320: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 336: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 352: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 368: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 384: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 400: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 416: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 432: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 448: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 464: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 480: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 496: 30 30 30 30 30 30 30 30 30 30 30 40 30 30 30 30 00000000000@0000
| 512: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 528: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 544: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 560: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 576: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 592: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 608: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 624: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 640: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 656: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 672: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 688: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 880: 30 30 30 30 30 30 30 30 30 05 01 00 00 00 00 00 000000000.......
| end crash-7bc.txt.db
}]} {}
do_execsql_test 53.1 {
SELECT*FROM t1 WHERE t1 MATCH'ATE"0"OR"2D:P"""ATE"0"OR"2:P"""';
} {0 {ATE 2:P}}
set sqlite_fts3_enable_parentheses $saved
#-------------------------------------------------------------------------
#
reset_db
do_test 54.0 {
sqlite3 db {}
db deserialize [decode_hexdb {
.open --hexdb
| size 8192 pagesize 1024 filename crash-365.txt.db
| page 1 offset 0
| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
| 16: 04 00 01 01 00 40 20 20 00 00 00 00 00 00 00 08 .....@ ........
| 32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04 ................
| 96: 00 00 00 00 0d 02 f3 00 07 01 51 00 03 c8 03 63 ..........Q....c
| 112: 02 fb 02 0a 02 c0 01 a8 01 51 00 00 00 00 00 00 .........Q......
| 336: 00 55 07 07 17 1b 1b 01 81 01 74 61 62 6c 65 74 .U........tablet
| 352: 31 5f 73 74 61 74 74 31 5f 73 74 61 74 07 43 52 1_statt1_stat.CR
| 368: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 EATE TABLE 't1_s
| 384: 74 61 74 27 28 69 64 20 49 4e 54 45 47 45 52 20 tat'(id INTEGER
| 400: 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 61 6c PRIMARY KEY, val
| 416: 75 65 20 42 4c 4f 42 29 60 06 07 17 21 21 01 81 ue BLOB)`...!!..
| 432: 0b 74 61 62 6c 65 74 31 5f 64 6f 63 73 69 7a 65 .tablet1_docsize
| 448: 74 31 5f 64 6f 63 73 69 7a 65 06 43 52 45 41 54 t1_docsize.CREAT
| 464: 45 20 54 41 42 4c 45 20 27 74 31 5f 64 6f 63 73 E TABLE 't1_docs
| 480: 69 7a 65 27 28 64 6f 63 69 64 20 49 4e 54 45 47 ize'(docid INTEG
| 496: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 ER PRIMARY KEY,
| 512: 73 69 7a 65 20 42 4c 4f 42 29 81 33 04 07 17 1f size BLOB).3....
| 528: 1f 01 82 35 74 61 62 6c 65 74 31 5f 73 65 67 64 ...5tablet1_segd
| 544: 69 72 74 31 5f 73 65 67 64 69 72 04 43 52 45 41 irt1_segdir.CREA
| 560: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67 TE TABLE 't1_seg
| 576: 64 69 72 27 28 6c 65 76 65 6c 20 49 4e 54 45 47 dir'(level INTEG
| 592: 45 52 2c 69 64 78 20 49 4e 54 45 47 45 52 2c 73 ER,idx INTEGER,s
| 608: 74 61 72 74 5f 62 6c 6f 63 6b 20 49 4e 54 45 47 tart_block INTEG
| 624: 45 52 2c 6c 65 61 76 65 73 5f 65 6e 64 5f 62 6c ER,leaves_end_bl
| 640: 6f 63 6b 20 49 4e 54 45 47 45 52 2c 65 6e 64 5f ock INTEGER,end_
| 656: 62 6c 6f 63 6b 20 49 4e 54 45 47 45 52 2c 72 6f block INTEGER,ro
| 672: 6f 74 20 42 4c 4f 42 2c 50 52 49 4d 41 52 59 20 ot BLOB,PRIMARY
| 688: 4b 45 59 28 6c 65 76 65 6c 2c 20 69 64 78 29 29 KEY(level, idx))
| 704: 31 05 06 17 45 1f 01 00 69 6e 64 65 78 73 71 6c 1...E...indexsql
| 720: 69 74 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 ite_autoindex_t1
| 736: 5f 73 65 67 64 69 72 5f 31 74 31 5f 73 65 67 64 _segdir_1t1_segd
| 752: 69 72 05 00 00 00 08 00 00 00 00 66 03 07 17 23 ir.........f...#
| 768: 23 01 81 13 74 61 62 6c 65 74 31 5f 73 65 67 6d #...tablet1_segm
| 784: 65 6e 74 73 74 31 5f 73 65 67 6d 65 6e 74 73 03 entst1_segments.
| 800: 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 CREATE TABLE 't1
| 816: 5f 73 65 67 6d 65 6e 74 73 27 28 62 6c 6f 63 6b _segments'(block
| 832: 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 id INTEGER PRIMA
| 848: 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c RY KEY, block BL
| 864: 4f 42 29 63 02 07 17 21 21 01 81 11 74 61 62 6c OB)c...!!...tabl
| 880: 65 74 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f et1_contentt1_co
| 896: 6e 74 65 6e 74 02 43 52 45 41 54 45 20 54 41 42 ntent.CREATE TAB
| 912: 4c 45 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 LE 't1_content'(
| 928: 64 6f 63 69 64 20 49 4e 54 45 47 45 52 20 50 52 docid INTEGER PR
| 944: 49 4d 41 52 59 20 4b 45 59 2c 20 27 63 30 30 27 IMARY KEY, 'c00'
| 960: 2c 20 27 63 31 62 27 29 36 01 06 17 11 11 08 5b , 'c1b')6......[
| 976: 74 61 62 6c 65 74 31 74 31 43 52 45 41 54 45 20 tablet1t1CREATE
| 992: 56 49 52 54 55 41 4c 20 54 41 42 4c 45 20 74 31 VIRTUAL TABLE t1
| 1008: 20 55 53 49 4e 47 20 66 74 73 34 28 30 2c 62 29 USING fts4(0,b)
| page 2 offset 1024
| 0: 0d 00 00 00 03 00 0f 00 00 23 00 16 00 0f 00 05 .........#......
| 16: 03 04 00 08 0f 61 0b 02 04 00 08 1b 41 54 45 20 .....a......ATE
| 32: 32 3a 50 87 5a 01 05 00 08 8f 37 66 30 30 30 30 2:P.Z.....7f0000
| 48: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 64: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 80: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 96: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 112: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 128: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 144: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 160: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 176: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 192: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 208: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 224: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 240: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 256: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 272: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 288: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 304: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 320: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 336: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 352: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 368: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 384: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 400: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 416: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 432: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 448: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 464: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 480: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 496: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 512: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 528: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 544: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 560: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 576: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 592: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 608: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 624: 30 30 30 30 30 30 30 30 30 30 1b 30 30 30 30 30 0000000000.00000
| 640: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 656: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 672: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 688: 30 30 30 30 30 30 30 30 2f 30 30 30 30 30 30 30 00000000/0000000
| 704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 880: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 896: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 912: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 928: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 992: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 1008: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| page 3 offset 2048
| 0: 0d 00 00 00 02 03 86 00 03 f4 03 86 00 00 00 00 ................
| 896: 00 00 00 00 00 00 87 62 02 04 00 8f 48 00 d5 07 .......b....H...
| 912: 66 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 f000000000000000
| 928: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 944: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 960: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 976: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 992: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 1008: 00 00 00 08 0a 01 03 00 1a 00 01 30 03 01 02 00 ...........0....
| page 4 offset 3072
| 0: 0d 00 00 00 03 03 9e 00 03 ed 03 bc 03 9e 00 01 ................
| 912: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1c 03 ................
| 928: 07 08 01 08 08 15 2c 02 30 20 31 36 00 01 30 03 ......,.0 16..0.
| 944: 03 02 00 00 01 61 05 03 01 01 02 00 2f 02 07 08 .....a....../...
| 960: 09 08 08 15 54 30 20 33 36 00 01 30 03 02 02 00 ....T0 36..0....
| 976: 00 01 32 05 02 01 01 03 00 00 03 61 74 65 05 02 ..2........ate..
| 992: 01 01 02 00 00 01 70 05 02 01 01 04 00 11 01 07 ......p.........
| 1008: 08 08 09 01 17 14 02 32 20 39 39 37 01 01 01 66 .......2 997...f
| page 5 offset 4096
| 0: 0a 00 00 00 03 03 ee 00 03 fb 03 f5 03 ee 00 00 ................
| 992: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 04 ................
| 1008: 08 01 01 02 03 05 04 08 09 01 02 04 04 08 08 09 ................
| page 6 offset 5120
| 0: 0d 00 00 00 03 03 eb 00 03 f9 03 f2 00 00 00 00 ................
| 992: 00 00 00 00 00 00 00 00 00 00 00 05 03 03 00 10 ................
| 1008: 01 01 05 02 03 00 10 01 03 05 01 03 00 10 01 01 ................
| page 7 offset 6144
| 0: 0d 00 00 00 01 03 f6 00 03 f6 00 00 00 00 00 00 ................
| 1008: 00 00 00 00 00 00 08 00 03 00 16 03 03 05 e0 07 ................
| page 8 offset 7168
| 0: 00 00 00 00 30 30 30 30 30 30 30 30 30 30 30 30 ....000000000000
| 16: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 32: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 48: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 64: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 80: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 96: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 112: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 128: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 144: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 160: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 176: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 192: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 208: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 224: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 240: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 256: 30 30 30 30 30 2f 30 30 30 30 30 30 30 30 30 30 00000/0000000000
| 272: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 288: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 304: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 320: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 336: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 352: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 368: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 384: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 400: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 416: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 432: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 448: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 464: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 480: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 496: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 512: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 528: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 544: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 560: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 576: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 592: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 608: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 624: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 640: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 656: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 672: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 688: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 704: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 720: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 736: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 752: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 768: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 784: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 800: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 816: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 832: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 848: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 864: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
| 880: 30 30 30 30 30 30 30 30 30 05 01 01 01 02 00 00 000000000.......
| end crash-365.txt.db
}]} {}
do_execsql_test 54.1 {
SELECT rowid, quote(matchinfo(t1,'pcxybspcxybs')) FROM t1 WHERE t1 MATCH'ATE"0"OR"2:P"""';
}
finish_test

View File

@@ -18,6 +18,10 @@ set ::testprefix fts3fault
# If SQLITE_ENABLE_FTS3 is not defined, omit this file.
ifcapable !fts3 { finish_test ; return }
set ::TMPDBERROR [list 1 \
{unable to open a temporary database file for storing temporary tables}
]
# Test error handling in the sqlite3Fts3Init() function. This is the
# function that registers the FTS3 module and various support functions
# with SQLite.
@@ -49,7 +53,7 @@ do_faultsim_test 2 -prep {
} -body {
execsql { ALTER TABLE t1 RENAME TO t2 }
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
# Test error handling in the special case where a single prefix query
@@ -194,7 +198,7 @@ do_faultsim_test 8.2 -faults oom-t* -prep {
} -body {
execsql { SELECT mit(matchinfo(t8, 's')) FROM t8 WHERE t8 MATCH 'a b c' }
} -test {
faultsim_test_result {0 3}
faultsim_test_result {0 3} $::TMPDBERROR
}
do_faultsim_test 8.3 -prep {
faultsim_restore_and_reopen

View File

@@ -215,12 +215,15 @@ do_faultsim_test 8.1 -faults oom* -prep {
faultsim_test_result {0 {}}
}
set ::TMPDBERROR [list 1 \
{unable to open a temporary database file for storing temporary tables}
]
do_faultsim_test 8.2 -faults oom* -prep {
faultsim_restore_and_reopen
} -body {
execsql { ALTER TABLE t8 RENAME TO t8ii }
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
#-------------------------------------------------------------------------

View File

@@ -16,7 +16,7 @@ source $testdir/tester.tcl
source $testdir/fts3_common.tcl
set ::testprefix fts4merge4
ifcapable !fts3 {
ifcapable !fts3||!shared_cache {
finish_test
return
}

View File

@@ -762,7 +762,37 @@ do_execsql_test join-14.4 {
CREATE TABLE t1(c PRIMARY KEY, a TEXT(10000), b TEXT(10000));
SELECT * FROM (SELECT 111) LEFT JOIN (SELECT c+222 FROM t1) GROUP BY 1;
} {111 {}}
do_execsql_test join-14.4b {
SELECT * FROM (SELECT 111) LEFT JOIN (SELECT c+222 FROM t1);
} {111 {}}
do_execsql_test join-14.5 {
SELECT * FROM (SELECT 111 AS x UNION ALL SELECT 222)
LEFT JOIN (SELECT c+333 AS y FROM t1) ON x=y GROUP BY 1;
} {111 {} 222 {}}
do_execsql_test join-14.5b {
SELECT count(*)
FROM (SELECT 111 AS x UNION ALL SELECT 222)
LEFT JOIN (SELECT c+333 AS y FROM t1) ON x=y;
} {2}
do_execsql_test join-14.5c {
SELECT count(*)
FROM (SELECT c+333 AS y FROM t1)
RIGHT JOIN (SELECT 111 AS x UNION ALL SELECT 222) ON x=y;
} {2}
do_execsql_test join-14.6 {
SELECT * FROM (SELECT 111 AS x UNION ALL SELECT 111)
LEFT JOIN (SELECT c+333 AS y FROM t1) ON x=y GROUP BY 1;
} {111 {}}
do_execsql_test join-14.7 {
SELECT * FROM (SELECT 111 AS x UNION ALL SELECT 111 UNION ALL SELECT 222)
LEFT JOIN (SELECT c+333 AS y FROM t1) ON x=y GROUP BY 1;
} {111 {} 222 {}}
do_execsql_test join-14.8 {
INSERT INTO t1(c) VALUES(-111);
SELECT * FROM (SELECT 111 AS x UNION ALL SELECT 111 UNION ALL SELECT 222)
LEFT JOIN (SELECT c+333 AS y FROM t1) ON x=y GROUP BY 1;
} {111 {} 222 222}
do_execsql_test join-14.9 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c PRIMARY KEY) WITHOUT ROWID;
SELECT * FROM (SELECT 111) LEFT JOIN (SELECT c+222 FROM t1) GROUP BY 1;

View File

@@ -786,4 +786,19 @@ do_execsql_test join8-25020 {
SELECT 1 FROM t1 LEFT JOIN t2 ON true JOIN t3 ON (b2 IN (a1)) FULL JOIN t4 ON true;
} {1}
# 2022-07-13
# forum/forumpost/174afeae57
#
reset_db
db null -
do_execsql_test join8-26000 {
CREATE TABLE t1(a INT);
CREATE TABLE t2(b INT, c INT);
CREATE VIEW t3(d) AS SELECT NULL FROM t2 FULL OUTER JOIN t1 ON c=a UNION ALL SELECT b FROM t2;
INSERT INTO t1(a) VALUES (NULL);
INSERT INTO t2(b, c) VALUES (99, NULL);
SELECT DISTINCT b, c, d FROM t2, t3 WHERE b<>0
UNION SELECT DISTINCT b, c, d FROM t2, t3 WHERE b ISNULL;
} {99 - - 99 - 99}
finish_test

View File

@@ -10,6 +10,8 @@
#
#***********************************************************************
#
# TESTRUNNER: slow
#
# This file implements tests for JOINs that use Bloom filters.
#
# The test case output is (mostly) all generated by PostgreSQL 14. This

View File

@@ -664,6 +664,7 @@ proc do_write_test {name tbl sql} {
if {$::DO_MALLOC_TEST } {
set answers [list {1 {out of memory}} {0 {}}]
lappend answers [list 1 {unable to open a temporary database file for storing temporary tables}]
if {$::DO_MALLOC_TEST==1} {
set modes {100000 persistent}
} else {

View File

@@ -47,7 +47,7 @@ proc populate_text_widget {db} {
set line [$db one {SELECT line FROM frame WHERE frame = $frame}]
if {$line ne ""} {
foreach {file line} [split $line :] {}
regexp {^([^:]*):([0-9]*)} $line -> file line
set content [$db one "SELECT content FROM file WHERE name = '$file'"]
$::O(text) delete 0.0 end

View File

@@ -10,6 +10,7 @@
#***********************************************************************
# Tests focused on the in-memory journal.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -141,3 +141,5 @@ do_eqp_test 111 {
`--RIGHT
`--SCAN generate_series VIRTUAL TABLE INDEX 23:
}
finish_test

View File

@@ -156,6 +156,47 @@ do_execsql_test offset1-1.4.9 {
LIMIT 9 OFFSET 1;
} {2 b 3 c 4 d 5 e 6 w 7 x 8 y 9 z}
# 2022-08-04
# https://sqlite.org/forum/forumpost/6b5e9188f0657616
#
do_execsql_test offset1-2.0 {
CREATE TABLE employees (
id integer primary key,
name text,
city text,
department text,
salary integer
);
INSERT INTO employees VALUES
(11,'Diane','London','hr',70),
(12,'Bob','London','hr',78),
(21,'Emma','London','it',84),
(22,'Grace','Berlin','it',90),
(23,'Henry','London','it',104),
(24,'Irene','Berlin','it',104),
(25,'Frank','Berlin','it',120),
(31,'Cindy','Berlin','sales',96),
(32,'Dave','London','sales',96),
(33,'Alice','Berlin','sales',100);
CREATE VIEW v AS
SELECT * FROM (
SELECT * FROM employees
WHERE salary < 100
ORDER BY salary desc)
UNION ALL
SELECT * FROM (
SELECT * FROM employees
WHERE salary >= 100
ORDER BY salary asc);
} {}
do_execsql_test offset1-2.1 {
SELECT * FROM v LIMIT 5 OFFSET 2;
} {
22 Grace Berlin it 90
21 Emma London it 84
12 Bob London hr 78
11 Diane London hr 70
33 Alice Berlin sales 100
}
finish_test

View File

@@ -132,6 +132,10 @@ set allquicktests [test_set $alltests -exclude {
rtree4.test
sessionbig.test
writecrash.test view3.test
fts5dlidx.test fts5ac.test fts4merge3.test fts5prefix.test
sessionB.test
}]
if {[info exists ::env(QUICKTEST_INCLUDE)]} {
set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)]

View File

@@ -239,4 +239,70 @@ do_execsql_test regexp1-2.22 {
SELECT 'abc$¢€xyz' REGEXP '^abc[^\u0025-X][^ -\u007f][^\u20ab]xyz$'
} {1}
# 2022-07-03
# https://sqlite.org/forum/forumpost/96692f8ba5
# The REGEXP extension mishandles the prefix search optimization when
# the prefix contains 3-byte UTF8 characters.
#
reset_db
load_static_extension db regexp
do_execsql_test regexp1-3.1 {
CREATE TABLE t1(id INTEGER PRIMARY KEY, a TEXT);
INSERT INTO t1(id, a) VALUES(1, '日本語');
SELECT a, hex(a), length(a) FROM t1;
} {日本語 E697A5E69CACE8AA9E 3}
do_execsql_test regexp1-3.2 {
SELECT * FROM t1 WHERE a='日本語';
} {1 日本語}
do_execsql_test regexp1-3.3 {
SELECT * FROM t1 WHERE a LIKE '日本語';
} {1 日本語}
do_execsql_test regexp1-3.4 {
SELECT * FROM t1 wHERE a REGEXP '日本語';
} {1 日本語}
# 2022-07-03
# https://sqlite.org/forum/forumpost/96692f8ba5 Issue #2
# The '$' token in REGEXP contained within other elements.
#
do_execsql_test regexp1-4.1 {SELECT 'xab' REGEXP 'a(b$|cd)';} {1}
do_execsql_test regexp1-4.1b {SELECT 'xab' REGEXP '(b$|cd)';} {1}
do_execsql_test regexp1-4.2 {SELECT 'xaby' REGEXP 'a(b$|cd)';} {0}
do_execsql_test regexp1-4.3 {SELECT 'xacd' REGEXP 'a(b$|cd)';} {1}
do_execsql_test regexp1-4.4 {SELECT 'xacdy' REGEXP 'a(b$|cd)';} {1}
do_execsql_test regexp1-4.5 {SELECT 'xab' REGEXP 'a(cd|b$)';} {1}
do_execsql_test regexp1-4.6 {SELECT 'xaby' REGEXP 'a(cd|b$)';} {0}
do_execsql_test regexp1-4.7 {SELECT 'xacd' REGEXP 'a(cd|b$)';} {1}
do_execsql_test regexp1-4.8 {SELECT 'xacdy' REGEXP 'a(cd|b$)';} {1}
do_execsql_test regexp1-4.9 {SELECT 'xab' REGEXP 'a(cd|b$|e)';} {1}
do_execsql_test regexp1-4.10 {SELECT 'xaby' REGEXP 'a(cd|b$|e)';} {0}
do_execsql_test regexp1-4.11 {SELECT 'xacd' REGEXP 'a(cd|b$|e)';} {1}
do_execsql_test regexp1-4.12 {SELECT 'xacdy' REGEXP 'a(cd|b$|e)';} {1}
# 2022-07-18
# https://sqlite.org/forum/forumpost/57cbaf1d0e
# Incorrect bytecode for {M,N} when M is zero.
#
do_execsql_test regexp1-5.1 {SELECT 'fooX' REGEXP '^[a-z][a-z0-9]{0,30}$';} {0}
do_execsql_test regexp1-5.2 {SELECT 'fooX' REGEXP '^[a-z][a-z0-9]{0,30}X$';} {1}
do_execsql_test regexp1-5.3 {SELECT 'fooX' REGEXP '^[a-z][a-z0-9]{0,2}X$';} {1}
do_execsql_test regexp1-5.4 {SELECT 'foooX' REGEXP '^[a-z][a-z0-9]{0,2}X$';} {0}
do_execsql_test regexp1-5.5 {SELECT 'foooX' REGEXP '^[a-z][a-z0-9]{0,3}X$';} {1}
# 2022-07-18
# https://sqlite.org/forum/forumpost/18f87fdcdf
# Allow "^" to occur inside of "(..)"
#
do_execsql_test regexp1-6.1 {SELECT 'foo' REGEXP '[a-z]';} {1}
do_execsql_test regexp1-6.2 {SELECT 'foo' REGEXP '^[a-z]+$';} {1}
do_execsql_test regexp1-6.3 {SELECT 'foo' REGEXP '^([a-z]+)$';} {1}
do_execsql_test regexp1-6.4 {SELECT 'foo' REGEXP '(^[a-z]+)$';} {1}
do_execsql_test regexp1-6.5 {SELECT 'foo' REGEXP '(^[a-z]+$)';} {1}
do_execsql_test regexp1-6.6 {SELECT 'abc' REGEXP '(^abc|def)';} {1}
do_execsql_test regexp1-6.7 {SELECT 'xabc' REGEXP '(^abc|def)';} {0}
do_execsql_test regexp1-6.8 {SELECT 'def' REGEXP '(^abc|def)';} {1}
do_execsql_test regexp1-6.9 {SELECT 'xdef' REGEXP '(^abc|def)';} {1}
finish_test

View File

@@ -10,6 +10,7 @@
#***********************************************************************
# Test cases for rounding behavior of floating point values.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -751,4 +751,35 @@ do_execsql_test 32.1 {
WHERE a=1234 OR a<=567;
} {500 502}
# 2022-07-15
# https://sqlite.org/forum/forumpost/3607259d3c
#
reset_db
do_execsql_test 33.1 {
CREATE TABLE t1(a INT, b INT PRIMARY KEY) WITHOUT ROWID;
INSERT INTO t1(a, b) VALUES (0, 1),(15,-7),(3,100);
ANALYZE;
} {}
do_execsql_test 33.2 {
SELECT * FROM t1 WHERE (b,a) BETWEEN (0,5) AND (99,-2);
} {0 1}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (b,a) BETWEEN (-8,5) AND (0,-2);
} {15 -7}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (b,a) BETWEEN (3,5) AND (100,4);
} {3 100}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (b,a) BETWEEN (3,5) AND (100,2);
} {}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (a,b) BETWEEN (-2,99) AND (1,0);
} {0 1}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (a,b) BETWEEN (14,99) AND (16,0);
} {15 -7}
do_execsql_test 33.3 {
SELECT * FROM t1 WHERE (a,b) BETWEEN (2,99) AND (4,0);
} {3 100}
finish_test

View File

@@ -118,10 +118,18 @@ do_test select3-2.14 {
} {1 {near ";": syntax error}}
# Cannot have a HAVING without a GROUP BY
#
# Update: As of 3.39.0, you can.
#
do_execsql_test select3-3.1 {
SELECT log, count(*) FROM t1 HAVING log>=4
} {}
do_execsql_test select3-3.2 {
SELECT count(*) FROM t1 HAVING log>=4
} {}
do_execsql_test select3-3.3 {
SELECT count(*) FROM t1 HAVING log!=400
} {31}
# Toss in some HAVING clauses
#
@@ -322,4 +330,108 @@ do_execsql_test select3.10.100 {
FROM t1;
} {{} {}}
#-------------------------------------------------------------------------
# dbsqlfuzz crash-8e17857db2c5a9294c975123ac807156a6559f13.txt
# Associated with the flatten-left-join branch circa 2022-06-23.
#
foreach {tn sql} {
1 {
CREATE TABLE t1(a TEXT);
CREATE TABLE t2(x INT);
CREATE INDEX t2x ON t2(x);
INSERT INTO t1 VALUES('abc');
}
2 {
CREATE TABLE t1(a TEXT);
CREATE TABLE t2(x INT);
INSERT INTO t1 VALUES('abc');
}
3 {
CREATE TABLE t1(a TEXT);
CREATE TABLE t2(x INT);
INSERT INTO t1 VALUES('abc');
PRAGMA automatic_index=OFF;
}
} {
reset_db
do_execsql_test select3-11.$tn.1 $sql
do_execsql_test select3.11.$tn.2 {
SELECT max(a), val FROM t1 LEFT JOIN (
SELECT 'constant' AS val FROM t2 WHERE x=1234
)
} {abc {}}
do_execsql_test select3.11.$tn.3 {
INSERT INTO t2 VALUES(123);
SELECT max(a), val FROM t1 LEFT JOIN (
SELECT 'constant' AS val FROM t2 WHERE x=1234
)
} {abc {}}
do_execsql_test select3.11.$tn.4 {
INSERT INTO t2 VALUES(1234);
SELECT max(a), val FROM t1 LEFT JOIN (
SELECT 'constant' AS val FROM t2 WHERE x=1234
)
} {abc constant}
}
reset_db
do_execsql_test 12.0 {
CREATE TABLE t1(a);
CREATE TABLE t2(x);
}
do_execsql_test 12.1 {
SELECT count(x), m FROM t1 LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
}
do_execsql_test 12.2 {
INSERT INTO t1 VALUES(1), (1), (2), (3);
SELECT count(x), m FROM t1 LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
} {
0 {}
0 {}
0 {}
}
do_execsql_test 12.3 {
INSERT INTO t2 VALUES(45);
SELECT count(x), m FROM t1 LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
} {
2 59
1 59
1 59
}
do_execsql_test 12.4 {
INSERT INTO t2 VALUES(210);
SELECT count(x), m FROM t1 LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
} {
4 59
2 59
2 59
}
do_execsql_test 12.5 {
INSERT INTO t2 VALUES(NULL);
SELECT count(x), m FROM t1 LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
} {
4 59
2 59
2 59
}
do_execsql_test 12.6 {
DELETE FROM t2;
DELETE FROM t1;
INSERT INTO t1 VALUES('value');
INSERT INTO t2 VALUES('hello');
} {}
do_execsql_test 12.7 {
SELECT group_concat(x), m FROM t1
LEFT JOIN (SELECT x, 59 AS m FROM t2) GROUP BY a;
} {
hello 59
}
do_execsql_test 12.8 {
SELECT group_concat(x), m, n FROM t1
LEFT JOIN (SELECT x, 59 AS m, 60 AS n FROM t2) GROUP BY a;
} {
hello 59 60
}
finish_test

View File

@@ -19,7 +19,7 @@ source $testdir/tester.tcl
source $testdir/lock_common.tcl
set testprefix shared9
ifcapable !view||!trigger {
ifcapable !view||!trigger||!shared_cache {
finish_test
return
}

View File

@@ -19,6 +19,11 @@ if {[run_thread_tests]==0} { finish_test ; return }
db close
set ::testprefix sharedA
ifcapable !shared_cache {
finish_test
return
}
if {[atomic_batch_write test.db]} {
finish_test
return

View File

@@ -24,6 +24,11 @@ if {[run_thread_tests]==0} { finish_test ; return }
db close
set ::testprefix sharedB
ifcapable !shared_cache {
finish_test
return
}
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
#-------------------------------------------------------------------------

View File

@@ -910,4 +910,17 @@ do_catchsql_test sqllimits1-17.1 "
CREATE TABLE $nm (x PRIMARY KEY)
" {1 {string or blob too big}}
#-------------------------------------------------------------------------
#
sqlite3_limit db SQLITE_LIMIT_COMPOUND_SELECT 10
do_catchsql_test sqllimits1-18.1 {
CREATE TABLE b1(x);
INSERT INTO b1 VALUES(1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
} {0 {}}
do_catchsql_test sqllimits1-18.2 {
INSERT INTO b1 VALUES(1), (2), (3), (4), (5), (6), (7), (8), (9), (10)
UNION VALUES(11);
} {1 {too many terms in compound SELECT}}
finish_test

View File

@@ -8,6 +8,9 @@
# May you share freely, never taking more than you give.
#
#***********************************************************************
#
# TESTRUNNER: slow
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -2171,13 +2171,13 @@ proc memdebug_log_sql {filename} {
}
set escaped "BEGIN; ${tbl}${tbl2}${tbl3}${sql} ; COMMIT;"
set escaped [string map [list "{" "\\{" "}" "\\}"] $escaped]
set escaped [string map [list "{" "\\{" "}" "\\}" "\\" "\\\\"] $escaped]
set fd [open $filename w]
puts $fd "set BUILTIN {"
puts $fd $escaped
puts $fd "}"
puts $fd {set BUILTIN [string map [list "\\{" "{" "\\}" "}"] $BUILTIN]}
puts $fd {set BUILTIN [string map [list "\\{" "{" "\\}" "}" "\\\\" "\\"] $BUILTIN]}
set mtv [open $::testdir/malloctraceviewer.tcl]
set txt [read $mtv]
close $mtv

705
test/testrunner.tcl Normal file
View File

@@ -0,0 +1,705 @@
#-------------------------------------------------------------------------
# Usage:
#
proc usage {} {
set a0 testrunner.tcl
set ::argv [list]
uplevel [list source $::testdir/permutations.test]
puts stderr "Usage: $a0 ?SWITCHES? ?PERMUTATION? ?PATTERNS?"
puts stderr ""
puts stderr "where SWITCHES are:"
puts stderr " --jobs NUMBER-OF-JOBS"
puts stderr ""
puts stderr "available PERMUTATION values are:"
set ii 0
foreach name [lsort [array names ::testspec]] {
if {($ii % 3)==0} { puts -nonewline stderr " " }
puts -nonewline stderr [format "% -22s" $name]
if {($ii % 3)==2} { puts stderr "" }
incr ii
}
puts stderr ""
puts stderr ""
puts stderr "Examples:"
puts stderr " 1) Run the veryquick tests:"
puts stderr " $a0"
puts stderr " 2) Run all test scripts in the source tree:"
puts stderr " $a0 full"
puts stderr " 2) Run the 'memsubsys1' permutation:"
puts stderr " $a0 memsubsys1"
puts stderr " 3) Run all permutations usually run by \[make fulltest\]"
puts stderr " $a0 release"
puts stderr " 4) Run all scripts that match the pattern 'select%':"
puts stderr " $a0 select%"
puts stderr " $a0 all select%"
puts stderr " $a0 full select%"
puts stderr " 5) Run all scripts that are part of the veryquick permutation and match the pattern 'select%':"
puts stderr " $a0 veryquick select%"
puts stderr " 6) Run the 'memsubsys1' permutation, but just those scripts that match 'window%':"
puts stderr " $a0 memsubsys1 window%"
puts stderr " 7) Run all the permutations, but only the scripts that match either 'fts5%' or 'rtree%':"
puts stderr " $a0 release fts5% rtree%"
exit 1
}
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# The database schema used by the testrunner.db database.
#
set R(schema) {
DROP TABLE IF EXISTS script;
DROP TABLE IF EXISTS msg;
DROP TABLE IF EXISTS malloc;
CREATE TABLE script(
config TEXT,
filename TEXT, -- full path to test script
slow BOOLEAN, -- true if script is "slow"
state TEXT CHECK( state IN ('ready', 'running', 'done') ),
testfixtureid, -- Id of process that ran script
time INTEGER, -- Time in ms
nerr INTEGER, -- if 'done', the number of errors
ntest INTEGER, -- if 'done', the number of tests
output TEXT, -- full output of test script
PRIMARY KEY(config, filename)
);
CREATE TABLE malloc(
id INTEGER PRIMARY KEY,
nmalloc INTEGER,
nbyte INTEGER,
leaker TEXT
);
CREATE TABLE msg(
id INTEGER PRIMARY KEY,
msg TEXT
);
}
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
# Try to estimate a the number of processes to use.
#
# Command [guess_number_of_cores] attempts to glean the number of logical
# cores. Command [default_njob] returns the default value for the --jobs
# switch.
#
proc guess_number_of_cores {} {
set ret 4
if {$::tcl_platform(os)=="Darwin"} {
set cmd "sysctl -n hw.logicalcpu"
} else {
set cmd "nproc"
}
catch {
set fd [open "|$cmd" r]
set ret [gets $fd]
close $fd
set ret [expr $ret]
}
return $ret
}
proc default_njob {} {
set nCore [guess_number_of_cores]
set nHelper [expr int($nCore*0.75)]
expr $nHelper>0 ? $nHelper : 1
}
#-------------------------------------------------------------------------
set R(dbname) [file normalize testrunner.db]
set R(logname) [file normalize testrunner.log]
set R(info_script) [file normalize [info script]]
set R(timeout) 10000 ;# Default busy-timeout for testrunner.
set R(nJob) [default_njob] ;# Default number of helper processes
set R(leaker) "" ;# Name of first script to leak memory
set R(patternlist) [list]
set testdir [file dirname $argv0]
# Parse the command line options. There are two ways to invoke this
# script - to create a helper or coordinator process. If there are
# no helper processes, the coordinator runs test scripts.
#
# To create a helper process:
#
# testrunner.tcl helper ID
#
# where ID is an integer greater than 0. The process will create and
# run tests in the "testdir$ID" directory. Helper processes are only
# created by coordinators - there is no need for a user to create
# helper processes manually.
#
# If the first argument is anything other than "helper", then a coordinator
# process is started. See the implementation of the [usage] proc above for
# details.
#
switch -- [lindex $argv 0] {
helper {
set R(helper) 1
set R(helper_id) [lindex $argv 1]
set argv [list --testdir=testdir$R(helper_id)]
}
default {
set R(helper) 0
set R(helper_id) 0
}
}
if {$R(helper)==0} {
for {set ii 0} {$ii < [llength $argv]} {incr ii} {
set a [lindex $argv $ii]
set n [string length $a]
if {[string range $a 0 0]=="-"} {
if {($n>2 && [string match "$a*" --jobs]) || $a=="-j"} {
incr ii
set R(nJob) [lindex $argv $ii]
} else {
usage
}
} else {
lappend R(patternlist) [string map {% *} $a]
}
}
set argv [list]
}
source $testdir/permutations.test
#-------------------------------------------------------------------------
# Return a list of tests to run. Each element of the list is itself a
# list of two elements - the name of a permuations.test configuration
# followed by the full path to a test script. i.e.:
#
# {CONFIG FILENAME} {CONFIG FILENAME} ...
#
proc testset_patternlist {patternlist} {
set first [lindex $patternlist 0]
if {$first=="all"} { set first "full" }
if {$first=="release"} {
# The following mirrors the set of test suites invoked by "all.test".
#
set clist {
full
no_optimization memsubsys1 memsubsys2 singlethread
multithread onefile utf16 exclusive persistent_journal
persistent_journal_error no_journal no_journal_error
autovacuum_ioerr no_mutex_try fullmutex journaltest
inmemory_journal pcache0 pcache10 pcache50 pcache90
pcache100 prepare mmap
}
ifcapable rbu { lappend clist rbu }
if {$::tcl_platform(platform)=="unix"} {
ifcapable !default_autovacuum {
lappend clist autovacuum_crash
}
}
set patternlist [lrange $patternlist 1 end]
} elseif {[info exists ::testspec($first)]} {
set clist $first
set patternlist [lrange $patternlist 1 end]
} elseif { [llength $patternlist]==0 } {
set clist veryquick
} else {
set clist full
}
set testset [list]
foreach config $clist {
catch { array unset O }
array set O $::testspec($config)
foreach f $O(-files) {
if {[file pathtype $f]!="absolute"} {
set f [file join $::testdir $f]
}
lappend testset [list $config [file normalize $f]]
}
}
if {[llength $patternlist]>0} {
foreach t $testset {
set tail [file tail [lindex $t 1]]
foreach p $patternlist {
if {[string match $p $tail]} {
lappend ret $t
break;
}
}
}
} else {
set ret $testset
}
set ret
}
#--------------------------------------------------------------------------
proc r_write_db {tcl} {
global R
sqlite3_test_control_pending_byte 0x010000
sqlite3 db $R(dbname)
db timeout $R(timeout)
db eval { BEGIN EXCLUSIVE }
uplevel $tcl
db eval { COMMIT }
db close
}
proc make_new_testset {} {
global R
set tests [testset_patternlist $R(patternlist)]
r_write_db {
db eval $R(schema)
foreach t $tests {
foreach {c s} $t {}
set slow 0
set fd [open $s]
for {set ii 0} {$ii<100 && ![eof $fd]} {incr ii} {
set line [gets $fd]
if {[string match -nocase *testrunner:* $line]} {
regexp -nocase {.*testrunner:(.*)} $line -> properties
foreach p $properties {
if {$p=="slow"} { set slow 1 }
}
}
}
close $fd
db eval {
INSERT INTO script(config, filename, slow, state)
VALUES ($c, $s, $slow, 'ready')
}
}
}
}
# Find the next job in the database and mark it as 'running'. Then return
# a list consisting of the
#
# CONFIG FILENAME
#
# pair for the test.
#
proc get_next_test {} {
global R
set myid $R(helper_id)
r_write_db {
set f ""
set c ""
db eval {
SELECT config, filename FROM script WHERE state='ready'
ORDER BY
(slow * (($myid+1) % 2)) DESC,
config!='full',
config,
filename
LIMIT 1
} {
set c $config
set f $filename
}
if {$f!=""} {
db eval {
UPDATE script SET state='running', testfixtureid=$myid
WHERE (config, filename) = ($c, $f)
}
}
}
if {$f==""} { return "" }
list $c $f
}
proc r_testname {config filename} {
set name [file tail $filename]
if {$config!="" && $config!="full" && $config!="veryquick"} {
set name "$config-$name"
}
return $name
}
proc r_set_test_result {config filename ms nerr ntest output} {
global R
set f [r_testname $config $filename]
if {$nerr==0} {
set msg "$f... Ok"
} else {
set msg "$f... FAILED - $nerr errors of $ntest tests"
}
append msg " (${ms}ms)"
if {$R(helper)} {
append msg " (helper $R(helper_id))"
}
sqlite3_shutdown
set nMalloc [lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1]
set nByte [sqlite3_memory_used]
if {($nByte>0 || $nMalloc>0) && $R(leaker)==""} {
set R(leaker) $f
}
r_write_db {
db eval {
UPDATE script
SET state='done', output=$output, nerr=$nerr, ntest=$ntest, time=$ms
WHERE (config, filename)=($config, $filename);
INSERT INTO msg(msg) VALUES ($msg);
}
}
}
set R(iNextMsg) 1
proc r_get_messages {{db ""}} {
global R
sqlite3_test_control_pending_byte 0x010000
if {$db==""} {
sqlite3 rgmhandle $R(dbname)
set dbhandle rgmhandle
$dbhandle timeout $R(timeout)
} else {
set dbhandle $db
}
$dbhandle transaction {
set next $R(iNextMsg)
set ret [$dbhandle eval {SELECT msg FROM msg WHERE id>=$next}]
set R(iNextMsg) [$dbhandle one {SELECT COALESCE(max(id), 0)+1 FROM msg}]
}
if {$db==""} {
rgmhandle close
}
set ret
}
# This is called after all tests have been run to write the leaked memory
# report into the malloc table of testrunner.db.
#
proc r_memory_report {} {
global R
sqlite3_shutdown
set nMalloc [lindex [sqlite3_status SQLITE_STATUS_MALLOC_COUNT 0] 1]
set nByte [sqlite3_memory_used]
set id $R(helper_id)
set leaker $R(leaker)
r_write_db {
db eval {
INSERT INTO malloc(id, nMalloc, nByte, leaker)
VALUES($id, $nMalloc, $nByte, $leaker)
}
}
}
#--------------------------------------------------------------------------
#
set ::R_INSTALL_PUTS_WRAPPER {
proc puts_sts_wrapper {args} {
set n [llength $args]
if {$n==1 || ($n==2 && [string first [lindex $args 0] -nonewline]==0)} {
uplevel puts_into_caller $args
} else {
# A channel was explicitly specified.
uplevel puts_sts_original $args
}
}
rename puts puts_sts_original
proc puts {args} { uplevel puts_sts_wrapper $args }
}
proc r_install_puts_wrapper {} $::R_INSTALL_PUTS_WRAPPER
proc r_uninstall_puts_wrapper {} {
rename puts ""
rename puts_sts_original puts
}
proc slave_test_script {script} {
# Create the interpreter used to run the test script.
interp create tinterp
# Populate some global variables that tester.tcl expects to see.
foreach {var value} [list \
::argv0 $::argv0 \
::argv {} \
::SLAVE 1 \
] {
interp eval tinterp [list set $var $value]
}
# The alias used to access the global test counters.
tinterp alias set_test_counter set_test_counter
# Set up an empty ::cmdlinearg array in the slave.
interp eval tinterp [list array set ::cmdlinearg [array get ::cmdlinearg]]
# Set up the ::G array in the slave.
interp eval tinterp [list array set ::G [array get ::G]]
interp eval tinterp [list set ::G(runner.tcl) 1]
interp eval tinterp $::R_INSTALL_PUTS_WRAPPER
tinterp alias puts_into_caller puts_into_caller
# Load the various test interfaces implemented in C.
load_testfixture_extensions tinterp
# Run the test script.
set rc [catch { interp eval tinterp $script } msg opt]
if {$rc} {
puts_into_caller $msg
puts_into_caller [dict get $opt -errorinfo]
incr ::TC(errors)
}
# Check if the interpreter call [run_thread_tests]
if { [interp eval tinterp {info exists ::run_thread_tests_called}] } {
set ::run_thread_tests_called 1
}
# Delete the interpreter used to run the test script.
interp delete tinterp
}
proc slave_test_file {zFile} {
set tail [file tail $zFile]
# Remember the value of the shared-cache setting. So that it is possible
# to check afterwards that it was not modified by the test script.
#
ifcapable shared_cache { set scs [sqlite3_enable_shared_cache] }
# Run the test script in a slave interpreter.
#
unset -nocomplain ::run_thread_tests_called
reset_prng_state
set ::sqlite_open_file_count 0
set time [time { slave_test_script [list source $zFile] }]
set ms [expr [lindex $time 0] / 1000]
r_install_puts_wrapper
# Test that all files opened by the test script were closed. Omit this
# if the test script has "thread" in its name. The open file counter
# is not thread-safe.
#
if {[info exists ::run_thread_tests_called]==0} {
do_test ${tail}-closeallfiles { expr {$::sqlite_open_file_count>0} } {0}
}
set ::sqlite_open_file_count 0
# Test that the global "shared-cache" setting was not altered by
# the test script.
#
ifcapable shared_cache {
set res [expr {[sqlite3_enable_shared_cache] == $scs}]
do_test ${tail}-sharedcachesetting [list set {} $res] 1
}
# Add some info to the output.
#
output2 "Time: $tail $ms ms"
show_memstats
r_uninstall_puts_wrapper
return $ms
}
proc puts_into_caller {args} {
global R
if {[llength $args]==1} {
append R(output) [lindex $args 0]
append R(output) "\n"
} else {
append R(output) [lindex $args 1]
}
}
#-------------------------------------------------------------------------
#
proc r_final_report {} {
global R
sqlite3_test_control_pending_byte 0x010000
sqlite3 db $R(dbname)
db timeout $R(timeout)
set errcode 0
# Create the text log file. This is just the concatenation of the
# 'output' column of the database for every script that was run.
set fd [open $R(logname) w]
db eval {SELECT output FROM script ORDER BY config!='full',config,filename} {
puts $fd $output
}
close $fd
# Check if any scripts reported errors. If so, print one line noting
# how many errors, and another identifying the scripts in which they
# occured. Or, if no errors occurred, print out "no errors at all!".
sqlite3 db $R(dbname)
db timeout $R(timeout)
db eval { SELECT sum(nerr) AS nerr, sum(ntest) AS ntest FROM script } { }
puts "$nerr errors from $ntest tests."
if {$nerr>0} {
db eval { SELECT config, filename FROM script WHERE nerr>0 } {
lappend errlist [r_testname $config $filename]
}
puts "Errors in: $errlist"
set errcode 1
}
# Check if any scripts were not run or did not finish. Print out a
# line identifying them if there are any.
set errlist [list]
db eval { SELECT config, filename FROM script WHERE state!='done' } {
lappend errlist [r_testname $config $filename]
}
if {$errlist!=[list]} {
puts "Tests DID NOT FINISH (crashed?): $errlist"
set errcode 1
}
set bLeak 0
db eval {
SELECT id, nmalloc, nbyte, leaker FROM malloc
WHERE nmalloc>0 OR nbyte>0
} {
if {$id==0} {
set line "This process "
} else {
set line "Helper $id "
}
append line "leaked $nbyte byte in $nmalloc allocations"
if {$leaker!=""} { append line " (perhaps in [file tail $leaker])" }
puts $line
set bLeak 1
}
if {$bLeak==0} {
puts "No leaks - all allocations freed."
}
db close
puts "Test database is $R(dbname)"
puts "Test log file is $R(logname)"
if {$errcode} {
puts "This test has FAILED."
}
return $errcode
}
if {$R(helper)==0} {
make_new_testset
}
set R(nHelperRunning) 0
if {$R(helper)==0 && $R(nJob)>1} {
cd $cmdlinearg(TESTFIXTURE_HOME)
for {set ii 1} {$ii <= $R(nJob)} {incr ii} {
set cmd "[info nameofexec] $R(info_script) helper $ii 2>@1"
puts "Launching helper $ii ($cmd)"
set chan [open "|$cmd" r]
fconfigure $chan -blocking false
fileevent $chan readable [list r_helper_readable $ii $chan]
incr R(nHelperRunning)
}
cd $cmdlinearg(testdir)
}
proc r_helper_readable {id chan} {
set data [gets $chan]
if {$data!=""} { puts "helper $id:$data" }
if {[eof $chan]} {
puts "helper $id is finished"
incr ::R(nHelperRunning) -1
close $chan
}
}
if {$R(nHelperRunning)==0} {
while { ""!=[set t [get_next_test]] } {
set R(output) ""
set TC(count) 0
set TC(errors) 0
foreach {config filename} $t {}
array set O $::testspec($config)
set ::G(perm:name) $config
set ::G(perm:prefix) $O(-prefix)
set ::G(isquick) 1
set ::G(perm:dbconfig) $O(-dbconfig)
set ::G(perm:presql) $O(-presql)
eval $O(-initialize)
set ms [slave_test_file $filename]
eval $O(-shutdown)
unset -nocomplain ::G(perm:sqlite3_args)
unset ::G(perm:name)
unset ::G(perm:prefix)
unset ::G(perm:dbconfig)
unset ::G(perm:presql)
r_set_test_result $config $filename $ms $TC(errors) $TC(count) $R(output)
if {$R(helper)==0} {
foreach msg [r_get_messages] { puts $msg }
}
}
# Tests are finished - write a record into testrunner.db describing
# any memory leaks.
r_memory_report
} else {
set TTT 0
sqlite3 db $R(dbname)
db timeout $R(timeout)
while {$R(nHelperRunning)>0} {
after 250 { incr TTT }
vwait TTT
foreach msg [r_get_messages db] { puts $msg }
}
db close
}
set errcode 0
if {$R(helper)==0} {
set errcode [r_final_report]
}
exit $errcode

View File

@@ -15,6 +15,7 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
if {[run_thread_tests]==0} { finish_test ; return }
ifcapable !shared_cache { finish_test ; return }
set ::enable_shared_cache [sqlite3_enable_shared_cache]

View File

@@ -19,7 +19,7 @@ set testdir [file dirname $argv0]
set do_not_use_codec 1
source $testdir/tester.tcl
if {[run_thread_tests]==0} { finish_test ; return }
ifcapable !shared_cache { finish_test ; return }
db close
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]

View File

@@ -16,6 +16,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !shared_cache { finish_test ; return }
# Open two database connections to the same database file in
# shared cache mode. Create update hooks that will fire on

View File

@@ -194,6 +194,7 @@ foreach {tn mode create_ok write_ok readonly_ok} {
} $A($readonly_ok)
}
ifcapable shared_cache {
set orig [sqlite3_enable_shared_cache]
foreach {tn options sc_default is_shared} {
1 "" 1 1
@@ -223,6 +224,7 @@ foreach {tn options sc_default is_shared} {
db2 close
}
} ;# end ifcapable shared_cache
do_test 4.3.1 {
list [catch {sqlite3 db "file:test.db?mode=rc"} msg] $msg

View File

@@ -11,6 +11,7 @@
#
# This file implements a test for VACUUM on attached databases.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -12,6 +12,7 @@
# focus of this file is testing that the VACUUM statement correctly
# frees any memory used for a temporary cache.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -649,41 +649,6 @@ do_test view-20.1 {
}
} {}
# Ticket [d58ccbb3f1b]: Prevent Table.nRef overflow.
db close
sqlite3 db :memory:
do_test view-21.1 {
catchsql {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(5);
CREATE VIEW v1 AS SELECT x*2 FROM t1;
CREATE VIEW v2 AS SELECT * FROM v1 UNION SELECT * FROM v1;
CREATE VIEW v4 AS SELECT * FROM v2 UNION SELECT * FROM v2;
CREATE VIEW v8 AS SELECT * FROM v4 UNION SELECT * FROM v4;
CREATE VIEW v16 AS SELECT * FROM v8 UNION SELECT * FROM v8;
CREATE VIEW v32 AS SELECT * FROM v16 UNION SELECT * FROM v16;
CREATE VIEW v64 AS SELECT * FROM v32 UNION SELECT * FROM v32;
CREATE VIEW v128 AS SELECT * FROM v64 UNION SELECT * FROM v64;
CREATE VIEW v256 AS SELECT * FROM v128 UNION SELECT * FROM v128;
CREATE VIEW v512 AS SELECT * FROM v256 UNION SELECT * FROM v256;
CREATE VIEW v1024 AS SELECT * FROM v512 UNION SELECT * FROM v512;
CREATE VIEW v2048 AS SELECT * FROM v1024 UNION SELECT * FROM v1024;
CREATE VIEW v4096 AS SELECT * FROM v2048 UNION SELECT * FROM v2048;
CREATE VIEW v8192 AS SELECT * FROM v4096 UNION SELECT * FROM v4096;
CREATE VIEW v16384 AS SELECT * FROM v8192 UNION SELECT * FROM v8192;
CREATE VIEW v32768 AS SELECT * FROM v16384 UNION SELECT * FROM v16384;
SELECT * FROM v32768 UNION SELECT * FROM v32768;
}
} {1 {too many references to "v1": max 65535}}
ifcapable progress {
do_test view-21.2 {
db progress 1000 {expr 1}
catchsql {
SELECT * FROM v32768;
}
} {1 interrupted}
}
db close
sqlite3 db :memory:
do_execsql_test view-22.1 {

60
test/view3.test Normal file
View File

@@ -0,0 +1,60 @@
# 2022 July 19
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this file is testing VIEW statements.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# Omit this entire file if the library is not configured with views enabled.
ifcapable !view {
finish_test
return
}
set testprefix view3
# Ticket [d58ccbb3f1b]: Prevent Table.nRef overflow.
db close
sqlite3 db :memory:
do_test 1.1 {
catchsql {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(5);
CREATE VIEW v1 AS SELECT x*2 FROM t1;
CREATE VIEW v2 AS SELECT * FROM v1 UNION SELECT * FROM v1;
CREATE VIEW v4 AS SELECT * FROM v2 UNION SELECT * FROM v2;
CREATE VIEW v8 AS SELECT * FROM v4 UNION SELECT * FROM v4;
CREATE VIEW v16 AS SELECT * FROM v8 UNION SELECT * FROM v8;
CREATE VIEW v32 AS SELECT * FROM v16 UNION SELECT * FROM v16;
CREATE VIEW v64 AS SELECT * FROM v32 UNION SELECT * FROM v32;
CREATE VIEW v128 AS SELECT * FROM v64 UNION SELECT * FROM v64;
CREATE VIEW v256 AS SELECT * FROM v128 UNION SELECT * FROM v128;
CREATE VIEW v512 AS SELECT * FROM v256 UNION SELECT * FROM v256;
CREATE VIEW v1024 AS SELECT * FROM v512 UNION SELECT * FROM v512;
CREATE VIEW v2048 AS SELECT * FROM v1024 UNION SELECT * FROM v1024;
CREATE VIEW v4096 AS SELECT * FROM v2048 UNION SELECT * FROM v2048;
CREATE VIEW v8192 AS SELECT * FROM v4096 UNION SELECT * FROM v4096;
CREATE VIEW v16384 AS SELECT * FROM v8192 UNION SELECT * FROM v8192;
CREATE VIEW v32768 AS SELECT * FROM v16384 UNION SELECT * FROM v16384;
SELECT * FROM v32768 UNION SELECT * FROM v32768;
}
} {1 {too many references to "v1": max 65535}}
ifcapable progress {
do_test 1.2 {
db progress 1000 {expr 1}
catchsql {
SELECT * FROM v32768;
}
} {1 interrupted}
}
finish_test

View File

@@ -12,6 +12,7 @@
# focus of this file is testing the operation of the library in
# "PRAGMA journal_mode=WAL" mode.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -9,6 +9,8 @@
#
#***********************************************************************
#
# TESTRUNNER: slow
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -86,7 +88,7 @@ do_multiclient_test tn {
INSERT INTO t1 VALUES(3, 4);
INSERT INTO t1 VALUES(5, 6);
}
code1 { db timeout 2000 }
code1 { db timeout 1100 }
} {}
do_test 2.$tn.2 {

View File

@@ -16,7 +16,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !wal {finish_test ; return }
ifcapable !wal||!shared_cache {finish_test ; return }
db close
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]

View File

@@ -12,6 +12,7 @@
# focus of this file is testing the operation of the library in
# "PRAGMA journal_mode=WAL" mode.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl

View File

@@ -8,6 +8,7 @@ source [file join [file dirname [info script]] wapp.tcl]
# Variables set by the "control" form:
#
# G(platform) - User selected platform.
# G(cfgglob) - Glob pattern that all configurations must match
# G(test) - Set to "Normal", "Veryquick", "Smoketest" or "Build-Only".
# G(keep) - Boolean. True to delete no files after each test.
# G(msvc) - Boolean. True to use MSVC as the compiler.
@@ -15,6 +16,7 @@ source [file join [file dirname [info script]] wapp.tcl]
# G(jobs) - How many sub-processes to run simultaneously.
#
set G(platform) $::tcl_platform(os)-$::tcl_platform(machine)
set G(cfgglob) *
set G(test) Normal
set G(keep) 1
set G(msvc) 0
@@ -29,7 +31,7 @@ set G(stdout) 0
proc wapptest_init {} {
global G
set lSave [list platform test keep msvc tcl jobs debug noui stdout]
set lSave [list platform test keep msvc tcl jobs debug noui stdout cfgglob]
foreach k $lSave { set A($k) $G($k) }
array unset G
foreach k $lSave { set G($k) $A($k) }
@@ -117,6 +119,10 @@ proc set_test_array {} {
if {$G(debug)==0} { set debug "-nodebug"}
foreach {config target} [releasetest_data tests $debug $G(platform)] {
# All configuration names must match $g(cfgglob), which defaults to *
#
if {![string match -nocase $G(cfgglob) $config]} continue
# If using MSVC, do not run sanitize or valgrind tests. Or the
# checksymbols test.
if {$G(msvc) && (
@@ -785,6 +791,7 @@ default it uses "wapp" to provide an interactive interface. Supported
command line options (all optional) are:
--platform PLATFORM (which tests to run)
--config GLOB (only run configurations matching GLOB)
--smoketest (run "make smoketest" only)
--veryquick (run veryquick.test only)
--buildonly (build executables, do not run tests)
@@ -876,6 +883,12 @@ for {set i 0} {$i < [llength $lTestArg]} {incr i} {
set G(stdout) 1
}
-config {
if {$i==[llength $lTestArg]-1} { wapptest_usage }
incr i
set G(cfgglob) [lindex $lTestArg $i]
}
-stdout {
set G(stdout) 1
}

View File

@@ -12,6 +12,8 @@
# focus of this script is recovery from transient manditory locks
# that sometimes appear on database files due to anti-virus software.
#
# TESTRUNNER: slow
#
if {$tcl_platform(platform)!="windows"} return