mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-16 23:02:26 +03:00
Merge latest changes from the trunk into the sessions branch.
FossilOrigin-Name: c00e45ede7cbf71a3a6d1ccad0b9275010ca8493
This commit is contained in:
@@ -45,7 +45,7 @@ proc do_temptables_test {tn sql temptables} {
|
||||
uplevel [list do_test $tn [subst -novar {
|
||||
set ret ""
|
||||
db eval "EXPLAIN [set sql]" {
|
||||
if {$opcode == "OpenEphemeral"} {
|
||||
if {$opcode == "OpenEphemeral" || $opcode == "SorterOpen"} {
|
||||
if {$p5 != "10" && $p5!="00"} { error "p5 = $p5" }
|
||||
if {$p5 == "10"} {
|
||||
lappend ret hash
|
||||
|
||||
@@ -158,5 +158,23 @@ do_execsql_test 2.3 {
|
||||
SELECT docid FROM t2 WHERE t2 MATCH 'aa';
|
||||
} {3 1}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test that ticket [56be976859] has been fixed.
|
||||
#
|
||||
do_execsql_test 3.1 {
|
||||
CREATE VIRTUAL TABLE t3 USING fts4(x, order=DESC);
|
||||
INSERT INTO t3(docid, x) VALUES(113382409004785664, 'aa');
|
||||
INSERT INTO t3(docid, x) VALUES(1, 'ab');
|
||||
SELECT rowid FROM t3 WHERE x MATCH 'a*' ORDER BY docid DESC;
|
||||
} {113382409004785664 1}
|
||||
do_execsql_test 3.2 {
|
||||
CREATE VIRTUAL TABLE t4 USING fts4(x);
|
||||
INSERT INTO t4(docid, x) VALUES(-113382409004785664, 'aa');
|
||||
INSERT INTO t4(docid, x) VALUES(1, 'ab');
|
||||
SELECT rowid FROM t4 WHERE x MATCH 'a*';
|
||||
} {-113382409004785664 1}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
@@ -108,5 +108,19 @@ do_execsql_test 1.8 {
|
||||
PRAGMA integrity_check
|
||||
} {ok}
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
BEGIN;
|
||||
CREATE TABLE t2(x);
|
||||
INSERT INTO t2 VALUES(14);
|
||||
INSERT INTO t2 VALUES(35);
|
||||
INSERT INTO t2 VALUES(15);
|
||||
INSERT INTO t2 VALUES(35);
|
||||
INSERT INTO t2 VALUES(16);
|
||||
COMMIT;
|
||||
}
|
||||
do_catchsql_test 2.2 {
|
||||
CREATE UNIQUE INDEX i3 ON t2(x);
|
||||
} {1 {indexed columns are not unique}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -270,7 +270,7 @@ ifcapable {explain} {
|
||||
CREATE UNIQUE INDEX ex1i1 ON ex1(a);
|
||||
EXPLAIN REINDEX;
|
||||
}]
|
||||
regexp { IsUnique \d+ \d+ \d+ \d+ } $x
|
||||
regexp { SorterCompare \d+ \d+ \d+ } $x
|
||||
} {1}
|
||||
if {[regexp {16} [db one {PRAGMA encoding}]]} {
|
||||
do_test misc3-6.11-utf16 {
|
||||
|
||||
@@ -2437,6 +2437,7 @@ do_test pager1-32.1 {
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(1, randomblob(10000));
|
||||
}
|
||||
file_control_chunksize_test db main 1024
|
||||
file_control_sizehint_test db main 20971520; # 20MB
|
||||
execsql {
|
||||
PRAGMA cache_size = 10;
|
||||
|
||||
@@ -29,7 +29,7 @@ if {[llength [info command client_step]]==0 || [sqlite3 -has-codec]} {
|
||||
# The sample server implementation does not work right when memory
|
||||
# management is enabled.
|
||||
#
|
||||
ifcapable memorymanage {
|
||||
ifcapable (memorymanage||mutex_noop) {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ foreach {tn same_db shared_cache} [list \
|
||||
sqlite3_enable_shared_cache $shared_cache
|
||||
sqlite3_enable_shared_cache $shared_cache
|
||||
} $shared_cache
|
||||
sqlite3 db test.db -fullmutex 1
|
||||
sqlite3 db test.db -fullmutex 1 -key xyzzy
|
||||
|
||||
set dbconfig ""
|
||||
if {$same_db} {
|
||||
@@ -77,7 +77,7 @@ foreach {tn same_db shared_cache} [list \
|
||||
#sqlthread parent {puts STARTING..}
|
||||
set needToClose 0
|
||||
if {![info exists ::DB]} {
|
||||
set ::DB [sqlthread open test.db]
|
||||
set ::DB [sqlthread open test.db xyzzy]
|
||||
#sqlthread parent "puts \"OPEN $::DB\""
|
||||
set needToClose 1
|
||||
}
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
|
||||
set do_not_use_codec 1
|
||||
source $testdir/tester.tcl
|
||||
if {[run_thread_tests]==0} { finish_test ; return }
|
||||
|
||||
|
||||
db close
|
||||
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ do_test thread003.2 {
|
||||
foreach zFile {test.db test2.db} {
|
||||
set SCRIPT [format {
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open %s]
|
||||
set ::DB [sqlthread open %s xyzzy]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
@@ -117,7 +117,7 @@ do_test thread003.3 {
|
||||
set SCRIPT [format {
|
||||
set iStart [clock_seconds]
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open %s]
|
||||
set ::DB [sqlthread open %s xyzzy]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
@@ -156,7 +156,7 @@ unset -nocomplain finished(2)
|
||||
do_test thread003.4 {
|
||||
thread_spawn finished(1) $thread_procs [format {
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open test.db]
|
||||
set ::DB [sqlthread open test.db xyzzy]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
|
||||
@@ -235,7 +235,7 @@ foreach {testprefix do_wal_checkpoint} {
|
||||
do_test 2.3.$tn.5 { sql1 { INSERT INTO t2 VALUES(3, 4) } } {}
|
||||
do_test 2.3.$tn.6 { file_page_counts } {1 7 1 7}
|
||||
do_test 2.3.$tn.7 { code1 { do_wal_checkpoint db -mode full } } {1 7 5}
|
||||
do_test 2.3.$tn.8 { file_page_counts } {2 7 2 7}
|
||||
do_test 2.3.$tn.8 { file_page_counts } {1 7 2 7}
|
||||
}
|
||||
|
||||
# Check that checkpoints block on the correct locks. And respond correctly
|
||||
@@ -343,3 +343,4 @@ foreach {testprefix do_wal_checkpoint} {
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user