mirror of https://github.com/sqlite/sqlite
Add testcase macros to ensure that large-file cases are tested in WAL.
FossilOrigin-Name: 8156b57ac33161ae6dd8a9413127ecce3c9eae83
This commit is contained in:
parent
60f9da7561
commit
3e8e7ecbc4
26
manifest
26
manifest
|
@ -1,5 +1,8 @@
|
|||
C Run\ssome\sfts3\stests\sas\spart\sof\sthe\s"wal"\spermutation.
|
||||
D 2010-07-07T11:43:00
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA1
|
||||
|
||||
C Add\stestcase\smacros\sto\sensure\sthat\slarge-file\scases\sare\stested\sin\sWAL.
|
||||
D 2010-07-07T13:43:19
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in c4270a1cd7cd70a263b7e96a258aa90e9c3618eb
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
|
@ -172,7 +175,7 @@ F src/select.c 4903ff1bbd08b55cbce00ea43c645530de41b362
|
|||
F src/shell.c fd4ccdb37c3b68de0623eb938a649e0990710714
|
||||
F src/sqlite.h.in 26bcfc3084a2e4b4debba311c59ae434820c8e98
|
||||
F src/sqlite3ext.h 69dfb8116af51b84a029cddb3b35062354270c89
|
||||
F src/sqliteInt.h 242987ebd2366ea36650a09cdab04a9163c62109
|
||||
F src/sqliteInt.h 72de24dfe07f452ac8a5c8c5eb1ce97ea6eff751
|
||||
F src/sqliteLimit.h 196e2f83c3b444c4548fc1874f52f84fdbda40f3
|
||||
F src/status.c 4df6fe7dce2d256130b905847c6c60055882bdbe
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
|
@ -226,7 +229,7 @@ F src/vdbeblob.c 258a6010ba7a82b72b327fb24c55790655689256
|
|||
F src/vdbemem.c 5e579abf6532001dfbee0e640dc34eae897a9807
|
||||
F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2
|
||||
F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda
|
||||
F src/wal.c 480c42c699b31dfa91e2b464f2a8d998d1def61e
|
||||
F src/wal.c ad263575206ffe8ed48d1407614354d4746d61bf
|
||||
F src/wal.h 906c85760598b18584921fe08008435aa4eeeeb2
|
||||
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
|
||||
F src/where.c 926c83c6394e132a1c62b6b12ceeba7d55a34c19
|
||||
|
@ -831,7 +834,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
P d9e3287900ae4aa7722ad0132bb8d6cd2755d3a6
|
||||
R 0ddb54b0814db4d6000bbba9d0ae3258
|
||||
U dan
|
||||
Z 186fcbf213dd1289853884df2490f207
|
||||
P 8657455a11d20dbf78247559670943a72541a09d
|
||||
R 5b2575fde5ab17ee5f094117e90d3426
|
||||
U drh
|
||||
Z 7ccf2025fd40e8aba2c7da7154bbcd44
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQFMNIR7oxKgR168RlERAkQPAJ9XXJ1y1kSaFlQZxEA2iMYW2lDrgACdFLMj
|
||||
nP/rGIBPD7YjnRDzUgfyo/A=
|
||||
=Xptt
|
||||
-----END PGP SIGNATURE-----
|
||||
|
|
|
@ -1 +1 @@
|
|||
8657455a11d20dbf78247559670943a72541a09d
|
||||
8156b57ac33161ae6dd8a9413127ecce3c9eae83
|
|
@ -272,6 +272,13 @@
|
|||
# define NEVER(X) (X)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Return true (non-zero) if the input is a integer that is too large
|
||||
** to fit in 32-bits. This macro is used inside of various testcase()
|
||||
** macros to verify that we have tested SQLite for large-file support.
|
||||
*/
|
||||
#define IS_BIG_INT(X) (((X)&(i64)0xffffffff)!=0)
|
||||
|
||||
/*
|
||||
** The macro unlikely() is a hint that surrounds a boolean
|
||||
** expression that is usually false. Macro likely() surrounds
|
||||
|
|
24
src/wal.c
24
src/wal.c
|
@ -1572,22 +1572,25 @@ static int walCheckpoint(
|
|||
|
||||
/* Iterate through the contents of the WAL, copying data to the db file. */
|
||||
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
|
||||
i64 iOffset;
|
||||
assert( walFramePgno(pWal, iFrame)==iDbpage );
|
||||
if( iFrame<=nBackfill || iFrame>mxSafeFrame ) continue;
|
||||
rc = sqlite3OsRead(pWal->pWalFd, zBuf, szPage,
|
||||
walFrameOffset(iFrame, szPage) + WAL_FRAME_HDRSIZE
|
||||
);
|
||||
if( rc==SQLITE_OK ){
|
||||
i64 iOffset = (i64)(iDbpage-1)*szPage;
|
||||
testcase( iOffset > (((i64)1)<<32) );
|
||||
rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);
|
||||
}
|
||||
iOffset = walFrameOffset(iFrame, szPage) + WAL_FRAME_HDRSIZE;
|
||||
/* testcase( IS_BIG_INT(iOffset) ); -- would require a 4GB WAL file */
|
||||
rc = sqlite3OsRead(pWal->pWalFd, zBuf, szPage, iOffset);
|
||||
if( rc!=SQLITE_OK ) break;
|
||||
iOffset = (iDbpage-1)*(i64)szPage;
|
||||
testcase( IS_BIG_INT(iOffset) );
|
||||
rc = sqlite3OsWrite(pWal->pDbFd, zBuf, szPage, iOffset);
|
||||
if( rc!=SQLITE_OK ) break;
|
||||
}
|
||||
|
||||
/* If work was actually accomplished... */
|
||||
if( rc==SQLITE_OK ){
|
||||
if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
|
||||
rc = sqlite3OsTruncate(pWal->pDbFd, ((i64)pWal->hdr.nPage*(i64)szPage));
|
||||
i64 szDb = pWal->hdr.nPage*(i64)szPage;
|
||||
testcase( IS_BIG_INT(szDb) );
|
||||
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
|
||||
if( rc==SQLITE_OK && sync_flags ){
|
||||
rc = sqlite3OsSync(pWal->pDbFd, sync_flags);
|
||||
}
|
||||
|
@ -2125,6 +2128,7 @@ int sqlite3WalRead(
|
|||
if( iRead ){
|
||||
i64 iOffset = walFrameOffset(iRead, pWal->hdr.szPage) + WAL_FRAME_HDRSIZE;
|
||||
*pInWal = 1;
|
||||
testcase( IS_BIG_INT(iOffset) );
|
||||
return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset);
|
||||
}
|
||||
|
||||
|
@ -2416,6 +2420,7 @@ int sqlite3WalFrames(
|
|||
void *pData;
|
||||
|
||||
iOffset = walFrameOffset(++iFrame, szPage);
|
||||
testcase( IS_BIG_INT(iOffset) );
|
||||
|
||||
/* Populate and write the frame header */
|
||||
nDbsize = (isCommit && p->pDirty==0) ? nTruncate : 0;
|
||||
|
@ -2455,6 +2460,7 @@ int sqlite3WalFrames(
|
|||
pData = pLast->pData;
|
||||
#endif
|
||||
walEncodeFrame(pWal, pLast->pgno, nTruncate, pData, aFrame);
|
||||
testcase( IS_BIG_INT(iOffset) );
|
||||
rc = sqlite3OsWrite(pWal->pWalFd, aFrame, sizeof(aFrame), iOffset);
|
||||
if( rc!=SQLITE_OK ){
|
||||
return rc;
|
||||
|
|
Loading…
Reference in New Issue