-C Fix\scases\swhere\sxRead()\swas\sbeing\sused\sto\sread\sfrom\sa\smemory\smapped\spart\sof\sthe\sdatabase\sfile.
-D 2013-03-21T20:39:55.225
+C Add\sassert\sstatements\sto\sos_unix.c\sto\sensure\sthat\sany\smapped\sregion\sof\sthe\sdatabase\sfile\sis\snot\sbeing\sread\sor\swritten\susing\sthe\sxRead()\sor\sxWrite()\smethods.
+D 2013-03-22T08:58:38.319
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 9a804abbd3cae82d196e4d33aba13239e32522a5
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/os.c 87ea1cd1259c5840848e34007d72e772a2ab7528
F src/os.h 8d92f87f5fe14b060a853ca704b8ef6d3daee79b
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
-F src/os_unix.c be66c31337361a72227638d6f41c7f2031739642
+F src/os_unix.c 18153e6fc03580e95d28fb39d47a4e8b64b36187
F src/os_win.c f7da4dc0a2545c0a430080380809946ae4d676d6
F src/pager.c 520001015155efee9599c807dfd38e5fff9c6e36
F src/pager.h 241d72dc0905df042da165f086d03505cb0bb50c
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P c8eac290a7240d69494bd0dad5ed1fdc2505f703
-R 0cdb7517bc23cd336050741c62097e56
+P 5c9e9df27b9f2c46cd55388a858d4e78ee564975
+R eb2eb83f96de836951dbdb14158ccee8
U dan
-Z 0dd43854f08b06a022f11b1a174cdf13
+Z 42c0bd3cd106c51e7465866daa07e0a3
unsigned char transCntrChng; /* True if the transaction counter changed */
unsigned char dbUpdate; /* True if any part of database file changed */
unsigned char inNormalWrite; /* True if in a normal write operation */
+ sqlite3_int64 mmapSize; /* Size of xMremap() */
+ void *pMapRegion; /* Area memory mapped */
#endif
#ifdef SQLITE_TEST
/* In test mode, increase the size of this structure a bit so that
unixFile *pFile = (unixFile *)id;
int got;
assert( id );
+ assert( offset>=pFile->mmapSize ); /* Never read from the mmapped region */
/* If this is a database file (not a journal, master-journal or temp
** file), the bytes in the locking range should never be read or written. */
int wrote = 0;
assert( id );
assert( amt>0 );
+ assert( offset>=pFile->mmapSize ); /* Never write into the mmapped region */
/* If this is a database file (not a journal, master-journal or temp
** file), the bytes in the locking range should never be read or written. */
i64 nOldRnd; /* nOld rounded up */
assert( iOff==0 );
+ assert( p->mmapSize==nOld );
+ assert( p->pMapRegion==0 || p->pMapRegion==(*ppMap) );
/* If the SQLITE_MREMAP_EXTEND flag is set, then the size of the requested
** mapping (nNew bytes) may be greater than the size of the database file.
/* On OSX or Linux, reuse the old mapping if it is the right size. */
#if defined(__APPLE__) || defined(__linux__)
if( nNewRnd==nOldRnd ){
+ VVA_ONLY( p->mmapSize = nNew; )
return SQLITE_OK;
}
#endif
if( nOldRnd!=0 ){
void *pOld = *ppMap;
munmap(pOld, nOldRnd);
+ VVA_ONLY( p->mmapSize = 0; p->pMapRegion = 0; );
}
/* And, if required, use mmap() to create a new mapping. */
pNew = mmap(0, nNewRnd, flags, MAP_SHARED, p->h, iOff);
if( pNew==MAP_FAILED ){
pNew = 0;
+ VVA_ONLY( p->mmapSize = 0; p->pMapRegion = 0; )
rc = SQLITE_IOERR_MREMAP;
+ }else{
+ VVA_ONLY( p->mmapSize = nNew; p->pMapRegion = pNew; )
}
}
pNew->pVfs = pVfs;
pNew->zPath = zFilename;
pNew->ctrlFlags = (u8)ctrlFlags;
+ VVA_ONLY( pNew->mmapSize = 0; )
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0),
"psow", SQLITE_POWERSAFE_OVERWRITE) ){
pNew->ctrlFlags |= UNIXFILE_PSOW;