/ Check-in [d137e841]
Login

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

Overview
Comment:Fix test script bugs in the thread002.test and thread_common.tcl. (CVS 6352)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d137e841ce90be92f4c18218f35d22e3a06b0f14
User & Date: drh 2009-03-17 15:39:31
Context
2009-03-17
17:49
Fix a problem that could cause a crash when a shared-cache schema contains column default values. (CVS 6353) check-in: afadddc3 user: danielk1977 tags: trunk
15:39
Fix test script bugs in the thread002.test and thread_common.tcl. (CVS 6352) check-in: d137e841 user: drh tags: trunk
2009-03-16
17:07
Make sure the finished() array in thread005.test is cleared before the script starts. (CVS 6351) check-in: ddadc25d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to test/thread002.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   #   This test attempts to deadlock SQLite in shared-cache mode.
    13     13   #     
    14     14   #
    15         -# $Id: thread002.test,v 1.7 2009/03/16 17:07:57 drh Exp $
           15  +# $Id: thread002.test,v 1.8 2009/03/17 15:39:31 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   
    19     19   source $testdir/tester.tcl
    20     20   source $testdir/thread_common.tcl
    21     21   if {[info commands sqlthread] eq ""} {
    22     22     finish_test
................................................................................
    59     59     
    60     60       execsql { SELECT * FROM aux2.t1 }
    61     61       execsql { INSERT INTO aux2.t1(v) SELECT sum(v) FROM aux3.t1 }
    62     62     
    63     63       execsql { SELECT * FROM aux3.t1 }
    64     64       execsql { INSERT INTO aux3.t1(v) SELECT sum(v) FROM aux1.t1 }
    65     65   
    66         -    execsql { CREATE TABLE aux1.t2(a,b) }
    67         -    execsql { DROP TABLE aux1.t2 }
           66  +    execsql { CREATE TABLE IF NOT EXISTS aux1.t2(a,b) }
           67  +    execsql { DROP TABLE IF EXISTS aux1.t2 }
    68     68   
    69     69       # if {($ii%10)==0} {puts -nonewline . ; flush stdout}
    70     70       puts -nonewline . ; flush stdout
    71     71     }
    72     72   
    73     73     sqlite3_close $::DB
    74     74     list OK

Changes to test/thread_common.tcl.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: thread_common.tcl,v 1.3 2009/01/19 17:40:12 drh Exp $
           12  +# $Id: thread_common.tcl,v 1.4 2009/03/17 15:39:31 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   
    17     17   if {[info commands sqlthread] eq ""} {
    18     18     puts -nonewline "Skipping thread-safety tests - "
    19     19     puts            " not running a threadsafe sqlite/tcl build"
................................................................................
    46     46           while {[set rc [sqlite3_step $::STMT]] eq "SQLITE_ROW"} {
    47     47             for {set i 0} {$i < [sqlite3_column_count $::STMT]} {incr i} {
    48     48               lappend res [sqlite3_column_text $::STMT 0]
    49     49             }
    50     50           }
    51     51           set rc [sqlite3_finalize $::STMT]
    52     52         } else {
    53         -        if {[string first (6) $msg]} {
           53  +        if {[lindex $msg 0]=="(6)"} {
    54     54             set rc SQLITE_LOCKED
    55     55           } else {
    56     56             set rc SQLITE_ERROR
    57     57           }
    58     58         }
    59     59   
    60     60         if {[string first locked [sqlite3_errmsg $::DB]]>=0} {