3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
13 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 source $testdir/lock_common.tcl
17 if {[run_thread_tests]==0} { finish_test ; return }
19 set testprefix thread3
22 CREATE TABLE t1(a, b);
23 PRAGMA journal_mode = DELETE;
26 proc wait_for_var {varname} {
27 if {0==[uplevel [list info exists $varname]]} {
28 uplevel [list vwait $varname]
30 uplevel [list set $varname]
36 for {set i 0} {$i < $nAttempt} {incr i} {
47 dbI eval { INSERT INTO t1 VALUES(203, 'message') RETURNING a; }
49 if {$rc} { incr nBusy }
58 dbR eval { SELECT count(*) FROM t1 }
69 execsql { SELECT count(*) FROM t1 }
73 do_execsql_test "1.Total BUSY errors: $nTotalBusy .2" {
74 SELECT count(*) FROM t1;