Skip to content

Fix RowBinary tuple encoding re-normalizing nested types - #378

Merged
ruslandoga merged 1 commit into
plausible:masterfrom
SAY-5:fix-tuple-normalized-nested-encode
Aug 9, 2026
Merged

Fix RowBinary tuple encoding re-normalizing nested types#378
ruslandoga merged 1 commit into
plausible:masterfrom
SAY-5:fix-tuple-normalized-nested-encode

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #367.

encode({:tuple, types}, values) called the public encode_row/2, which runs encoding_types/1 again. The tuple's field types were already normalized by encoding_type({:tuple, ts}), so encoding a tuple with a normalized nested type like DateTime64 or Time64 re-applied time_unit/1 to an already-computed value (e.g. 1000) and raised FunctionClauseError.

Switched the tuple clause to the private _encode_row/2, which assumes normalized types and skips the second pass. Added a round-trip regression test for Tuple(DateTime64(3, 'UTC')) and Tuple(Time64(6)).

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@ruslandoga

Copy link
Copy Markdown
Collaborator

Thank you!

@ruslandoga
ruslandoga merged commit eb650e0 into plausible:master Aug 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix RowBinary tuple encoding re-normalizing nested types

2 participants