aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-04-02 07:44:54 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-04-02 07:44:54 -0600
commit43eda94ec110d0bcba39381fb16cb04a978996ed (patch)
tree945ae8ed81d9b72c973dcec0bbcf254778ea7fa7
parentMerge pull request #104 from benbjohnson/remove-db-open (diff)
downloaddedo-43eda94ec110d0bcba39381fb16cb04a978996ed.tar.gz
dedo-43eda94ec110d0bcba39381fb16cb04a978996ed.tar.xz
Remove count and overflow columns for free pages on 'bolt pages'.
The count and overflow columns are meaningless for freed pages since there could be random overflow data in there. This commit removes those columns for free pages.
-rw-r--r--cmd/bolt/pages.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/cmd/bolt/pages.go b/cmd/bolt/pages.go
index ab2b67d..33f6886 100644
--- a/cmd/bolt/pages.go
+++ b/cmd/bolt/pages.go
@@ -34,11 +34,19 @@ func Pages(path string) {
break
}
- var overflow string
- if p.OverflowCount > 0 {
- overflow = strconv.Itoa(p.OverflowCount)
+ // Only display count and overflow if this is a non-free page.
+ var count, overflow string
+ if p.Type != "free" {
+ count = strconv.Itoa(p.Count)
+ if p.OverflowCount > 0 {
+ overflow = strconv.Itoa(p.OverflowCount)
+ }
}
- printf("%-8d %-10s %-6d %-6s\n", p.ID, p.Type, p.Count, overflow)
+
+ // Print table row.
+ printf("%-8d %-10s %-6s %-6s\n", p.ID, p.Type, count, overflow)
+
+ // Move to the next non-overflow page.
id += 1
if p.Type != "free" {
id += p.OverflowCount