]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add another test for [2d1a5c67df].
authordan <dan@noemail.net>
Thu, 19 May 2011 07:53:23 +0000 (07:53 +0000)
committerdan <dan@noemail.net>
Thu, 19 May 2011 07:53:23 +0000 (07:53 +0000)
FossilOrigin-Name: 97fcd9e88891abd44037004e47862bcecfa1b0c9

manifest
manifest.uuid
test/tkt-2d1a5c67d.test

index a2fbca16d75c5e183155053362fe3d233bd31a7e..661fb78b3c2586a7267b7df54b5ed1fee9cb706d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C When\scommitting\sa\sWAL\stransaction,\smake\ssure\sat\sleast\sone\spage\sis\nwritten\sto\sthe\sWAL\sfile\sso\sthat\sthe\sWAL\ssubsystem\swill\shave\sa\spage\non\swhich\sto\sset\sthe\scommit\sflag.\nTicket\s[2d1a5c67dfc236].
-D 2011-05-19T01:21:42.431
+C Add\sanother\stest\sfor\s[2d1a5c67df].
+D 2011-05-19T07:53:23.122
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -705,7 +705,7 @@ F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
 F test/threadtest3.c 0ed13e09690f6204d7455fac3b0e8ece490f6eef
 F test/tkt-02a8e81d44.test 58494de77be2cf249228ada3f313fa399821c6ab
 F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
-F test/tkt-2d1a5c67d.test 39d2368072315923021700a216379fcf23ac3a5c
+F test/tkt-2d1a5c67d.test 450b3cf86ca9a3b1fd0a9e136978142be3bff7e0
 F test/tkt-2ea2425d34.test 1cf13e6f75d149b3209a0cb32927a82d3d79fb28
 F test/tkt-31338dca7e.test 5741cd48de500347a437ba1be58c8335e83c5a5e
 F test/tkt-313723c356.test c47f8a9330523e6f35698bf4489bcb29609b53ac
@@ -938,7 +938,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P de58cb28387f44c35b1a81bdab853cafd938c1a6
-R e623b89a5e0b9474dd0884ecf24382fc
-U drh
-Z 83669a82fd950b01af57955dbca1c918
+P 67bf1c9a888b0d84d252d6c4c754c2c51994d208
+R 84c84662daf4fcfa430ab94eb0e5302f
+U dan
+Z b2a115bcb644bb929ad33751c5f52805
index ad5e5387847228a7588ff6dc44d9333d51ca5ca9..f2ab280f7f8ad6b971974bce7f903ead36285285 100644 (file)
@@ -1 +1 @@
-67bf1c9a888b0d84d252d6c4c754c2c51994d208
\ No newline at end of file
+97fcd9e88891abd44037004e47862bcecfa1b0c9
\ No newline at end of file
index 676e60b0571cabbbc68f137cdaa066b221eddbab..5db364bd795cc7eb1cde51c8762dad8559cd50b5 100644 (file)
@@ -17,6 +17,7 @@
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
+set testprefix tkt-2d1a5c67d
 
 ifcapable !wal {finish_test; return}
 
@@ -70,4 +71,57 @@ for {set ii 1} {$ii<=10} {incr ii} {
   } {1000000 1 2}
 }
 
+db close
+sqlite3 db test.db
+
+
+do_execsql_test 3.1 {
+  PRAGMA cache_size = 10;
+  CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
+  CREATE TABLE t4(a);
+}
+
+do_execsql_test 3.2 {
+  INSERT INTO t3 VALUES(NULL, randomblob(500));
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 2
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 4
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 8
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 16
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 32
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 64
+  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 128
+}
+
+do_execsql_test 3.3 {
+  BEGIN;
+    INSERT INTO t4 VALUES('xyz');
+}
+
+do_test 3.4 {
+  set blobs [list]
+  for {set i 1} {$i<100} {incr i} {
+    set b [db incrblob -readonly t3 b $i]
+    read $b
+    lappend blobs $b
+  }
+
+  execsql COMMIT
+  execsql { SELECT * FROM t4 WHERE a = 'xyz' }
+} {xyz}
+
+do_test 3.5 {
+  foreach b $blobs { close $b }
+  execsql { SELECT * FROM t4 WHERE a = 'xyz' }
+} {xyz}
+
+# Check that recovery works on the WAL file.
+#
+forcedelete test.db2-wal test.db2
+do_test 3.6 {
+  file copy test.db-wal test.db2-wal
+  file copy test.db test.db2
+  sqlite3 db2 test.db2
+  execsql { SELECT * FROM t4 WHERE a = 'xyz' } db2
+} {xyz}
+
 finish_test