/ Check-in [ecbff972]
Login

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

Overview
Comment:Reset the writer-thread halt criteria after halting the thread. (CVS 4528)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ecbff972a1f5c7d846c322c435fa73584655b7f0
User & Date: danielk1977 2007-11-05 17:01:08
Context
2007-11-05
17:54
Drop support for the SQLITE_OMIT_MEMORY_ALLOCATION compile-time option. (CVS 4529) check-in: b57c89fe user: drh tags: trunk
17:01
Reset the writer-thread halt criteria after halting the thread. (CVS 4528) check-in: ecbff972 user: danielk1977 tags: trunk
15:30
Fix some minor problems with malloc failure and in-memory databases. (CVS 4527) check-in: b752906e user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/async.test.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
43
44
45
46
47
48
49

50
51
52
53
54
55
56
..
58
59
60
61
62
63
64

65
66
67
68
69
70
71
72

73
74
75
76
77
78
#    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.
#
#***********************************************************************
# This file runs all tests.
#
# $Id: async.test,v 1.12 2007/09/14 16:20:01 danielk1977 Exp $


if {[catch {sqlite3async_enable}]} {
  # The async logic is not built into this system
  return
}

................................................................................

rename do_test really_do_test
proc do_test {name args} {
  uplevel really_do_test async_io-$name $args
  sqlite3async_start
  sqlite3async_halt idle
  sqlite3async_wait

}

foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
  set tail [file tail $testfile]
  if {[lsearch -exact $INCLUDE $tail]<0} continue
  source $testfile

................................................................................
  # the next test file will delete the database file on disk (using
  # [file delete]). If the asynchronous backend still has the file
  # open, it will become confused.
  #
  sqlite3async_halt idle
  sqlite3async_start
  sqlite3async_wait

}

# Flush the write-queue and disable asynchronous IO. This should ensure
# all allocated memory is cleaned up.
set sqlite3async_trace 1
sqlite3async_halt idle
sqlite3async_start
sqlite3async_wait

sqlite3async_enable 0
set sqlite3async_trace 0

really_finish_test
rename really_do_test do_test
rename really_finish_test finish_test







|







 







>







 







>








>






2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
..
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#    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.
#
#***********************************************************************
# This file runs all tests.
#
# $Id: async.test,v 1.13 2007/11/05 17:01:08 danielk1977 Exp $


if {[catch {sqlite3async_enable}]} {
  # The async logic is not built into this system
  return
}

................................................................................

rename do_test really_do_test
proc do_test {name args} {
  uplevel really_do_test async_io-$name $args
  sqlite3async_start
  sqlite3async_halt idle
  sqlite3async_wait
  sqlite3async_halt never
}

foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
  set tail [file tail $testfile]
  if {[lsearch -exact $INCLUDE $tail]<0} continue
  source $testfile

................................................................................
  # the next test file will delete the database file on disk (using
  # [file delete]). If the asynchronous backend still has the file
  # open, it will become confused.
  #
  sqlite3async_halt idle
  sqlite3async_start
  sqlite3async_wait
  sqlite3async_halt never
}

# Flush the write-queue and disable asynchronous IO. This should ensure
# all allocated memory is cleaned up.
set sqlite3async_trace 1
sqlite3async_halt idle
sqlite3async_start
sqlite3async_wait
sqlite3async_halt never
sqlite3async_enable 0
set sqlite3async_trace 0

really_finish_test
rename really_do_test do_test
rename really_finish_test finish_test

Changes to test/async2.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
67
68
69
70
71
72
73

74
75
76
77
78
79
80
...
119
120
121
122
123
124
125

126
127
#
#    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.8 2007/09/05 16:54:41 danielk1977 Exp $


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

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

    catchsql $::sql_script
    db close

    sqlite3async_halt idle
    sqlite3async_start
    sqlite3async_wait

    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}]
................................................................................
  }
}

catch {db close}
sqlite3async_halt idle
sqlite3async_start
sqlite3async_wait


finish_test







|







 







>







 







>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
...
120
121
122
123
124
125
126
127
128
129
#
#    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]=="" ||
................................................................................

    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}]
................................................................................
  }
}

catch {db close}
sqlite3async_halt idle
sqlite3async_start
sqlite3async_wait
sqlite3async_halt never

finish_test

Changes to test/async3.test.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
65
66
67
68
69
70
71

72
73
#
#***********************************************************************
#
# The focus of this file is testing the code in test_async.c.
# Specifically, it tests that the xFullPathname() method of
# of the asynchronous vfs works correctly.
#
# $Id: async3.test,v 1.2 2007/09/05 16:54:41 danielk1977 Exp $

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

if { [info commands sqlite3async_enable]==""  } {
  # The async logic is not built into this system
  puts "Skipping async3 tests: not compiled with required features"
................................................................................
  db2 close
  incr N
}

db close
sqlite3async_halt idle
sqlite3async_wait

sqlite3async_enable 0
finish_test







|







 







>


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
65
66
67
68
69
70
71
72
73
74
#
#***********************************************************************
#
# The focus of this file is testing the code in test_async.c.
# Specifically, it tests that the xFullPathname() method of
# of the asynchronous vfs works correctly.
#
# $Id: async3.test,v 1.3 2007/11/05 17:01:08 danielk1977 Exp $

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

if { [info commands sqlite3async_enable]==""  } {
  # The async logic is not built into this system
  puts "Skipping async3 tests: not compiled with required features"
................................................................................
  db2 close
  incr N
}

db close
sqlite3async_halt idle
sqlite3async_wait
sqlite3async_halt never
sqlite3async_enable 0
finish_test