]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add support for URI filenames in sqlite3_analyzer.
authordrh <drh@noemail.net>
Wed, 10 Oct 2012 10:52:46 +0000 (10:52 +0000)
committerdrh <drh@noemail.net>
Wed, 10 Oct 2012 10:52:46 +0000 (10:52 +0000)
FossilOrigin-Name: 6dc987d32ba4d09b811ef281cdae09be17ac936c

manifest
manifest.uuid
tool/spaceanal.tcl

index e926177ec2bb8605bd8a1283570c1d104b8f09fe..d05905807ae3c182ae325468221d3fbcfdf0d216 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Move\sa\scouple\sof\sWAL-related\sfunction\sdeclarations\sin\ssqliteInt.h\sand\spager.h\sinto\s"#ifndef\sSQLITE_OMIT_WAL"\sblocks.\sOtherwise,\sthe\samalgamation\sfails\sto\sbuild\susing\ssome\scompilers\swith\sSQLITE_OMIT_WAL\s(static\sfunction\sdeclared\sbut\snot\sdefined).
-D 2012-10-10T09:46:29.216
+C Add\ssupport\sfor\sURI\sfilenames\sin\ssqlite3_analyzer.
+D 2012-10-10T10:52:46.274
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -1004,7 +1004,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 e42273000686a4afbf6a5e5d7fb12be65e92afb1
+F tool/spaceanal.tcl 76f583a246a0b027f423252339e711f13198932e
 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
 F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
@@ -1019,7 +1019,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
-P dd34bec389359845b86f4cc4906ab440f92dcab9
-R 3b4a747cf1512ff22e3e686194a84c25
-U dan
-Z 3116faf0d406c9c6f0a7c3a027e788be
+P f7437153b90b25a1b77294a0f8d1b0bd4bd08c08
+R 2105f393c264a64ba38b0302c232c7c9
+U drh
+Z 7d1ab82c25985c443fd0708e96445812
index deeb0cedfcf926074b561cf4614b2d52a1edfab1..0a7053878527e6478adcb0bd8c6f6c7e5a3533ab 100644 (file)
@@ -1 +1 @@
-f7437153b90b25a1b77294a0f8d1b0bd4bd08c08
\ No newline at end of file
+6dc987d32ba4d09b811ef281cdae09be17ac936c
\ No newline at end of file
index fd59670adaeea38a3d7b4746599c62c72dca4f8a..6988f6e8b9323e84510d919feaaca616eeabe07a 100644 (file)
@@ -30,32 +30,34 @@ foreach arg $argv {
   }
 }
 if {$file_to_analyze==""} usage
-if {![file exists $file_to_analyze]} {
-  puts stderr "No such file: $file_to_analyze"
+set root_filename $file_to_analyze
+regexp {^file:(//)?([^?]*)} $file_to_analyze all x1 root_filename
+if {![file exists $root_filename]} {
+  puts stderr "No such file: $root_filename"
   exit 1
 }
-if {![file readable $file_to_analyze]} {
-  puts stderr "File is not readable: $file_to_analyze"
+if {![file readable $root_filename]} {
+  puts stderr "File is not readable: $root_filename"
   exit 1
 }
-set true_file_size [file size $file_to_analyze]
+set true_file_size [file size $root_filename]
 if {$true_file_size<512} {
-  puts stderr "Empty or malformed database: $file_to_analyze"
+  puts stderr "Empty or malformed database: $root_filename"
   exit 1
 }
 
 # Compute the total file size assuming test_multiplexor is being used.
 # Assume that SQLITE_ENABLE_8_3_NAMES might be enabled
 #
-set extension [file extension $file_to_analyze]
-set pattern $file_to_analyze
+set extension [file extension $root_filename]
+set pattern $root_filename
 append pattern {[0-3][0-9][0-9]}
 foreach f [glob -nocomplain $pattern] {
   incr true_file_size [file size $f]
   set extension {}
 }
 if {[string length $extension]>=2 && [string length $extension]<=4} {
-  set pattern [file rootname $file_to_analyze]
+  set pattern [file rootname $root_filename]
   append pattern {.[0-3][0-9][0-9]}
   foreach f [glob -nocomplain $pattern] {
     incr true_file_size [file size $f]
@@ -64,7 +66,10 @@ if {[string length $extension]>=2 && [string length $extension]<=4} {
 
 # Open the database
 #
-sqlite3 db $file_to_analyze
+if {[catch {sqlite3 db $file_to_analyze -uri 1} msg]} {
+  puts stderr "error trying to open $file_to_analyze: $msg"
+  exit 1
+}
 register_dbstat_vtab db
 
 db eval {SELECT count(*) FROM sqlite_master}
@@ -484,7 +489,7 @@ set user_percent [percent $user_payload $file_bytes]
 
 # Output the summary statistics calculated above.
 #
-puts "/** Disk-Space Utilization Report For $file_to_analyze"
+puts "/** Disk-Space Utilization Report For $root_filename"
 catch {
   puts "*** As of [clock format [clock seconds] -format {%Y-%b-%d %H:%M:%S}]"
 }