]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a second race condition in lock4.test. (CVS 4861)
authordanielk1977 <danielk1977@noemail.net>
Fri, 14 Mar 2008 08:57:41 +0000 (08:57 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Fri, 14 Mar 2008 08:57:41 +0000 (08:57 +0000)
FossilOrigin-Name: e62858b9b8a12ecbad8037868d03469d27418377

manifest
manifest.uuid
test/lock4.test

index a2638ea782939a6c754b87721ce29de322fd1637..8f8b9c6f9267363efed8b24983fa00c566305cdb 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Allow\sthe\stestfixture\sto\sbe\sbuilt\seven\swhen\susing\sthe\samalgamation\s(CVS\s4860)
-D 2008-03-14T04:11:03
+C Fix\sa\ssecond\srace\scondition\sin\slock4.test.\s(CVS\s4861)
+D 2008-03-14T08:57:42
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in 5be94fea84f1599672e5041de03b97990baca593
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -370,7 +370,7 @@ F test/loadext2.test 95ca7e2cb03fd3e068de97c3a2fe58dbdfd769e1
 F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1
 F test/lock2.test 018b846f6f3b3b695fad07e317b7988442b556f4
 F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
-F test/lock4.test 206ed8928d8ee090f547eabc11cb733b4f5df9b8
+F test/lock4.test 09d97d52cae18fadfe631552af9880dac6b3ae90
 F test/main.test 82c222989e02ea09abd58d453828ffd71806b6bf
 F test/malloc.test 7da6e318b030eef91a19bf6aca5555f927c92317
 F test/malloc2.test 6f2abc0617a7df210381272681d598488a3bf943
@@ -623,7 +623,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 2777ca788204c37ae5607f7acabe78f414255fa2
-R f16776db0cff304bef450ff1d0d825d3
-U mlcreech
-Z 1f7928f0ce2ed78d708ad783393a6c28
+P 8a726e3731cd19cc52c6dab16d032d7237b7450b
+R 4dcfb55457de268e049e3f884cf30fb9
+U danielk1977
+Z 77e13abccbb84eb815a0bdf10106a670
index af8445f93cd25063acee9e928bcc97e0329c8f4c..b6d32303e8276c83433d7490ab9137aaee6c6fdc 100644 (file)
@@ -1 +1 @@
-8a726e3731cd19cc52c6dab16d032d7237b7450b
\ No newline at end of file
+e62858b9b8a12ecbad8037868d03469d27418377
\ No newline at end of file
index eeffbe2b09c39e551b90a69e5b75cba5a713d805..dc8586f849f2e829c4912abae4179acbc0dc026d 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this script is database locks.
 #
-# $Id: lock4.test,v 1.7 2008/03/13 04:53:53 danielk1977 Exp $
+# $Id: lock4.test,v 1.8 2008/03/14 08:57:42 danielk1977 Exp $
 
 
 set testdir [file dirname $argv0]
@@ -49,6 +49,9 @@ do_test lock4-1.1 {
 #         to continue.
 #
 do_test lock4-1.2 {
+  # Create a script for the second process to run.
+  #
   set out [open test2-script.tcl w]
   puts $out "set sqlite_pending_byte [set sqlite_pending_byte]"
   puts $out {
@@ -67,14 +70,22 @@ do_test lock4-1.2 {
      exit
   }
   close $out
+
+  # Begin a transaction on test.db.
   db eval {
-     BEGIN;
+     BEGIN EXCLUSIVE;
      INSERT INTO t1 VALUES(1);
   }
+
+  # Kick off the second process.
   exec [info nameofexec] ./test2-script.tcl &
+
+  # Wait until the second process has started its transaction on test2.db.
   while {![file exists test2.db-journal]} {
     after 10
   }
+
+  # Try to write to test2.db. We are locked out.
   sqlite3 db2 test2.db
   catchsql {
     INSERT INTO t2 VALUES(1)
@@ -87,6 +98,10 @@ do_test lock4-1.3 {
   while {[file exists test2.db-journal]} {
     after 10
   }
+  # The other process has committed its transaction on test2.db by 
+  # deleting the journal file. But it might retain the lock for a 
+  # fraction longer 
+  #
   db2 eval {
      SELECT * FROM t2
   }