]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Preliminary fix for ticket #2518. Make sure the VACUUM command
authordrh <drh@noemail.net>
Thu, 19 Jul 2007 16:35:17 +0000 (16:35 +0000)
committerdrh <drh@noemail.net>
Thu, 19 Jul 2007 16:35:17 +0000 (16:35 +0000)
increments the change counter. (CVS 4163)

FossilOrigin-Name: 75263797e29af437290c09e85cd5fd2aea08694f

manifest
manifest.uuid
src/pager.c
test/vacuum2.test

index 020a9e9e499288175bdaba0788a53146146f76af..50dec7ec24f5b0ceb34421ed9ea33b28167fd72a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Clarify\sthe\sdocumentation\son\sthe\snByte\sparameter\sto\ssqlite3_prepare().\nMake\sit\sclear\sthat\snByte\sis\sa\smaximum\sstring\slength.\s\sTicket\s#2516.\s(CVS\s4162)
-D 2007-07-19T12:41:40
+C Preliminary\sfix\sfor\sticket\s#2518.\s\sMake\ssure\sthe\sVACUUM\scommand\nincrements\sthe\schange\scounter.\s(CVS\s4163)
+D 2007-07-19T16:35:17
 F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -97,7 +97,7 @@ F src/os_unix.c 4099d05dc4b01997e80a289f3c6a220688e5cff5
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
 F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c 43e9bffb0ea6a76e06537790323c4a3e3a3a51cc
+F src/pager.c ce52bc1b1292d34848352cb74fa413f2e3114d88
 F src/pager.h 94110a5570dca30d54a883e880a3633b2e4c05ae
 F src/parse.y ad2ce25665be7f7303137f774a4e3e72e0d036ff
 F src/pragma.c 7914a6b9ea05f158800116dfcae11e52ab8e39c4
@@ -418,7 +418,7 @@ F test/update.test 7669ca789d62c258b678e8aa7a22a57eac10f2cf
 F test/utf16.test 20e2d9ba0d57e952a18b1ac8deab9ad49e082893
 F test/utf16align.test 7360e84472095518c56746f76b1f9d4dce99fb4d
 F test/vacuum.test cf839fc3ff24d601057319bbb5c700ce9c8e0fb0
-F test/vacuum2.test 5aea8c88a65cb29f7d175296e7c819c6158d838c
+F test/vacuum2.test e198d81a1cbc3f3f6b8aeee27cadfffea8995d42
 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
 F test/view.test 852bd4101e6d171c46ad682eb5c5faf662b2eba4
 F test/vtab1.test e740d4761b9125e6e541c62d199a3822f54614ff
@@ -518,7 +518,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P a80a3c9d0a5e0a8a3d67bd841e2076893fd5e9aa
-R d4afa784234874caf7b671e3a6ed87c3
+P d1ae3de4613d36b5352eb852f1951a09d4a92ac1
+R 9a4b118d719ada76faba19f60490117c
 U drh
-Z c86e52f36ab4239de550f9e1ef291098
+Z a495210a933458f9b08d076dceb8cb08
index 150502dd87a9815693addeaf535b2ce2d0106db0..20027043cf6647a3b33f8ad5edc0ce4770e5c4c1 100644 (file)
@@ -1 +1 @@
-d1ae3de4613d36b5352eb852f1951a09d4a92ac1
\ No newline at end of file
+75263797e29af437290c09e85cd5fd2aea08694f
\ No newline at end of file
index 47568a406ba7ed2a1559a6774d6942d370ec7d2e..dd41b93a2ae916c9d93e79b7443af29021dfc4c6 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.349 2007/06/26 22:10:12 drh Exp $
+** @(#) $Id: pager.c,v 1.350 2007/07/19 16:35:17 drh Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -3872,10 +3872,8 @@ static int pager_incr_changecounter(Pager *pPager){
     rc = sqlite3PagerWrite(pPgHdr);
     if( rc!=SQLITE_OK ) return rc;
   
-    /* Read the current value at byte 24. */
-    change_counter = retrieve32bits(pPgHdr, 24);
-  
     /* Increment the value just read and write it back to byte 24. */
+    change_counter = sqlite3Get4byte(pPager->dbFileVers);
     change_counter++;
     put32bits(((char*)PGHDR_TO_DATA(pPgHdr))+24, change_counter);
     /* Release the page reference. */
index 4b087cf76f713ca475f384c52b75382c584cab18..5a6aca77b83c1294fa50f27d2f393276fea251b6 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing the VACUUM statement.
 #
-# $Id: vacuum2.test,v 1.2 2006/01/16 16:24:25 danielk1977 Exp $
+# $Id: vacuum2.test,v 1.3 2007/07/19 16:35:17 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -39,4 +39,22 @@ do_test vacuum2-1.1 {
   }
 } {}
 
+# Ticket #2518.  Make sure vacuum increments the change counter
+# in the database header.
+#
+do_test vacuum2-2.1 {
+  execsql {
+    CREATE TABLE t1(x);
+    CREATE TABLE t2(y);
+    INSERT INTO t1 VALUES(1);
+  }
+  hexio_get_int [hexio_read test.db 24 4]
+} [expr {[hexio_get_int [hexio_read test.db 24 4]]+3}]
+do_test vacuum2-2.1 {
+  execsql {
+    VACUUM
+  }
+  hexio_get_int [hexio_read test.db 24 4]
+} [expr {[hexio_get_int [hexio_read test.db 24 4]]+1}]
+
 finish_test