SQLite

Check-in [f398a2d1b0]
Login

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

Overview
Comment:Get the OOM tester in async2.test working again. (CVS 6381)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f398a2d1b0a731bbb600d0bb70ab79f1334ceda9
User & Date: drh 2009-03-24 17:43:57.000
Context
2009-03-24
18:42
Change OS_UNIX to SQLITE_OS_UNIX in test_thread.c. Modify notify2.test to print out its timings in addition to reporting success or failure. (CVS 6382) (check-in: 940d72d2ba user: drh tags: trunk)
17:43
Get the OOM tester in async2.test working again. (CVS 6381) (check-in: f398a2d1b0 user: drh tags: trunk)
16:55
Adjust the lock.test and lock3.test scripts so that they work with the asynchronous VFS. (CVS 6380) (check-in: 40df926b46 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/async2.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: async2.test,v 1.9 2007/11/05 17:01:08 danielk1977 Exp $


set testdir [file dirname $argv0]
source $testdir/tester.tcl

if {
  [info commands sqlite3async_enable]=="" ||







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: async2.test,v 1.10 2009/03/24 17:43:57 drh Exp $


set testdir [file dirname $argv0]
source $testdir/tester.tcl

if {
  [info commands sqlite3async_enable]=="" ||
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

  UPDATE counter SET c = 'FIN';
}

db close

foreach err [list ioerr malloc-transient malloc-persistent] {
  set ::go 1
  for {set n 1} {$::go} {incr n} {
    set ::sqlite_io_error_pending 0
    sqlite3_memdebug_fail -1
    file delete -force test.db test.db-journal
    sqlite3 db test.db
    execsql $::setup_script
    db close
  
    sqlite3async_enable 1
    sqlite3 db test.db

  
    switch -- $err {
      ioerr             { set ::sqlite_io_error_pending $n }
      malloc-persistent { sqlite3_memdebug_fail $n -repeat 1 }
      malloc-transient  { sqlite3_memdebug_fail $n -repeat 0 }
    }

    catchsql $::sql_script
    db close

    sqlite3async_halt idle
    sqlite3async_start
    sqlite3async_wait
    sqlite3async_halt never
    sqlite3async_enable 0

    set ::sqlite_io_error_pending 0
    sqlite3_memdebug_fail -1

    sqlite3 db test.db
    set c [db eval {SELECT c FROM counter LIMIT 1}]
    switch -- $c {
      1 {
        do_test async-$err-1.1.$n {
          execsql {
            SELECT name FROM sqlite_master;
          }
        } {counter}







|










>




















|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

  UPDATE counter SET c = 'FIN';
}

db close

foreach err [list ioerr malloc-transient malloc-persistent] {
  set ::go 10
  for {set n 1} {$::go} {incr n} {
    set ::sqlite_io_error_pending 0
    sqlite3_memdebug_fail -1
    file delete -force test.db test.db-journal
    sqlite3 db test.db
    execsql $::setup_script
    db close
  
    sqlite3async_enable 1
    sqlite3 db test.db
    sqlite3_db_config_lookaside db 0 0 0
  
    switch -- $err {
      ioerr             { set ::sqlite_io_error_pending $n }
      malloc-persistent { sqlite3_memdebug_fail $n -repeat 1 }
      malloc-transient  { sqlite3_memdebug_fail $n -repeat 0 }
    }

    catchsql $::sql_script
    db close

    sqlite3async_halt idle
    sqlite3async_start
    sqlite3async_wait
    sqlite3async_halt never
    sqlite3async_enable 0

    set ::sqlite_io_error_pending 0
    sqlite3_memdebug_fail -1

    sqlite3 db test.db
    set c [db one {SELECT c FROM counter LIMIT 1}]
    switch -- $c {
      1 {
        do_test async-$err-1.1.$n {
          execsql {
            SELECT name FROM sqlite_master;
          }
        } {counter}
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
        do_test async-$err-1.3.$n.2 {
          execsql {
            SELECT * FROM t2;
          }
        } {klmnopqrst and seven}
      }
      FIN {
        set ::go 0
      }
    }
  
    db close
  }
}








|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        do_test async-$err-1.3.$n.2 {
          execsql {
            SELECT * FROM t2;
          }
        } {klmnopqrst and seven}
      }
      FIN {
        incr ::go -1
      }
    }
  
    db close
  }
}