diff --git a/.github/workflows/docs_sync.yml b/.github/workflows/docs_sync.yml index df582e3..815199f 100644 --- a/.github/workflows/docs_sync.yml +++ b/.github/workflows/docs_sync.yml @@ -113,7 +113,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout docs source - uses: actions/checkout@v5 + uses: actions/checkout@v7 with: # On a release, take the docs as of the released tag; otherwise take # the default checkout (post-merge default branch / dispatched ref). diff --git a/.github/workflows/docs_verify.yml b/.github/workflows/docs_verify.yml index 92d9506..a268b4e 100644 --- a/.github/workflows/docs_verify.yml +++ b/.github/workflows/docs_verify.yml @@ -24,7 +24,7 @@ jobs: image: clickhouse/docs-builder steps: - name: Checkout docs source - uses: actions/checkout@v5 + uses: actions/checkout@v7 # Fetch the check driver from ClickHouse/ClickHouse rather than vendoring # it. The driver shallow/sparse-clones the aggregator docs plus its CI diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57f472a..e66fe85 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,12 +12,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 # Cached .debs key off this workflow file: editing the package list below # busts it; upstream lts bumps fall back to the restore-key prefix. - name: Cache apt packages - uses: actions/cache@v5 + uses: actions/cache@v6 with: path: ~/.apt-cache key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/test.yml') }} diff --git a/clickhouse.h b/clickhouse.h index d3133c5..338e970 100644 --- a/clickhouse.h +++ b/clickhouse.h @@ -2749,7 +2749,7 @@ const chc_type *chc_block_column_type(const chc_block *b, size_t i) const chc_column *chc_block_column(const chc_block *b, size_t i) { return (b && i < b->n_columns) ? b->columns[i] : NULL; } bool chc_block_is_overflows(const chc_block *b) { return b ? b->is_overflows : false; } -int32_t chc_block_bucket_num(const chc_block *b) { return b ? b->bucket_num : 0; } +int32_t chc_block_bucket_num(const chc_block *b) { return b ? b->bucket_num : -1; } /* Resumable block reader. Continues a (possibly partial) block parse across * CHC_WOULD_BLOCK without re-parsing completed columns. Owns the `in` @@ -2786,6 +2786,7 @@ chc__block_resume_in(chc_in *in, const chc_alloc *al, if (b == NULL) { b = chc__calloc(al, sizeof *b, err); if (!b) return CHC_ERR_OOM; + b->bucket_num = -1; /* BlockInfo default, kept when frame has none */ uint64_t consumed_before = in->consumed; /* Checkpoint packet start so a mid-header would-block rewinds here. */ diff --git a/doc/clickhouse.md b/doc/clickhouse.md index 7e3f388..5ced39c 100644 --- a/doc/clickhouse.md +++ b/doc/clickhouse.md @@ -310,6 +310,9 @@ bool chc_block_is_overflows (const chc_block *b); int32_t chc_block_bucket_num (const chc_block *b); ``` +`chc_block_bucket_num` is -1 unless block is a two-level aggregation bucket, +including blocks read without BlockInfo. + Clean EOF at a block boundary returns `CHC_OK` with `*out == NULL`. Any short read mid-block is `CHC_ERR_EOF`. The TCP packet loop in [clickhouse-client.md](clickhouse-client.md) drives this with the right