]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a couple of problems in test file test_journal.c that were causing segfaults...
authordanielk1977 <danielk1977@noemail.net>
Wed, 24 Dec 2008 09:30:22 +0000 (09:30 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 24 Dec 2008 09:30:22 +0000 (09:30 +0000)
FossilOrigin-Name: 416c9efb49ba207a9a79d06d0b13854695a8876c

manifest
manifest.uuid
src/test_journal.c

index a060a536f3281422ecf43991922232255b23cce2..c3ed2d74fbf94af23c813819bbc5781399c094e6 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Continuing\simprovements\sto\sthe\smulti-index\sOR-clause\soptimizer.\s\sAdded\sa\nfew\ssimple\stest\scases.\s(CVS\s6062)
-D 2008-12-23T23:56:22
+C Fix\sa\scouple\sof\sproblems\sin\stest\sfile\stest_journal.c\sthat\swere\scausing\ssegfaults\swhen\srunning\sall.test.\s(CVS\s6063)
+D 2008-12-24T09:30:22
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 77635d0909c2067cee03889a1e04ce910d8fb809
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -179,7 +179,7 @@ F src/test_config.c 4f85387a52f3c7966c3ffab913e988a3830fe1af
 F src/test_devsym.c 9f4bc2551e267ce7aeda195f3897d0f30c5228f4
 F src/test_func.c a55c4d5479ff2eb5c0a22d4d88e9528ab59c953b
 F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f
-F src/test_journal.c aec37656038150fa60f0418d54b1c535b5b33430
+F src/test_journal.c 3e1ff6dc251afadde009a791f863132cf861bda6
 F src/test_loadext.c 97dc8800e46a46ed002c2968572656f37e9c0dd9
 F src/test_malloc.c 5127337c9fb4c851a7f604c0170e0e5ca1fbfe33
 F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071
@@ -685,7 +685,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 26ceebf38e7ae7bbda3284995b03f829a2d2493f
-R 7db5298c8cbec76d68072c3747b105ad
-U drh
-Z 555ee7a0ef7229cf7451a3a18c0b778e
+P 55d4f493e7df8515574a75caec9967d6c71b6012
+R cc29a042a248eb8ecfc4c3d8c12a4a30
+U danielk1977
+Z f0704a3629730edd74463891e861aad2
index 161065fe898e39a8c50d767ad9242ae0592094a3..7a81e2eee566b0896fdd327585566655f8bd90d9 100644 (file)
@@ -1 +1 @@
-55d4f493e7df8515574a75caec9967d6c71b6012
\ No newline at end of file
+416c9efb49ba207a9a79d06d0b13854695a8876c
\ No newline at end of file
index aa29cbf9bd4e69dd567659b53de346fa29d95885..ba5a5cc91309db1e14716d7447e6310b99f64be1 100644 (file)
@@ -19,7 +19,7 @@
 **   b) the page was not a free-list leaf page when the transaction was
 **      first opened.
 **
-** $Id: test_journal.c,v 1.2 2008/12/22 10:58:46 danielk1977 Exp $
+** $Id: test_journal.c,v 1.3 2008/12/24 09:30:22 danielk1977 Exp $
 */
 #if SQLITE_TEST          /* This file is used for testing only */
 
@@ -327,7 +327,9 @@ static int readJournalFile(jt_file *p, jt_file *pMain){
       if( rc==SQLITE_OK ){
         pgno = decodeUint32(zBuf);
         iOff += (8 + pMain->nPagesize);
-        sqlite3BitvecSet(pMain->pWritable, pgno);
+        if( pgno>0 && pgno<=pMain->nPage ){
+          sqlite3BitvecSet(pMain->pWritable, pgno);
+        }
       }
     }
 
@@ -446,8 +448,10 @@ static int jtOpen(
   int rc;
   jt_file *p = (jt_file *)pFile;
   p->pReal = (sqlite3_file *)&p[1];
+  p->pReal->pMethods = 0;
   rc = sqlite3OsOpen(g.pVfs, zName, p->pReal, flags, pOutFlags);
-  if( p->pReal->pMethods ){
+  assert( rc==SQLITE_OK || p->pReal->pMethods==0 );
+  if( rc==SQLITE_OK ){
     pFile->pMethods = &jt_io_methods;
     p->eLock = 0;
     p->zName = zName;