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

Change the name of PAGER_SECTOR_SIZE to SQLITE_DEFAULT_SECTOR_SIZE. Make

the new OS-layer interface routine for finding sector size optional. (CVS 3750)

FossilOrigin-Name: 0fb9af1d6e20bf25511c6d2097937cc11137776e
This commit is contained in:
drh
2007-03-29 18:19:52 +00:00
parent 2ecad3b443
commit 3ceeb75680
8 changed files with 26 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
C Make\ssure\sthe\sstrftime()\sdate\sconversions\sput\sin\sleading\szeros\scorrectly.\nTicket\s#2276.\s(CVS\s3749) C Change\sthe\sname\sof\sPAGER_SECTOR_SIZE\sto\sSQLITE_DEFAULT_SECTOR_SIZE.\s\sMake\nthe\snew\sOS-layer\sinterface\sroutine\sfor\sfinding\ssector\ssize\soptional.\s(CVS\s3750)
D 2007-03-29T17:57:21 D 2007-03-29T18:19:52
F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530 F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -75,18 +75,18 @@ F src/legacy.c 2631df6a861f830d6b1c0fe92b9fdd745b2c0cd6
F src/loadext.c c186ad5c9e8a0aaa73d0caf5f604d112e45e8b89 F src/loadext.c c186ad5c9e8a0aaa73d0caf5f604d112e45e8b89
F src/main.c 3ca92e8f2397da413c39f5a102e5675f5c5fa78a F src/main.c 3ca92e8f2397da413c39f5a102e5675f5c5fa78a
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
F src/os.c 6df3e9c23eaa982d3e66ef770ad2519de5dd4d97 F src/os.c 5a194b9b9a10dc66543d4ca22bc0db40c5cc5ef1
F src/os.h ec780b3561d0bb887d13f193a1a889872c44a236 F src/os.h 506acdfd0a63802434ceacdbfd7c006e5d90fc53
F src/os_common.h c86e8cbd6150ca06d46b09ec02ff5fc5d4b05285 F src/os_common.h c86e8cbd6150ca06d46b09ec02ff5fc5d4b05285
F src/os_os2.c cb2c4f6d28810b5cee682d8df92352464d5c9d95 F src/os_os2.c 313ece302183dfd83c4f281e1972656b7e6b672e
F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3
F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
F src/os_unix.c 0d91b28d57c0885fe97fb9020fd1091578066b5b F src/os_unix.c 5f7ee6c930084bcae48fd2caf4f73011d2c0795b
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c 84c02837a6ec216a07e83a1d10d5a01c417bb489 F src/os_win.c d6cb36287a13a75cbf0b7084399c7884a96c4340
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c 9a6eefc192e3922c27bc0b18914b45dc9c348ffb F src/pager.c b89ea0f592e499ee6d6cda10b84688f8e47a05ba
F src/pager.h f1b17bf848b3dce5d9afb2701186d3c9a8826f8c F src/pager.h f1b17bf848b3dce5d9afb2701186d3c9a8826f8c
F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3 F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3
F src/pragma.c 9cb8b94e7d38ba35a86037bd517d07ba9870b4b2 F src/pragma.c 9cb8b94e7d38ba35a86037bd517d07ba9870b4b2
@@ -446,7 +446,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 e746832f5f3e1c58e6f6456866156824d23dd846 P e853067ec4db3eedfb4adcdd4172de2c55b9ac58
R b1788f4ccc3dadea73c4b05cf92a2f56 R c174f33cfef400e7eb98f05642ec2e46
U drh U drh
Z 5aae4929118467f5ff5f8ba730683d13 Z 0685979faafd6228f2942fefc0f3e17a

View File

@@ -1 +1 @@
e853067ec4db3eedfb4adcdd4172de2c55b9ac58 0fb9af1d6e20bf25511c6d2097937cc11137776e

View File

@@ -76,7 +76,8 @@ int sqlite3OsCheckReservedLock(OsFile *id){
return id->pMethod->xCheckReservedLock(id); return id->pMethod->xCheckReservedLock(id);
} }
int sqlite3OsSectorSize(OsFile *id){ int sqlite3OsSectorSize(OsFile *id){
return id->pMethod->xSectorSize(id); int (*xSectorSize)(OsFile*) = id->pMethod->xSectorSize;
return xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE;
} }
#ifdef SQLITE_ENABLE_REDEF_IO #ifdef SQLITE_ENABLE_REDEF_IO

View File

@@ -73,6 +73,13 @@
# define SET_FULLSYNC(x,y) # define SET_FULLSYNC(x,y)
#endif #endif
/*
** The default size of a disk sector
*/
#ifndef SQLITE_DEFAULT_SECTOR_SIZE
# define SQLITE_DEFAULT_SECTOR_SIZE 512
#endif
/* /*
** Temporary files are named starting with this prefix followed by 16 random ** Temporary files are named starting with this prefix followed by 16 random
** alphanumeric characters, and no file extension. They are stored in the ** alphanumeric characters, and no file extension. They are stored in the

View File

@@ -743,7 +743,7 @@ static int os2LockState( OsFile *id ){
** same for both. ** same for both.
*/ */
static int os2SectorSize(OsFile *id){ static int os2SectorSize(OsFile *id){
return PAGER_SECTOR_SIZE; return SQLITE_DEFAULT_SECTOR_SIZE;
} }
/* /*

View File

@@ -2353,7 +2353,7 @@ static int unixLockState(OsFile *id){
** same for both. ** same for both.
*/ */
static int unixSectorSize(OsFile *id){ static int unixSectorSize(OsFile *id){
return PAGER_SECTOR_SIZE; return SQLITE_DEFAULT_SECTOR_SIZE;
} }
/* /*

View File

@@ -1466,7 +1466,7 @@ static int winLockState(OsFile *id){
** same for both. ** same for both.
*/ */
static int winSectorSize(OsFile *id){ static int winSectorSize(OsFile *id){
return PAGER_SECTOR_SIZE; return SQLITE_DEFAULT_SECTOR_SIZE;
} }
/* /*

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.305 2007/03/29 17:28:15 danielk1977 Exp $ ** @(#) $Id: pager.c,v 1.306 2007/03/29 18:19:52 drh Exp $
*/ */
#ifndef SQLITE_OMIT_DISKIO #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -1436,7 +1436,7 @@ end_playback:
} }
/* The Pager.sectorSize variable may have been updated while rolling /* The Pager.sectorSize variable may have been updated while rolling
** back a journal created by a process with a different PAGER_SECTOR_SIZE ** back a journal created by a process with a different sector size
** value. Reset it to the correct value for this process. ** value. Reset it to the correct value for this process.
*/ */
pPager->sectorSize = sqlite3OsSectorSize(pPager->fd); pPager->sectorSize = sqlite3OsSectorSize(pPager->fd);