]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add an English language error message to corresponding to SQLITE_PROTOCOL. "locking...
authordan <dan@noemail.net>
Fri, 4 Jun 2010 15:59:58 +0000 (15:59 +0000)
committerdan <dan@noemail.net>
Fri, 4 Jun 2010 15:59:58 +0000 (15:59 +0000)
FossilOrigin-Name: ca327e32cfe1633f2c9d3f058e411f108aaa2b3c

manifest
manifest.uuid
src/main.c
test/wal3.test

index f409fad5005e586ed1444aacb1fdc18143d4a6c0..0bdced36782685ac33372b00cfe44413fe7a1de2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\stest\sfor\sthe\scode\sthat\sdetects\san\sinconsistent\spair\sof\swal-index\sheaders\sto\swal2.test.
-D 2010-06-04T12:22:35
+C Add\san\sEnglish\slanguage\serror\smessage\sto\scorresponding\sto\sSQLITE_PROTOCOL.\s"locking\sprotocol".
+D 2010-06-04T15:59:59
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -133,7 +133,7 @@ F src/journal.c b0ea6b70b532961118ab70301c00a33089f9315c
 F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
 F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
 F src/loadext.c 1c7a61ce1281041f437333f366a96aa0d29bb581
-F src/main.c 34d9fc068b331e7d13206c26490c42f90c83d893
+F src/main.c 0939e4b49e5b7e2dc0669bc3ac98963e1b599996
 F src/malloc.c a08f16d134f0bfab6b20c3cd142ebf3e58235a6a
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
 F src/mem1.c 89d4ea8d5cdd55635cbaa48ad53132af6294cbb2
@@ -763,7 +763,7 @@ F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
 F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
 F test/wal.test bfec61450b47cdf09f7d2269f9e9967683b8b0fc
 F test/wal2.test c90d20363f17373cbf5bdfcee3571b43e8fa597b
-F test/wal3.test a4b46d20010613e56c8fbb401bc0b370ff838b34
+F test/wal3.test 5436fdc7fc835d78a7e39ca863dee99b02965e8e
 F test/wal_common.tcl 3e953ae60919281688ea73e4d0aa0e1bc94becd9
 F test/walbak.test e7650a26eb4b8abeca9b145b1af1e63026dde432
 F test/walcksum.test 4efa8fb88c32bed8288ea4385a9cc113a5c8f0bf
@@ -817,7 +817,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P b813233d7604a5fd91e1af91d5d812032eec700a
-R 1e5bd682c632ede77eea9d55939c1701
+P 157feba10f7ac01eecf79715c44bb16c98958280
+R 4b9fd9c8da46e38cbcd3302995ecbb78
 U dan
-Z e80075d9a3d96ac30cbd1496fdd7f512
+Z 8c3b48407d3b3e089791e93b7d98c5de
index 6c95a79417697bf7f3a4905e40f4b7aa083b69a1..b1cb9ac3370bd4c0f67d51fd436ccc77c30715cc 100644 (file)
@@ -1 +1 @@
-157feba10f7ac01eecf79715c44bb16c98958280
\ No newline at end of file
+ca327e32cfe1633f2c9d3f058e411f108aaa2b3c
\ No newline at end of file
index 5b715a12d00e804f92326e7a1db08e8a371b9155..45a486c48c2bc1d19507824a2f8a8dd306c854c3 100644 (file)
@@ -776,7 +776,7 @@ const char *sqlite3ErrStr(int rc){
     /* SQLITE_NOTFOUND    */ 0,
     /* SQLITE_FULL        */ "database or disk is full",
     /* SQLITE_CANTOPEN    */ "unable to open database file",
-    /* SQLITE_PROTOCOL    */ 0,
+    /* SQLITE_PROTOCOL    */ "locking protocol",
     /* SQLITE_EMPTY       */ "table contains no data",
     /* SQLITE_SCHEMA      */ "database schema has changed",
     /* SQLITE_TOOBIG      */ "string or blob too big",
index 62916013246f2f86d29fba0ca584ddc77e254ef1..ccd8f5b9112ad08aed2ca0c3ada2b9c8d07012cb 100644 (file)
@@ -258,6 +258,52 @@ foreach {tn syncmode synccount} {
   T delete
 }
 
+#-------------------------------------------------------------------------
+# When recovering the contents of a WAL file, a process obtains the WRITER
+# lock, then locks all other bytes before commencing recovery. If it fails
+# to lock all other bytes (because some other process is holding a read
+# lock) it should return SQLITE_BUSY to the caller. Test this.
+# 
+proc lock_callback {method filename handle lock} {
+  lappend ::locks $lock
+}
+do_test wal3-4.1 {
+  testvfs T
+  T filter xShmLock 
+  T script lock_callback
+  set ::locks [list]
+  sqlite3 db test.db -vfs T
+  execsql { SELECT * FROM x }
+  lrange $::locks 0 3
+} [list {0 1 lock exclusive} {1 7 lock exclusive}      \
+        {1 7 unlock exclusive} {0 1 unlock exclusive}  \
+]
+do_test wal3-4.2 {
+  db close
+  set ::locks [list]
+  sqlite3 db test.db -vfs T
+  execsql { SELECT * FROM x }
+  lrange $::locks 0 3
+} [list {0 1 lock exclusive} {1 7 lock exclusive}      \
+        {1 7 unlock exclusive} {0 1 unlock exclusive}  \
+]
+proc lock_callback {method filename handle lock} {
+  if {$lock == "1 7 lock exclusive"} { return SQLITE_BUSY }
+  return SQLITE_OK
+}
+puts "  Warning: This next test case causes SQLite to call xSleep(1) 100 times."
+puts "  Normally this equates to a 100ms delay, but if SQLite is built on unix"
+puts "  without HAVE_USLEEP defined, it may be 100 seconds."
+do_test wal3-4.3 {
+  db close
+  set ::locks [list]
+  sqlite3 db test.db -vfs T
+  catchsql { SELECT * FROM x }
+} {1 {locking protocol}}
+
+db close
+T delete
+
 finish_test