]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Changes to the analyzer script to make it work with zipvfs databases.
authordan <dan@noemail.net>
Mon, 26 Sep 2011 19:32:47 +0000 (19:32 +0000)
committerdan <dan@noemail.net>
Mon, 26 Sep 2011 19:32:47 +0000 (19:32 +0000)
FossilOrigin-Name: d82cffab6acafcf9d91fea4ac47cad73f6f09775

manifest
manifest.uuid
tool/spaceanal.tcl

index 7223849835bb28a95b335dbda32e85f03803e245..42eac2a0a09ae8bd00861e2f43640deb30cf677d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C If\san\sopen\sas\sread/write\sfails,\sdo\snot\stry\sto\sreopen\sas\sread-only\sif\sin\nexclusive\saccess\smode.
-D 2011-09-25T17:49:26.535
+C Changes\sto\sthe\sanalyzer\sscript\sto\smake\sit\swork\swith\szipvfs\sdatabases.
+D 2011-09-26T19:32:47.615
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in a162fe39e249b8ed4a65ee947c30152786cfe897
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -953,7 +953,7 @@ F tool/showjournal.c b62cecaab86a4053d944c276bb5232e4d17ece02
 F tool/showwal.c f09e5a80a293919290ec85a6a37c85a5ddcf37d9
 F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
 F tool/space_used.tcl f714c41a59e326b8b9042f415b628b561bafa06b
-F tool/spaceanal.tcl 537f35d9e432695990ec855314d72eba9b999fe4
+F tool/spaceanal.tcl a7ffc29ba8db2fd791b4de83ee0a2a0436c07171
 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
 F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
@@ -964,7 +964,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5
 F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings.sh b7fdb2cc525f5ef4fa43c80e771636dd3690f9d2
-P 87946c627f7230bea3739fd6aeec3e56115a3f93
-R 45c74df3a651dc62ff2bf197449037d8
-U drh
-Z 9e8d9a9ad0cf791e3b92c0613c836ce2
+P 263c5fb2802f8c84835e42fc66acb1065b7e42b9
+R 653cfc1894df476a0aac3944fac55ae4
+U dan
+Z 3c688ce814d5c4f405619c4d3e366aaa
index fb3a0aea69d8ad9b4bf6fbea49dcb9f5ee123929..4ad4ea9b90398728106506a1ebb090a985cb41f4 100644 (file)
@@ -1 +1 @@
-263c5fb2802f8c84835e42fc66acb1065b7e42b9
\ No newline at end of file
+d82cffab6acafcf9d91fea4ac47cad73f6f09775
\ No newline at end of file
index bb5c1a0c3cfdedf8112a03db01e0bbb07cf3cd34..52d8251b6e564dec45186818486c16af30ebf2e7 100644 (file)
@@ -34,8 +34,8 @@ if {[file size $file_to_analyze]<512} {
 sqlite3 db $file_to_analyze
 register_dbstat_vtab db
 
-set pageSize [db one {PRAGMA page_size}]
 db eval {SELECT count(*) FROM sqlite_master}
+set pageSize [db one {PRAGMA page_size}]
 
 # In-memory database for collecting statistics. This script loops through
 # the tables and indices in the database being analyzed, adding a row for each
@@ -357,8 +357,15 @@ proc autovacuum_overhead {filePages pageSize} {
 #                (not including sqlite_master)
 # user_percent:  $user_payload as a percentage of total file size.
 
-set file_bytes  [file size $file_to_analyze]
-set file_pgcnt  [expr {$file_bytes/$pageSize}]
+### The following, setting $file_bytes based on the actual size of the file
+### on disk, causes this tool to choke on zipvfs databases. So set it based
+### on the return of [PRAGMA page_count] instead.
+if 0 {
+  set file_bytes  [file size $file_to_analyze]
+  set file_pgcnt  [expr {$file_bytes/$pageSize}]
+}
+set file_pgcnt  [db one {PRAGMA page_count}]
+set file_bytes  [expr $file_pgcnt * $pageSize]
 
 set av_pgcnt    [autovacuum_overhead $file_pgcnt $pageSize]
 set av_percent  [percent $av_pgcnt $file_pgcnt]