Skip to content

Commit

Permalink
Merge pull request #124 from ClickHouse/fix/low-cardinality-index
Browse files Browse the repository at this point in the history
fix(proto): handle index less zero in low cardinality
  • Loading branch information
ernado authored Jun 14, 2022
2 parents a878abf + 280aef9 commit f64b14b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proto/col_low_cardinality.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *ColLowCardinality[T]) DecodeColumn(r *Reader, rows int) error {

c.Values = c.Values[:0]
for _, idx := range c.keys {
if int64(idx) >= indexRows {
if int64(idx) >= indexRows || idx < 0 {
return errors.Errorf("key index out of range [%d] with length %d", idx, indexRows)
}
c.Values = append(c.Values, c.index.Row(idx))
Expand Down

0 comments on commit f64b14b

Please sign in to comment.