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

Fix spurious errors that may occur if an empty database is opened and then initialized as a WAL database by a second connection.

FossilOrigin-Name: 16330a2f7262173a32ae48a72c0ee2522b6dc554
This commit is contained in:
dan
2012-02-28 17:57:34 +00:00
parent 4aced72a59
commit f602963dbc
5 changed files with 112 additions and 17 deletions

View File

@@ -2397,7 +2397,7 @@ int sqlite3WalRead(
iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE;
*pInWal = 1;
/* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */
return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset);
return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset);
}
*pInWal = 0;