-C Remove\san\sunnecessary\ssqlite3_bind_int64()\scall\sfrom\ssqlite3_blob_open().\nAlso\sother\sminor\srefactoring\sof\sthe\ssqlite3_blob\simplementation.
-D 2017-01-21T14:11:28.343
+C In\sthe\skvtest.c\stest\sutility,\sreuse\sthe\sbuffer\sinto\swhich\sblobs\sare\sread,\nrather\sthan\sreallocating\sit\sfor\seach\srow.\s\sThis\sis\sa\scloser\smatch\sto\show\nother\stest\sprograms\swork,\sand\sthus\sprovides\sa\sbetter\scomparison.
+D 2017-01-21T15:55:41.656
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
F test/json102.test bf3fe7a706d30936a76a0f7a0375e1e8e73aff5a
F test/json103.test c5f6b85e69de05f6b3195f9f9d5ce9cd179099a0
F test/keyword1.test 37ef6bba5d2ed5b07ecdd6810571de2956599dff
-F test/kvtest.c 371a2a0cb05840ed4a31c65c1d12a554c2fe556b
+F test/kvtest.c 9e428931f0733b5ba65b6b5abd95b27320e875a3
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
F test/like.test 0603f4fa0dad50987f70032c05800cbfa8985302
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 264e5c10d7144910b3223b64546567fa20e4bc65
-R 8ac11845f3680b4a63ed584c4ec0c997
+P 9d197a532349f4b1caf66bbed70ca46df86cb86f
+R 2ba22a751baba0a74113cf71f6292807
U drh
-Z e8ceb26091bad5772496cc1502eaca7e
+Z 28f64e9f53e7fb024862aee0e897381f
int nData = 0; /* Bytes of data */
sqlite3_int64 nTotal = 0; /* Total data read */
unsigned char *pData; /* Content of the blob */
+ int nAlloc = 0; /* Space allocated for pData[] */
assert( strcmp(argv[1],"run")==0 );
}
if( rc==SQLITE_OK ){
nData = sqlite3_blob_bytes(pBlob);
- pData = sqlite3_malloc( nData+1 );
+ if( nAlloc<nData+1 ){
+ nAlloc = nData+100;
+ pData = sqlite3_realloc(pData, nAlloc);
+ }
if( pData==0 ) fatalError("cannot allocate %d bytes", nData+1);
rc = sqlite3_blob_read(pBlob, pData, nData, 0);
if( rc!=SQLITE_OK ){
fatalError("could not read the blob at %d: %s", iKey,
sqlite3_errmsg(db));
}
- sqlite3_free(pData);
}
}else{
/* CASE 3: Reading from database using SQL */
nTotal += nData;
if( nData==0 ){ nCount++; nExtra++; }
}
+ if( nAlloc ) sqlite3_free(pData);
if( pStmt ) sqlite3_finalize(pStmt);
if( pBlob ) sqlite3_blob_close(pBlob);
if( bStats ){