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

Have the pager call xReiniter() instead of xDestructor() to restore btree level state after rolling back a page. (CVS 3828)

FossilOrigin-Name: 4e8941333ef053442877a2a696a2c68d403c7f4d
This commit is contained in:
danielk1977
2007-04-09 11:20:54 +00:00
parent e6895112fb
commit 9038bb647f
5 changed files with 24 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
C Work\saround\sbuggy\sTCL\simplementations\sin\sthe\sexclusive2\stest\sfile.\s\sTicket\s#2287\s(CVS\s3827) C Have\sthe\spager\scall\sxReiniter()\sinstead\sof\sxDestructor()\sto\srestore\sbtree\slevel\sstate\safter\srolling\sback\sa\spage.\s(CVS\s3828)
D 2007-04-08T16:52:22 D 2007-04-09T11:20:54
F Makefile.in 8cab54f7c9f5af8f22fd97ddf1ecfd1e1860de62 F Makefile.in 8cab54f7c9f5af8f22fd97ddf1ecfd1e1860de62
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -86,7 +86,7 @@ F src/os_unix.c 426b4c03c304ad78746d65d9ba101e0b72e18e23
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309 F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c d0bd990ade9062ec1884a4c4e138f464e18e9250 F src/pager.c 655073dd7b32eade2f10f69e1d51fece380d45e1
F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42 F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42
F src/parse.y b6cfbadb6d5b21b5087d30698ee5af0ebb098767 F src/parse.y b6cfbadb6d5b21b5087d30698ee5af0ebb098767
F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234 F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234
@@ -245,7 +245,7 @@ F test/insert4.test 0bb119fea2868afdcf78e4e3e3bfed27bbdb2430
F test/interrupt.test c38b7f7c17914f0cd6a119beed5d03bc3f47f9eb F test/interrupt.test c38b7f7c17914f0cd6a119beed5d03bc3f47f9eb
F test/intpkey.test af4fd826c4784ec5c93b444de07adea0254d0d30 F test/intpkey.test af4fd826c4784ec5c93b444de07adea0254d0d30
F test/ioerr.test 491d42c49bbec598966d26b01ed7901f55e5ee2d F test/ioerr.test 491d42c49bbec598966d26b01ed7901f55e5ee2d
F test/ioerr2.test 5f672f7f37a424bb1e02bee4fdedfa319a95da29 F test/ioerr2.test d37de99aa6e96ad55c3503b6365346e019c5ed6e
F test/join.test af0443185378b64878750aa1cf4b83c216f246b4 F test/join.test af0443185378b64878750aa1cf4b83c216f246b4
F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324 F test/join2.test f2171c265e57ee298a27e57e7051d22962f9f324
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0 F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
@@ -259,7 +259,7 @@ F test/limit.test 2a87b9cb2165abb49ca0ddcf5cb43cf24074581f
F test/loadext.test 9ab2cb0226329c1a62dd45d204be95158a872201 F test/loadext.test 9ab2cb0226329c1a62dd45d204be95158a872201
F test/loadext2.test 95ca7e2cb03fd3e068de97c3a2fe58dbdfd769e1 F test/loadext2.test 95ca7e2cb03fd3e068de97c3a2fe58dbdfd769e1
F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1 F test/lock.test 6825aea0b5885578b1b63a3b178803842c4ee9f1
F test/lock2.test d83ba79d3c4fffdb5b926c7d8ca7a36c34288a55 F test/lock2.test b95915eb4b6f8420acb30c68170d8f0ed9364efe
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9 F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
F test/lock4.test 49e22396b9be6e047b3d35469f233be79153c9d5 F test/lock4.test 49e22396b9be6e047b3d35469f233be79153c9d5
F test/main.test e7212ce1023957c7209778cc87fa932bd79ba89a F test/main.test e7212ce1023957c7209778cc87fa932bd79ba89a
@@ -455,7 +455,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 105a7efb090a5619e82a7e2931d4d3e080e6465a P 5424fcc5f82e864e0a85a71e0ae39209200386c6
R 08904a3aa0378c7ab8cc818bba8998f1 R 27ca5f36da384c7469144b8aa517ce6b
U drh U danielk1977
Z 677eb1d566591904a5e664d515483f3c Z dce029906fcde6f3be2aa17f46e3fa64

View File

@@ -1 +1 @@
5424fcc5f82e864e0a85a71e0ae39209200386c6 4e8941333ef053442877a2a696a2c68d403c7f4d

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** another is writing.
** **
** @(#) $Id: pager.c,v 1.325 2007/04/07 15:03:17 danielk1977 Exp $ ** @(#) $Id: pager.c,v 1.326 2007/04/09 11:20:54 danielk1977 Exp $
*/ */
#ifndef SQLITE_OMIT_DISKIO #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -1115,8 +1115,8 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
/* assert( pPg->nRef==0 || pPg->pgno==1 ); */ /* assert( pPg->nRef==0 || pPg->pgno==1 ); */
pData = PGHDR_TO_DATA(pPg); pData = PGHDR_TO_DATA(pPg);
memcpy(pData, aData, pPager->pageSize); memcpy(pData, aData, pPager->pageSize);
if( pPager->xDestructor ){ /*** FIX ME: Should this be xReinit? ***/ if( pPager->xReiniter ){
pPager->xDestructor(pPg, pPager->pageSize); pPager->xReiniter(pPg, pPager->pageSize);
} }
#ifdef SQLITE_CHECK_PAGES #ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg); pPg->pageHash = pager_pagehash(pPg);

View File

@@ -15,7 +15,7 @@
# The tests in this file use special facilities that are only # The tests in this file use special facilities that are only
# available in the SQLite test fixture. # available in the SQLite test fixture.
# #
# $Id: ioerr2.test,v 1.1 2007/04/02 16:46:23 danielk1977 Exp $ # $Id: ioerr2.test,v 1.2 2007/04/09 11:20:54 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@@ -51,7 +51,9 @@ proc check_db {testname} {
db close db close
sqlite3 db test.db sqlite3 db test.db
} else { } else {
if {$rc} {error $msg} if {$rc || $msg ne "ok"} {
error $msg
}
catch {execsql ROLLBACK} catch {execsql ROLLBACK}
} }
@@ -76,6 +78,7 @@ set sql {
ROLLBACK; ROLLBACK;
} }
breakpoint
foreach bPersist [list 0 1] { foreach bPersist [list 0 1] {
set ::go 1 set ::go 1
for {set ::N 1} {$::go} {incr ::N} { for {set ::N 1} {$::go} {incr ::N} {

View File

@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this script is database locks between competing processes. # focus of this script is database locks between competing processes.
# #
# $Id: lock2.test,v 1.6 2005/09/17 16:48:19 drh Exp $ # $Id: lock2.test,v 1.7 2007/04/09 11:20:54 danielk1977 Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@@ -22,7 +22,11 @@ source $testdir/tester.tcl
# 'testfixture' to execute a command. The child testfixture process is shut # 'testfixture' to execute a command. The child testfixture process is shut
# down by closing the channel. # down by closing the channel.
proc launch_testfixture {} { proc launch_testfixture {} {
set chan [open "|[file join . testfixture] tf_main.tcl" r+] set prg [info nameofexec]
if {$prg eq ""} {
set prg [file join . testfixture]
}
set chan [open "|$prg tf_main.tcl" r+]
fconfigure $chan -buffering line fconfigure $chan -buffering line
return $chan return $chan
} }