SQLite

Check-in [fcbf7cf189]
Login

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

Overview
Comment:Have test_vfs.c simulate IO errors in xShmLock.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fcbf7cf189506e43fc2f0820aedffb195038d3a9
User & Date: dan 2010-06-03 18:20:20.000
Context
2010-06-03
19:10
Fix another problem in test_vfs.c. (check-in: df7d59899c user: dan tags: trunk)
18:20
Have test_vfs.c simulate IO errors in xShmLock. (check-in: fcbf7cf189 user: dan tags: trunk)
18:02
Performance fix for winShmClose(). (check-in: ed7774de04 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test_vfs.c.
653
654
655
656
657
658
659




660
661
662
663
664
665
666
    }
    tvfsExecTcl(p, "xShmLock", 
        Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId,
        Tcl_NewStringObj(zLock, -1)
    );
    tvfsResultCode(p, &rc);
  }




  return rc;
}

static void tvfsShmBarrier(sqlite3_file *pFile){
  TestvfsFile *pFd = (TestvfsFile *)pFile;
  Testvfs *p = (Testvfs *)(pFd->pVfs->pAppData);








>
>
>
>







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
    }
    tvfsExecTcl(p, "xShmLock", 
        Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId,
        Tcl_NewStringObj(zLock, -1)
    );
    tvfsResultCode(p, &rc);
  }

  if( rc==SQLITE_OK && p->mask&TESTVFS_SHMLOCK_MASK && tvfsInjectIoerr(p) ){
    rc = SQLITE_IOERR;
  }
  return rc;
}

static void tvfsShmBarrier(sqlite3_file *pFile){
  TestvfsFile *pFd = (TestvfsFile *)pFile;
  Testvfs *p = (Testvfs *)(pFd->pVfs->pAppData);

Changes to test/tester.tcl.
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  if {[regexp {^--backtrace=(\d+)$} [lindex $argv $i] all value]} {
    sqlite3_memdebug_backtrace $value
    set argv [lreplace $argv $i $i]
  }
}


proc ostrace_call {zCall nClick zFile i32 i64} {
  set s "INSERT INTO ostrace VALUES('$zCall', $nClick, '$zFile', $i32, $i64);"
  puts $::ostrace_fd $s
}

for {set i 0} {$i<[llength $argv]} {incr i} {
  if {[lindex $argv $i] eq "--binarylog"} {
    set tester_do_binarylog 1
    set argv [lreplace $argv $i $i]
  }
}








<
<
<
<
<







68
69
70
71
72
73
74





75
76
77
78
79
80
81
  if {[regexp {^--backtrace=(\d+)$} [lindex $argv $i] all value]} {
    sqlite3_memdebug_backtrace $value
    set argv [lreplace $argv $i $i]
  }
}







for {set i 0} {$i<[llength $argv]} {incr i} {
  if {[lindex $argv $i] eq "--binarylog"} {
    set tester_do_binarylog 1
    set argv [lreplace $argv $i $i]
  }
}

Added test/wal_common.tcl.




















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 2010 June 03
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    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 contains common code used by many different malloc tests
# within the test suite.
#

proc wal_file_size {nFrame pgsz} {
  expr {24 + ($pgsz+24)*$nFrame}
}

proc wal_frame_count {zFile pgsz} {
  set f [file size $zFile]
  expr {($f - 24) / ($pgsz+24)}
}