Skip to content

Commit 0a25e82

Browse files
Rewrite row-marker comment to describe full-word detection
The module comment in constants.py still described row-marker detection as a first-byte check, which predates the tightening to full 8-byte sentinel validation. Reword so readers land on the current mental model and the comment points at the bytes constants that actually drive detection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3ce67a2 commit 0a25e82

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/dqlitewire/constants.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
# Header size in bytes
1313
HEADER_SIZE = 8
1414

15-
# Row markers — written as full uint64 words on the wire, but detected by
16-
# checking only the first byte (0xFF = done, 0xEE = part). This matches Go's
17-
# byte-by-byte detection in columnTypes(). Use ROW_DONE_BYTE/ROW_PART_BYTE
18-
# for detection logic; use the full markers for encoding.
15+
# Row markers — written as full uint64 words on the wire. Detection
16+
# validates all 8 bytes of the sentinel (via ``_ROW_DONE_MARKER`` /
17+
# ``_ROW_PART_MARKER`` bytes in ``tuples.py``); the original first-byte
18+
# check was tightened in the ``row-marker-full-word`` fix to close a
19+
# misclassification window where a legitimate value starting with 0xFF
20+
# or 0xEE could be confused with a marker. Use the uint64 constants
21+
# below for encoding and the single-byte constants to build the detection
22+
# byte sequences.
1923
ROW_DONE_BYTE = 0xFF
2024
ROW_PART_BYTE = 0xEE
2125
ROW_DONE_MARKER = 0xFFFFFFFFFFFFFFFF

0 commit comments

Comments
 (0)