SQLite

Check-in [66576b450a]
Login

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

Overview
Comment:Fix a problem in incrvacuum_ioerr.test. Do not run ioerr6.test with an in-memory journal.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 66576b450a0f0329571e344280994a964c967f8f
User & Date: dan 2013-03-06 11:44:57.252
Context
2013-03-07
06:42
Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined. (check-in: 10ace06be7 user: mistachkin tags: trunk)
2013-03-06
11:44
Fix a problem in incrvacuum_ioerr.test. Do not run ioerr6.test with an in-memory journal. (check-in: 66576b450a user: dan tags: trunk)
01:55
Fix a bug (ticket [fc7bd6358f59]) that caused incorrect query results in three way queries that involved comparing INTEGER and TEXT columns for equality. (check-in: 7097241c12 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/incrvacuum_ioerr.test.
137
138
139
140
141
142
143

144
145
146
147
148
149
150
  for {set iTest 1} {$::rc && $iTest<2000} {incr iTest} {
  
    # Figure out how big the database is and how many free pages it
    # has before running incremental-vacuum.
    #
    set nFree [execsql {pragma freelist_count} db1]
    set nPage [execsql {pragma page_count} db1]

  
    # Now run incremental-vacuum to vacuum 5 pages from the db file.
    # The iTest'th I/O call is set to fail.
    #
    set ::sqlite_io_error_pending $iTest
    set ::sqlite_io_error_persist 1
    do_test incrvacuum-ioerr-4.$iTest.1 {







>







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
  for {set iTest 1} {$::rc && $iTest<2000} {incr iTest} {
  
    # Figure out how big the database is and how many free pages it
    # has before running incremental-vacuum.
    #
    set nFree [execsql {pragma freelist_count} db1]
    set nPage [execsql {pragma page_count} db1]
    puts "nFree=$nFree nPage=$nPage"
  
    # Now run incremental-vacuum to vacuum 5 pages from the db file.
    # The iTest'th I/O call is set to fail.
    #
    set ::sqlite_io_error_pending $iTest
    set ::sqlite_io_error_persist 1
    do_test incrvacuum-ioerr-4.$iTest.1 {
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
    set ::sqlite_io_error_hardhit 0
  
    set nFree2 [execsql {pragma freelist_count} db1]
    set nPage2 [execsql {pragma page_count} db1]
  
    do_test incrvacuum-ioerr-4.$iTest.2 {
      set shrink [expr {$nPage-$nPage2}]
      expr {$shrink==0 || $shrink==5}
    } {1}
  
    do_test incrvacuum-ioerr-4.$iTest.3 {
      expr {$nPage - $nPage2}
    } [expr {$nFree - $nFree2}]
  }
  







|







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
    set ::sqlite_io_error_hardhit 0
  
    set nFree2 [execsql {pragma freelist_count} db1]
    set nPage2 [execsql {pragma page_count} db1]
  
    do_test incrvacuum-ioerr-4.$iTest.2 {
      set shrink [expr {$nPage-$nPage2}]
      expr {$shrink==0 || $shrink==5 || ($nFree<5 && $shrink==$nFree)}
    } {1}
  
    do_test incrvacuum-ioerr-4.$iTest.3 {
      expr {$nPage - $nPage2}
    } [expr {$nFree - $nFree2}]
  }
  
Changes to test/ioerr6.test.
16
17
18
19
20
21
22









23
24
25
26
27
28
29
set ::testprefix ioerr6

ifcapable !atomicwrite {
  puts "skipping tests - not compiled with SQLITE_ENABLE_ATOMIC_WRITE..."
  finish_test
  return
}









faultsim_save_and_close

do_test 1.1 {
  testvfs shmfault -default true
  shmfault devchar atomic
  sqlite3 db test.db
  execsql {







>
>
>
>
>
>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set ::testprefix ioerr6

ifcapable !atomicwrite {
  puts "skipping tests - not compiled with SQLITE_ENABLE_ATOMIC_WRITE..."
  finish_test
  return
}

if {[permutation]=="inmemory_journal"} {
  # These tests will not work with in-memory journals (as persistent VFS
  # errors commencing after a transaction has started to write to the db
  # cannot be recovered from).
  finish_test
  return
}

faultsim_save_and_close

do_test 1.1 {
  testvfs shmfault -default true
  shmfault devchar atomic
  sqlite3 db test.db
  execsql {
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
} -test {
  set res [db one { PRAGMA integrity_check }]
  if {$res != "ok"} {
    error "integrity check: $res"
  }
}

do_faultsim_test 2 -faults full* -prep {
  shmfault devchar atomic
  faultsim_restore
  sqlite3 db test.db
} -body {
  db eval {
    CREATE TABLE t1(x);
    CREATE TABLE t2(x);







|







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
} -test {
  set res [db one { PRAGMA integrity_check }]
  if {$res != "ok"} {
    error "integrity check: $res"
  }
}

do_faultsim_test 3 -faults full* -prep {
  shmfault devchar atomic
  faultsim_restore
  sqlite3 db test.db
} -body {
  db eval {
    CREATE TABLE t1(x);
    CREATE TABLE t2(x);