From: drh Date: Thu, 12 Jun 2008 18:17:40 +0000 (+0000) Subject: Enhance zeroblob tests to use the sqlite3_memory_highwater in order to X-Git-Tag: version-3.6.10~960 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=655194d6ae6f8fde6184ce5e9d7b0a1965cb4973;p=thirdparty%2Fsqlite.git Enhance zeroblob tests to use the sqlite3_memory_highwater in order to double-check that no large allocations are occurring. (CVS 5217) FossilOrigin-Name: e93079be83a9df7328d9b910fcbdb762be7ec815 --- diff --git a/manifest b/manifest index a6a483dbe3..c1c0f29608 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\stypo\sin\sthe\sdate/time\sfunction\stests.\s\sAdd\sadditional\scases\sto\nthe\szeroblob\stests\sto\smake\ssure\ssqlite3_bind_zeroblob()\sdoes\snot\suse\nexcess\smemory.\s(CVS\s5216) -D 2008-06-12T18:05:40 +C Enhance\szeroblob\stests\sto\suse\sthe\ssqlite3_memory_highwater\sin\sorder\sto\ndouble-check\sthat\sno\slarge\sallocations\sare\soccurring.\s(CVS\s5217) +D 2008-06-12T18:17:40 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in ce92ea8dc7adfb743757794f51c10d1b0d9c55e4 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -568,7 +568,7 @@ F test/where3.test 97d3936e6a443b968f1a61cdcc0f673252000e94 F test/where4.test e9b9e2f2f98f00379e6031db6a6fca29bae782a2 F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2 F test/where6.test 42c4373595f4409d9c6a9987b4a60000ad664faf -F test/zeroblob.test 2f4f8c80d4fc63fe74ba51f63028ea432f37445a +F test/zeroblob.test 92c3e7dabd2a5ceabc305f7ff5f4441a913366ca F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/lemon.c a9c51c1ede7f35dc8746894e7f8cc7e3704ecef8 @@ -593,7 +593,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P ed35f8a98323dadb64b423615287fb24ea262ffb -R 6d3a5f7e9e66d13c1835b9bd637681e5 +P c1006fb1c817bc0b7fada873edb772abbf972012 +R dc9288951ccf4af2026b613e380c37a1 U drh -Z ad27c56d832bced711a43dcd785d84f4 +Z a943c68dc8f656dcf324d2907bc83041 diff --git a/manifest.uuid b/manifest.uuid index a0153d7e7a..9a4fe9d607 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c1006fb1c817bc0b7fada873edb772abbf972012 \ No newline at end of file +e93079be83a9df7328d9b910fcbdb762be7ec815 \ No newline at end of file diff --git a/test/zeroblob.test b/test/zeroblob.test index 0e1271e12b..361df94860 100644 --- a/test/zeroblob.test +++ b/test/zeroblob.test @@ -13,7 +13,7 @@ # including the sqlite3_bind_zeroblob(), sqlite3_result_zeroblob(), # and the built-in zeroblob() SQL function. # -# $Id: zeroblob.test,v 1.11 2008/06/12 18:05:40 drh Exp $ +# $Id: zeroblob.test,v 1.12 2008/06/12 18:17:40 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -27,21 +27,28 @@ ifcapable !incrblob { # content of the zeroblob is never instantiated on the VDBE stack. # But it does get inserted into the database correctly. # +db eval {PRAGMA cache_size=10} +sqlite3_memory_highwater +unset -nocomplain memused +set memused [sqlite3_memory_used] do_test zeroblob-1.1 { execsql { CREATE TABLE t1(a,b,c,d); } set ::sqlite3_max_blobsize 0 execsql { - INSERT INTO t1 VALUES(2,3,4,zeroblob(10000)); + INSERT INTO t1 VALUES(2,3,4,zeroblob(1000000)); } set ::sqlite3_max_blobsize } {10} +do_test zeroblob-1.1.1 { + expr {[sqlite3_memory_highwater]<$::memused+25000} +} {1} do_test zeroblob-1.2 { execsql { SELECT length(d) FROM t1 } -} {10000} +} {1000000} # If a non-NULL column follows the zeroblob, then the content of # the zeroblob must be instantiated. @@ -57,7 +64,7 @@ do_test zeroblob-1.4 { execsql { SELECT length(c), length(d) FROM t1 } -} {1 10000 10000 1} +} {1 1000000 10000 1} # Multiple zeroblobs can appear at the end of record. No instantiation # of the blob content occurs on the stack. @@ -73,7 +80,7 @@ do_test zeroblob-1.6 { execsql { SELECT length(c), length(d) FROM t1 } -} {1 10000 10000 1 10000 10000} +} {1 1000000 10000 1 10000 10000} # NULLs can follow the zeroblob() or be intermixed with zeroblobs and # no instantiation of the zeroblobs occurs on the stack.