-C Create\slinks\sfrom\sbackup\sAPI\sdocumentation\sto\sthe\sbackup\sapplication\snote.\nComment\schanges\sonly\s-\sno\schanges\sto\scode.\s(CVS\s6275)
-D 2009-02-10T13:41:42
+C Prevent\scode\sin\stest6.c\sfrom\sreading\sthe\s512\sbyte\slocking\sregion\s(the\sPENDING_BYTE\spage)\sof\sa\sdatabase\sfile.\sDoing\sso\striggers\san\sassert\sfailure\sin\sos_unix.c.\s(CVS\s6276)
+D 2009-02-10T14:28:57
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c7a5a30fb6852bd7839b1024e1661da8549878ee
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/test3.c 88a246b56b824275300e6c899634fbac1dc94b14
F src/test4.c f79ab52d27ff49b784b631a42e2ccd52cfd5c84c
F src/test5.c 162a1cea2105a2c460a3f39fa6919617b562a288
-F src/test6.c 10025acfb5d978abc08b3ddbba8b2ce4dd6ca0c1
+F src/test6.c 86d7918ccc2ff92ceb71cb59c6a078105f8885d2
F src/test7.c b94e68c2236de76889d82b8d7d8e00ad6a4d80b1
F src/test8.c 3637439424d0d21ff2dcf9b015c30fcc1e7bcb24
F src/test9.c 904ebe0ed1472d6bad17a81e2ecbfc20017dc237
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P f6590dac4612d0d05105fa820e8fcb80b5907a40
-R d5f0d03566bc83fb0de348a58289fd37
-U drh
-Z f36b4865f8619c82038b33c67badf672
+P 85de23fb4e63e5c71480c4c34efec331e774d7fb
+R fc9b62f8eb9d21f86b7120b417d5c337
+U danielk1977
+Z 7d5d948a1e8d6b7ef2fab1a57b236f9f
** the effect on the database file of an OS crash or power failure. This
** is used to test the ability of SQLite to recover from those situations.
**
-** $Id: test6.c,v 1.41 2008/12/20 18:33:59 danielk1977 Exp $
+** $Id: test6.c,v 1.42 2009/02/10 14:28:57 danielk1977 Exp $
*/
#if SQLITE_TEST /* This file is used for testing only */
#include "sqliteInt.h"
pWrapper->nData = (4096 + pWrapper->iSize);
pWrapper->zData = crash_malloc(pWrapper->nData);
if( pWrapper->zData ){
+ /* os_unix.c contains an assert() that fails if the caller attempts
+ ** to read data from the 512-byte locking region of a file opened
+ ** with the SQLITE_OPEN_MAIN_DB flag. This region of a database file
+ ** never contains valid data anyhow. So avoid doing such a read here.
+ */
+ const int isDb = (flags&SQLITE_OPEN_MAIN_DB);
+ i64 iChunk = pWrapper->iSize;
+ if( iChunk>PENDING_BYTE && isDb ){
+ iChunk = PENDING_BYTE;
+ }
memset(pWrapper->zData, 0, pWrapper->nData);
- rc = sqlite3OsRead(pReal, pWrapper->zData, pWrapper->iSize, 0);
+ rc = sqlite3OsRead(pReal, pWrapper->zData, iChunk, 0);
+ if( SQLITE_OK==rc && pWrapper->iSize>(PENDING_BYTE+512) && isDb ){
+ i64 iOff = PENDING_BYTE+512;
+ iChunk = pWrapper->iSize - iOff;
+ rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], iChunk, iOff);
+ }
}else{
rc = SQLITE_NOMEM;
}