From: drh Date: Sat, 21 Jan 2017 15:55:41 +0000 (+0000) Subject: In the kvtest.c test utility, reuse the buffer into which blobs are read, X-Git-Tag: version-3.17.0~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=184d902db106be07a19bd0cdbf10fb2ec1bf89a3;p=thirdparty%2Fsqlite.git In the kvtest.c test utility, reuse the buffer into which blobs are read, rather than reallocating it for each row. This is a closer match to how other test programs work, and thus provides a better comparison. FossilOrigin-Name: 0d1ad13a296b22d6fe36879b56f99bd6af1acd3a --- diff --git a/manifest b/manifest index f0f41d4642..17270cb285 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -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 @@ -898,7 +898,7 @@ F test/json101.test c0897616f32d95431f37fd291cb78742181980ac 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 @@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 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 diff --git a/manifest.uuid b/manifest.uuid index ca6ba2e6ad..1b9ab055af 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9d197a532349f4b1caf66bbed70ca46df86cb86f \ No newline at end of file +0d1ad13a296b22d6fe36879b56f99bd6af1acd3a \ No newline at end of file diff --git a/test/kvtest.c b/test/kvtest.c index 2e997287e8..d895af030f 100644 --- a/test/kvtest.c +++ b/test/kvtest.c @@ -516,6 +516,7 @@ static int runMain(int argc, char **argv){ 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 ); @@ -621,14 +622,16 @@ static int runMain(int argc, char **argv){ } if( rc==SQLITE_OK ){ nData = sqlite3_blob_bytes(pBlob); - pData = sqlite3_malloc( nData+1 ); + if( nAlloc