Skip to content

Commit a34f75d

Browse files
committed
Scan all rows of each row group, fixes #32
1 parent 5e2ed34 commit a34f75d

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ This change log follows the conventions of
66

77
## [Unreleased][unreleased]
88

9-
Nothing so far.
9+
### Fixed
10+
11+
- 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).
1012

1113
## [0.2.0] - 2024-05-04
1214

doc/modules/ROOT/pages/exports.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ playlist entries) have a lot of very small rows, too many to count
255255
with a single byte. But then why not just always use
256256
__num_rows_large__?
257257

258+
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.
259+
258260
The purpose of the next two bytes are is also unclear. Of _u~3~_ Mr.
259261
Flesniak said “a bitmask (first track: 32)”, and he described _u~4~_
260262
as “often 0, sometimes larger, especially for pages with a high number
@@ -296,6 +298,7 @@ deleted). The number of row index entries is determined, as described
296298
above, by the value of either __num_rows_small__ or
297299
__num_rows_large__.
298300

301+
[#row-presence-bits]
299302
The bit mask for the first group of up to sixteen rows, labeled
300303
_row~pf0~_ in the diagram (meaning “row presence flags group 0”), is
301304
found near the end of the page. The last two bytes after each row

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.deepsymmetry</groupId>
88
<artifactId>crate-digger</artifactId>
9-
<version>0.2.0</version>
9+
<version>0.2.1-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Crate Digger</name>

src/main/kaitai/rekordbox_pdb.ksy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ types:
286286
rows:
287287
type: row_ref(_index)
288288
repeat: expr
289-
repeat-expr: '(group_index < (_parent.num_row_groups - 1)) ? 16 : ((_parent.num_rows - 1) % 16 + 1)'
289+
repeat-expr: 16
290290
doc: |
291291
The row offsets in this group.
292292

0 commit comments

Comments
 (0)