From: danielk1977 Date: Wed, 24 Sep 2008 14:03:43 +0000 (+0000) Subject: On windows, avoid running those tests in exclusive.test that require the journal... X-Git-Tag: version-3.6.10~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5dd3896982b6e18efee8a603efd4c8cda08168b;p=thirdparty%2Fsqlite.git On windows, avoid running those tests in exclusive.test that require the journal file to be externally accessed while SQLite is holding it open. This doesn't work on windows. (CVS 5742) FossilOrigin-Name: 5debf12fa46520946ac5da44c03448fffbc9940c --- diff --git a/manifest b/manifest index 7269c63652..3dbba4bc66 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sfile\sfts3_icu.c\sto\sthe\samalgamation.\sBecause\sof\sthe\sway\sheader\sfiles\sare\sincluded\sinto\ssqlite3.c,\sfts3_icu.c\shas\sto\sappear\safter\sall\sthe\sother\sfts3\sand\sicu\sextension\sfiles.\sTicket\s#3398.\s(CVS\s5741) -D 2008-09-24T09:58:01 +C On\swindows,\savoid\srunning\sthose\stests\sin\sexclusive.test\sthat\srequire\sthe\sjournal\sfile\sto\sbe\sexternally\saccessed\swhile\sSQLite\sis\sholding\sit\sopen.\sThis\sdoesn't\swork\son\swindows.\s(CVS\s5742) +D 2008-09-24T14:03:43 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in e4ab842f9a64ef61d57093539a8aab76b12810db F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -287,7 +287,7 @@ F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc2.test 6d91a5286f59add0cfcbb2d0da913b76f2242398 F test/enc3.test 5c550d59ff31dccdba5d1a02ae11c7047d77c041 F test/eval.test 020a21a236667bd4c56205d999c9992f1d944cac -F test/exclusive.test 5390ddf1f90a6d055111c0ebe6311045dd3035e1 +F test/exclusive.test 8d32ccf8eaf0260977dc8406bd70080ca2d7e6f8 F test/exclusive2.test 7d2b1c0370f1e1dac4a728bd653f2dea5100fcf6 F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7 F test/expr.test 135ed46c049916688171e618c5c14312811618d4 @@ -637,7 +637,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 0fb98c35353d8c0a8d669bbe45fe84e3a5060621 -R 859f2905b67a8bdd67aa2bb089a495b4 +P 0acca5842f83943228d4225b60dc7e8a42bae577 +R 9eb08ed19a8499580c1afb4ad41aa2b7 U danielk1977 -Z 71842990e6a257d104859b264ad9981c +Z 7daec82c5a8b96a531bdb9c3bccd5b3b diff --git a/manifest.uuid b/manifest.uuid index 83f667f172..bbb10a515e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0acca5842f83943228d4225b60dc7e8a42bae577 \ No newline at end of file +5debf12fa46520946ac5da44c03448fffbc9940c \ No newline at end of file diff --git a/test/exclusive.test b/test/exclusive.test index 599a29926c..91253d4afc 100644 --- a/test/exclusive.test +++ b/test/exclusive.test @@ -12,7 +12,7 @@ # of these tests is exclusive access mode (i.e. the thing activated by # "PRAGMA locking_mode = EXCLUSIVE"). # -# $Id: exclusive.test,v 1.8 2008/04/17 14:16:42 drh Exp $ +# $Id: exclusive.test,v 1.9 2008/09/24 14:03:43 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -257,58 +257,64 @@ db2 close # truncates instead of deletes the journal file when committing # a transaction. # -proc filestate {fname} { - set exists 0 - set content 0 - if {[file exists $fname]} { - set exists 1 - set hdr [hexio_read $fname 0 28] - set content \ - [expr {$hdr!="00000000000000000000000000000000000000000000000000000000"}] +# These tests are not run on windows because the windows backend +# opens the journal file for exclusive access, preventing its contents +# from being inspected externally. +# +if {$tcl_platform(platform) != "windows"} { + proc filestate {fname} { + set exists 0 + set content 0 + if {[file exists $fname]} { + set exists 1 + set hdr [hexio_read $fname 0 28] + set content \ + [expr {$hdr!="00000000000000000000000000000000000000000000000000000000"}] + } + list $exists $content } - list $exists $content + do_test exclusive-3.0 { + filestate test.db-journal + } {0 0} + do_test exclusive-3.1 { + execsql { + PRAGMA locking_mode = exclusive; + BEGIN; + DELETE FROM abc; + } + filestate test.db-journal + } {1 1} + do_test exclusive-3.2 { + execsql { + COMMIT; + } + filestate test.db-journal + } {1 0} + do_test exclusive-3.3 { + execsql { + INSERT INTO abc VALUES('A', 'B', 'C'); + SELECT * FROM abc; + } + } {A B C} + do_test exclusive-3.4 { + execsql { + BEGIN; + UPDATE abc SET a = 1, b = 2, c = 3; + ROLLBACK; + SELECT * FROM abc; + } + } {A B C} + do_test exclusive-3.5 { + filestate test.db-journal + } {1 0} + do_test exclusive-3.6 { + execsql { + PRAGMA locking_mode = normal; + SELECT * FROM abc; + } + filestate test.db-journal + } {0 0} } -do_test exclusive-3.0 { - filestate test.db-journal -} {0 0} -do_test exclusive-3.1 { - execsql { - PRAGMA locking_mode = exclusive; - BEGIN; - DELETE FROM abc; - } - filestate test.db-journal -} {1 1} -do_test exclusive-3.2 { - execsql { - COMMIT; - } - filestate test.db-journal -} {1 0} -do_test exclusive-3.3 { - execsql { - INSERT INTO abc VALUES('A', 'B', 'C'); - SELECT * FROM abc; - } -} {A B C} -do_test exclusive-3.4 { - execsql { - BEGIN; - UPDATE abc SET a = 1, b = 2, c = 3; - ROLLBACK; - SELECT * FROM abc; - } -} {A B C} -do_test exclusive-3.5 { - filestate test.db-journal -} {1 0} -do_test exclusive-3.6 { - execsql { - PRAGMA locking_mode = normal; - SELECT * FROM abc; - } - filestate test.db-journal -} {0 0} #---------------------------------------------------------------------- # Tests exclusive-4.X - test that rollback works correctly when