1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Preliminary fix for ticket #2518. Make sure the VACUUM command

increments the change counter. (CVS 4163)

FossilOrigin-Name: 75263797e29af437290c09e85cd5fd2aea08694f
This commit is contained in:
drh
2007-07-19 16:35:17 +00:00
parent 21f06723fb
commit f85953edd0
4 changed files with 29 additions and 13 deletions

View File

@@ -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

View File

@@ -1 +1 @@
d1ae3de4613d36b5352eb852f1951a09d4a92ac1
75263797e29af437290c09e85cd5fd2aea08694f

View 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. */

View 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