Change the async-IO extension to return SQLITE_IOERR_SHORT_READ when appropriate. This prevents a valgrind warning in the test suite.

FossilOrigin-Name: d9e3287900ae4aa7722ad0132bb8d6cd2755d3a6
This commit is contained in:
dan 2010-07-07 11:05:21 +00:00
parent bd0e9070e5
commit 78f1e53840
4 changed files with 18 additions and 9 deletions

View File

@ -667,7 +667,7 @@ static int asyncRead(
){
AsyncFileData *p = ((AsyncFile *)pFile)->pData;
int rc = SQLITE_OK;
sqlite3_int64 filesize;
sqlite3_int64 filesize = 0;
sqlite3_file *pBase = p->pBaseRead;
sqlite3_int64 iAmt64 = (sqlite3_int64)iAmt;
@ -706,6 +706,7 @@ static int asyncRead(
)){
sqlite3_int64 nCopy;
sqlite3_int64 nByte64 = (sqlite3_int64)pWrite->nByte;
filesize = MAX(filesize, pWrite->iOffset+nByte64);
/* Set variable iBeginIn to the offset in buffer pWrite->zBuf[] from
** which data should be copied. Set iBeginOut to the offset within
@ -728,6 +729,9 @@ static int asyncRead(
asyncread_out:
async_mutex_leave(ASYNC_MUTEX_QUEUE);
if( rc==SQLITE_OK && filesize<(iOffset+iAmt) ){
rc = SQLITE_IOERR_SHORT_READ;
}
return rc;
}

View File

@ -1,5 +1,5 @@
C Fix\sa\sproblem\swith\swriting\sto\sdatabases\slarger\sthan\s2^32\sbytes\swith\sWAL\smode.
D 2010-07-07T09:48:45
C Change\sthe\sasync-IO\sextension\sto\sreturn\sSQLITE_IOERR_SHORT_READ\swhen\sappropriate.\sThis\sprevents\sa\svalgrind\swarning\sin\sthe\stest\ssuite.
D 2010-07-07T11:05:22
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c4270a1cd7cd70a263b7e96a258aa90e9c3618eb
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -29,7 +29,7 @@ F doc/pager-invariants.txt 870107036470d7c419e93768676fae2f8749cf9e
F doc/vfs-shm.txt e101f27ea02a8387ce46a05be2b1a902a021d37a
F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1
F ext/async/README.txt 0c541f418b14b415212264cbaaf51c924ec62e5b
F ext/async/sqlite3async.c 676066c2a111a8b3107aeb59bdbbbf335c348f4a
F ext/async/sqlite3async.c ee69bf38c0ee9dca42708291e158bdbce31076cb
F ext/async/sqlite3async.h a21e1252deb14a2c211f0e165c4b9122a8f1f344
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
@ -535,7 +535,7 @@ F test/notify3.test 7eeba3628c4e707c004b72a2489c48fbdbc5c2ee
F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347
F test/null.test a8b09b8ed87852742343b33441a9240022108993
F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec
F test/pager1.test c3a0c973a5b5a5a21376957bdf963c3a3cae9a8b
F test/pager1.test 5352bec6768eec69dee75b97199d156dcb4a933c
F test/pager2.test f5c757c271ce642d36a393ecbfb3aef1c240dcef
F test/pagerfault.test 7d16f91a88e79c369d59b019615f3472297213f9
F test/pagerfault2.test 1f79ea40d1133b2683a2f811b00f2399f7ec2401
@ -831,7 +831,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 21a2db908b9eeb7477fc9d8b2b54482db93cd76f
R 81926a307a538e8a5e949c4942eae283
P b956ddca75d64ba662fa0b03b643822d836b6501
R 9c7c5b45d47b292d4af0a2f4d824ff05
U dan
Z 71f63fe0495bde120b5099f0d4f6deb4
Z fc49fd51a41c6fcdb8270c334db1cd62

View File

@ -1 +1 @@
b956ddca75d64ba662fa0b03b643822d836b6501
d9e3287900ae4aa7722ad0132bb8d6cd2755d3a6

View File

@ -348,6 +348,11 @@ foreach {tn sql tcl} {
PRAGMA integrity_check;
} {258 ok}
do_execsql_test pager1-3.$tn.6 {
SAVEPOINT one;
RELEASE one;
} {}
db close
catch { tv delete }
}