Skip to content

Commit

Permalink
Fix explanation of num_rows, #32
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Aug 13, 2024
1 parent 68e31cc commit 2cca8e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This change log follows the conventions of

### Fixed

- An error in interpreting a value in the database export file format could lead to some rows that were actually present in tables not being found. Thanks to [@IvanOnishchenko](https://github.com/IvanOnishchenko) for [pointing this out](https://github.com/Deep-Symmetry/crate-digger/issues/32).
- An error in interpreting a value in the database export file format could lead to some rows that were actually present in tables not being found. Thanks to [@IvanOnishchenko](https://github.com/IvanOnishchenko) for [pointing this out](https://github.com/Deep-Symmetry/crate-digger/issues/32), and [Jan Holthuis (@Holzhaus)](https://github.com/Holzhaus) for identifying a flaw in the first attempt at correcting it.

## [0.2.0] - 2024-05-04

Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/exports.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ playlist entries) have a lot of very small rows, too many to count
with a single byte. But then why not just always use
__num_rows_large__?

NOTE: The row counter entries represent the number of actually-present rows in the page. To find them, you need to scan all 16 entries of each of the row groups present in the page, ignoring any whose <<#row-presence-bits,row presence bit>> is zero.
NOTE: The row counter entries represent the number of rows that have ever been allocated in the page, but some will no longer be valid due to deletion or updates. To find the actual rows, you need to scan all 16 entries of each of the row groups present in the page, ignoring any whose <<#row-presence-bits,row presence bit>> is zero.

The purpose of the next two bytes are is also unclear. Of _u~3~_ Mr.
Flesniak said “a bitmask (first track: 32)”, and he described _u~4~_
Expand Down
11 changes: 6 additions & 5 deletions src/main/kaitai/rekordbox_pdb.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,17 @@ types:
value: |
(num_rows_large > num_rows_small) and (num_rows_large != 0x1fff) ? num_rows_large : num_rows_small
doc: |
The number of rows on this page (controls the number of row
index entries there are, but some of those may not be marked
as present in the table due to deletion).
The number of rows that have ever been allocated on this
page (controls the number of row groups there are, but some
entries in each group may not be marked as present in the
table due to deletion or updates).
-webide-parse-mode: eager
num_row_groups:
value: '(num_rows - 1) / 16 + 1'
doc: |
The number of row groups that are present in the index. Each
group can hold up to sixteen rows. All but the final one
will hold sixteen rows.
group can hold up to sixteen rows, but `row_present_flags`
must be consulted to determine whether each is valid.
row_groups:
type: 'row_group(_index)'
repeat: expr
Expand Down

0 comments on commit 2cca8e2

Please sign in to comment.