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

Add a more rigorous test case for the bug fixed by the previous commit on this

branch.

FossilOrigin-Name: 4256072399f44f48ed0856aa8112226af6feaf8676923612bde6cea239ebf920
This commit is contained in:
dan
2017-08-12 14:06:15 +00:00
parent 6aab028db0
commit d828d0debc
3 changed files with 38 additions and 8 deletions

View File

@@ -576,7 +576,6 @@ do_multiclient_test tn {
CREATE TABLE t4(a INTEGER PRIMARY KEY, b);
PRAGMA wal_checkpoint;
}
set {} {}
} {}
@@ -615,6 +614,37 @@ do_multiclient_test tn {
csql3 { COMMIT }
} {1 {database is locked}}
csql2 ROLLBACK
csql3 ROLLBACK
# The following test works with $tn==1 (sql2 and sql3 use separate
# processes), but is quite slow. So only run it with $tn==2 (all
# connections in the same process).
#
if {$tn==2} {
do_test 7.$tn.7 {
for {set i 1} {$i < 10000} {incr i} {
sql3 {
PRAGMA wal_checkpoint;
BEGIN CONCURRENT;
SELECT * FROM t3;
INSERT INTO t4 VALUES(1, 2);
}
sql1 {
UPDATE t2 SET b = randomblob(400) WHERE rowid <= $i;
UPDATE t3 SET b = randomblob(400) WHERE rowid = 1;
}
if {[csql3 COMMIT]!={1 {database is locked}}} {
error "Failed at i=$i"
}
csql3 ROLLBACK
}
} {}
}
}
finish_test