ClickHouse / ClickHouse/clickhouse-go

missing error check in appendRowsBlocks

Open Beginner friendly
#2,016 0 comments 0 reactions 0 assignees View on GitHub
bug needs triage
Dominant language
Go
Stars
3.3k
Forks
680
Avg merge
2d 3h
Merged PRs (30d)
14

Description

## Observed

appendRowsBlocks may return nil even if an error happened.
in our project we use Append with blocks, so it's getting into the appendRowsBlocks codepath. We observe incomplete streams being appended without errors.

## Expected behaviour

Return error if a mid-stream error happens in the appendRowsBlocks codepath.

In
https://github.com/ClickHouse/clickhouse-go/blob/a1ee16be2f6db74a3d2bd3c6f0dada2e0725871f/conn_batch.go#L138
when returning after looping on r.Next()
https://github.com/ClickHouse/clickhouse-go/blob/a1ee16be2f6db74a3d2bd3c6f0dada2e0725871f/conn_batch.go#L162

return `r.Err()` instead of `nil`.

Contributor guide

Open the contributing guide

Research direction

Start in conn_batch.go at appendRowsBlocks, especially the return after the loop over r.Next() around lines 138 and 162. Confirm that a mid-stream failure is surfaced through r.Err() rather than nil; done means incomplete block appends return the encountered error.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, go
Domain
databases
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
91/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.