From: drh Date: Wed, 22 Apr 2020 13:49:25 +0000 (+0000) Subject: Fix an off-by-one error in the "calculated" page count output from the X-Git-Tag: version-3.32.0~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=542bd6521e91c49e663123848e5898cd5632d097;p=thirdparty%2Fsqlite.git Fix an off-by-one error in the "calculated" page count output from the sqlite3_analyzer utility for databases that are more than 1GB in size. FossilOrigin-Name: 8789368b91fb5b7477bdba3a953412fc3839b4894443b65186f7b8f79f6369c9 --- diff --git a/manifest b/manifest index 08a28b321b..2c6424a0a5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\sinteger\soverflow\sin\sfts3\scausing\sa\susan\serror. -D 2020-04-22T11:11:17.450 +C Fix\san\soff-by-one\serror\sin\sthe\s"calculated"\spage\scount\soutput\sfrom\sthe\nsqlite3_analyzer\sutility\sfor\sdatabases\sthat\sare\smore\sthan\s1GB\sin\ssize. +D 2020-04-22T13:49:25.923 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1818,7 +1818,7 @@ F tool/showshm.c a0ab6ec32dd1f11218ca2a4018f8fb875b59414801ab8ceed8b2e69b7b45a80 F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c2a1 F tool/showwal.c ad9d768f96ca6199ad3a8c9562d679680bd032dd01204ea3e5ea6fb931d81847 F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe -F tool/spaceanal.tcl 4bfd19aad7eb3ce0372ef0255f58035e0bba4ff5e9acfd763a10c6fb365c8dec +F tool/spaceanal.tcl c161d838825d0242317c7cc13b1eb2126f8cec031950ef31114d42732cb2674e F tool/speed-check.sh 2b042d703a9472f08c3b13be27afac658426f8e4fc87cd2d575953fda86f08d1 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355 F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e @@ -1861,7 +1861,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 52a6acca6d5d376308d354c02f4d676d9375c34c3841d7b1941196ee8b4e2511 -R 239e034db6f2572fb8fec1e8bff6f6f8 -U dan -Z e2a67ef3238147bad4f5c8a4180c4e31 +P e256f85289a78e629acdf83e5bf1f8df2a0ffb3d559738eb9e49db6c228dc8c0 +R aa22f4b98699ca6a0df355f11de7b138 +U drh +Z c8995117adf96d65ebda024f30ba4870 diff --git a/manifest.uuid b/manifest.uuid index 96679a2c15..2591c5adff 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e256f85289a78e629acdf83e5bf1f8df2a0ffb3d559738eb9e49db6c228dc8c0 \ No newline at end of file +8789368b91fb5b7477bdba3a953412fc3839b4894443b65186f7b8f79f6369c9 \ No newline at end of file diff --git a/tool/spaceanal.tcl b/tool/spaceanal.tcl index 3e08d3ffa7..3b33f8868e 100644 --- a/tool/spaceanal.tcl +++ b/tool/spaceanal.tcl @@ -587,6 +587,9 @@ set free_percent2 [percent $free_pgcnt2 $file_pgcnt] set file_pgcnt2 [expr {$inuse_pgcnt+$free_pgcnt2+$av_pgcnt}] +# Account for the lockbyte page +if {$file_pgcnt2*$pageSize>1073742335} {incr file_pgcnt2} + set ntable [db eval {SELECT count(*)+1 FROM sqlite_master WHERE type='table'}] set nindex [db eval {SELECT count(*) FROM sqlite_master WHERE type='index'}] set sql {SELECT count(*) FROM sqlite_master WHERE name LIKE 'sqlite_autoindex%'}