From: drh Date: Mon, 23 Jan 2006 16:25:22 +0000 (+0000) Subject: Get I/O error tests working on windows. (CVS 3007) X-Git-Tag: version-3.6.10~3160 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be1f84c02182eba90804417e06f8a0f7b95539ac;p=thirdparty%2Fsqlite.git Get I/O error tests working on windows. (CVS 3007) FossilOrigin-Name: 2ef8b85db7607eb0989c5ecf49cc554fa13d894f --- diff --git a/manifest b/manifest index 7da4629832..d405875286 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\suninitialized\svariable\sin\sos_unix.c.\s(CVS\s3006) -D 2006-01-23T16:24:54 +C Get\sI/O\serror\stests\sworking\son\swindows.\s(CVS\s3007) +D 2006-01-23T16:25:22 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -57,7 +57,7 @@ F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_unix.c b25eca667f926d24b542fb20378b3665feccfe2b F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e -F src/os_win.c 438e6587e1767c51e9e0e781e3bb52f72764e67b +F src/os_win.c 2600438d6cfe1c59c2bdab37abfe83fe9f441467 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/pager.c b101634a093451017068c4fd80af966bd5042edc F src/pager.h e0acb095b3ad0bca48f2ab00c87346665643f64f @@ -172,7 +172,7 @@ F test/insert2.test 5a20e1ace5fa0800b58d28284212290189b49aed F test/insert3.test c67f0240b1c17e71fa2ed8bb6de064928f549f95 F test/interrupt.test cd24dc5bedd02325be4bfa5d6209fae01c465157 F test/intpkey.test af4fd826c4784ec5c93b444de07adea0254d0d30 -F test/ioerr.test 3c9facf13063084fdf4cbe1449b619977b342806 +F test/ioerr.test 35637957d7d5c6385bd94e8a6f067b5016219c03 F test/join.test db3802739fb695bdfa2e88805e3d64ec5ffbebd1 F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324 F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0 @@ -344,7 +344,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 77969c671c6ea1b5a2739f62de2bec10cc651b9e -R 5fb0d48ea05ce967ee113d7e28f8e1a6 +P 892e644d20b9d132cf29242a9bca0116ebe6968f +R 433e83df448653f1acd9d8fd6aaee6fb U drh -Z 6d4b56c231aebc3a1fa59b1e9fa044bb +Z c648ca4416f9c251963aea81faf7a779 diff --git a/manifest.uuid b/manifest.uuid index 356a61105d..c4719af83e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -892e644d20b9d132cf29242a9bca0116ebe6968f \ No newline at end of file +2ef8b85db7607eb0989c5ecf49cc554fa13d894f \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index f505759bcc..284433a89e 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -603,8 +603,6 @@ int sqlite3WinOpenReadWrite( #endif /* OS_WINCE */ } f.h = h; - f.locktype = NO_LOCK; - f.sharedLockByte = 0; #if OS_WINCE f.zDeleteOnClose = 0; #endif @@ -667,11 +665,8 @@ int sqlite3WinOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){ return SQLITE_CANTOPEN; } f.h = h; - f.locktype = NO_LOCK; - f.sharedLockByte = 0; #if OS_WINCE f.zDeleteOnClose = delFlag ? utf8ToUnicode(zFilename) : 0; - f.hMutex = NULL; #endif TRACE3("OPEN EX %d \"%s\"\n", h, zFilename); return allocateWinFile(&f, pId); @@ -717,11 +712,8 @@ int sqlite3WinOpenReadOnly(const char *zFilename, OsFile **pId){ return SQLITE_CANTOPEN; } f.h = h; - f.locktype = NO_LOCK; - f.sharedLockByte = 0; #if OS_WINCE f.zDeleteOnClose = 0; - f.hMutex = NULL; #endif TRACE3("OPEN RO %d \"%s\"\n", h, zFilename); return allocateWinFile(&f, pId); @@ -1308,7 +1300,13 @@ int allocateWinFile(winFile *pInit, OsFile **pId){ }else{ *pNew = *pInit; pNew->pMethod = &sqlite3WinIoMethod; + pNew->locktype = NO_LOCK; + pNew->sharedLockByte = 0; +#if OS_WINCE + pNew->hMutex = NULL; +#endif *pId = (OsFile*)pNew; + OpenCounter(+1); return SQLITE_OK; } } diff --git a/test/ioerr.test b/test/ioerr.test index 6764a2919e..e96dfd4a5b 100644 --- a/test/ioerr.test +++ b/test/ioerr.test @@ -15,7 +15,7 @@ # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: ioerr.test,v 1.23 2006/01/23 15:25:48 danielk1977 Exp $ +# $Id: ioerr.test,v 1.24 2006/01/23 16:25:22 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -204,26 +204,28 @@ do_ioerr_test ioerr-8 -tclprep { # For test coverage: Cause an IO error whilst reading the master-journal # name from a journal file. -do_ioerr_test ioerr-9 -tclprep { - execsql { - CREATE TABLE t1(a,b,c); - INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); - BEGIN; - INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); - } - copy_file test.db-journal test2.db-journal - execsql { - COMMIT; +if {$tcl_platform(platform)=="unix"} { + do_ioerr_test ioerr-9 -tclprep { + execsql { + CREATE TABLE t1(a,b,c); + INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); + BEGIN; + INSERT INTO t1 VALUES(randstr(200,200), randstr(1000,1000), 2); + } + copy_file test.db-journal test2.db-journal + execsql { + COMMIT; + } + copy_file test2.db-journal test.db-journal + set f [open test.db-journal a] + fconfigure $f -encoding binary + puts -nonewline $f "hello" + puts -nonewline $f "\x00\x00\x00\x05\x01\x02\x03\x04" + puts -nonewline $f "\xd9\xd5\x05\xf9\x20\xa1\x63\xd7" + close $f + } -sqlbody { + SELECT a FROM t1; } - copy_file test2.db-journal test.db-journal - set f [open test.db-journal a] - fconfigure $f -encoding binary - puts -nonewline $f "hello" - puts -nonewline $f "\x00\x00\x00\x05\x01\x02\x03\x04" - puts -nonewline $f "\xd9\xd5\x05\xf9\x20\xa1\x63\xd7" - close $f -} -sqlbody { - SELECT a FROM t1; } # For test coverage: Cause an IO error during statement playback (i.e.