diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-02 07:44:54 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-02 07:44:54 -0600 |
commit | 43eda94ec110d0bcba39381fb16cb04a978996ed (patch) | |
tree | 945ae8ed81d9b72c973dcec0bbcf254778ea7fa7 /cmd | |
parent | Merge pull request #104 from benbjohnson/remove-db-open (diff) | |
download | dedo-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.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/bolt/pages.go | 16 |
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 |