Skip to content

Commit

Permalink
Merge pull request #248 from psantos10/fix-decode-types-varint
Browse files Browse the repository at this point in the history
Fix RowBinary decoding issue when their sizes exceeds 127 bytes
  • Loading branch information
ruslandoga authored Feb 25, 2025
2 parents a653833 + 7707923 commit 63f23cc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/ch/row_binary.ex
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,14 @@ defmodule Ch.RowBinary do
decode_rows(types, rest, _row = [], _rows = [], types)
end

defp decode_types(<<size, type::size(size)-bytes, rest::bytes>>, count, acc) do
decode_types(rest, count - 1, [type | acc])
for {pattern, value} <- varints do
defp decode_types(
<<unquote(pattern), type::size(unquote(value))-bytes, rest::bytes>>,
count,
acc
) do
decode_types(rest, count - 1, [type | acc])
end
end

@doc false
Expand Down

0 comments on commit 63f23cc

Please sign in to comment.