/ Check-in [ae7c5ed1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the "-external" option to the tserver_test.tcl program..
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent-pnu-wal2
Files: files | file ages | folders
SHA3-256:ae7c5ed15d5d549326bf570c8f03b49e8e601e7389bf8d702d0d7db0c0570ee8
User & Date: dan 2019-01-04 19:25:22
Wiki:begin-concurrent-pnu-wal2
Context
2019-01-04
19:39
Fix the experimental sqlite3_wal_info() API so that it works with wal2 mode. check-in: 079daedb user: dan tags: begin-concurrent-pnu-wal2
19:25
Add the "-external" option to the tserver_test.tcl program.. check-in: ae7c5ed1 user: dan tags: begin-concurrent-pnu-wal2
17:12
Update the "tserver" program to report the amount of time spent in COMMIT commands. check-in: cf494b41 user: dan tags: begin-concurrent-pnu-wal2
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/tserver_test.tcl.

    13     13   set O(-mode)      wal2
    14     14   set O(-tserver)   "./tserver"
    15     15   set O(-seconds)   20
    16     16   set O(-writers)   1
    17     17   set O(-readers)   0
    18     18   set O(-integrity) 0
    19     19   set O(-verbose)   0
           20  +set O(-external)   0
    20     21   
    21     22   
    22     23   proc error_out {err} {
    23     24     puts stderr $err
    24     25     exit -1
    25     26   }
    26     27   
................................................................................
    33     34     puts stderr "  -rows <number of rows>                (default: 5000000)"
    34     35     puts stderr "  -tserver <path to tserver executable> (default: ./tserver)"
    35     36     puts stderr "  -seconds <time to run for in seconds> (default: 20)"
    36     37     puts stderr "  -writers <number of writer clients>   (default: 1)"
    37     38     puts stderr "  -readers <number of reader clients>   (default: 0)"
    38     39     puts stderr "  -integrity <number of IC clients>     (default: 0)"
    39     40     puts stderr "  -verbose 0|1                          (default: 0)"
           41  +  puts stderr "  -external 0|1                         (default: 0)"
    40     42     exit -1
    41     43   }
    42     44   
    43     45   for {set i 0} {$i < [llength $argv]} {incr i} {
    44     46     set opt ""
    45     47     set arg [lindex $argv $i]
    46     48     set n [expr [string length $arg]-1]
................................................................................
    77     79   
    78     80   #--------------------------------------------------------------------------
    79     81   # Create and populate the required test database, if it is not already 
    80     82   # present in the file-system.
    81     83   #
    82     84   proc create_test_database {} {
    83     85     global O
           86  +
           87  +  if {$O(-external)} return
    84     88   
    85     89     if {[file exists $O(-database)]} {
    86     90       sqlite3 db $O(-database)
    87     91   
    88     92       # Check the schema looks Ok.
    89     93       set s [db one {
    90     94         SELECT group_concat(name||pk, '.') FROM pragma_table_info('t1');
................................................................................
   147    151   #
   148    152   #   tserver_start
   149    153   #   tserver_stop
   150    154   #
   151    155   set ::tserver {}
   152    156   proc tserver_start {} {
   153    157     global O
          158  +  if {$O(-external)} return
   154    159     set cmd "|$O(-tserver) -vfs unix-excl "
   155    160     if {$O(-mode)=="wal2"} {
   156    161       append cmd " -walautocheckpoint 0 "
   157    162     }
   158    163     append cmd "$O(-database)"
   159    164     set ::tserver [open $cmd]
   160    165     fconfigure $::tserver -blocking 0
................................................................................
   169    174     set line [gets $::tserver]
   170    175     if {$line != "" && $O(-verbose)} {
   171    176       puts "tserver: $line"
   172    177     }
   173    178   }
   174    179   
   175    180   proc tserver_stop {} {
          181  +  global O
          182  +  if {$O(-external)} return
   176    183     close $::tserver
   177    184     set fd [socket localhost 9999]
   178    185     puts $fd ".stop"
   179    186     close $fd
   180    187   }
   181    188   #-------------------------------------------------------------------------
   182    189