#120654·ClickHouse

01660_system_parts_smoke fails with Bad get: has `Int128`, requested `UInt128`

Author: protomnCreated Sep 17, 2026Updated Sep 17, 2026
Labelspotential bugcomp-mergetree

Company or project name

No response

Describe what's wrong

I couldn't find a matching issue on this. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119167&sha=d116a26924c01d61f1f9b9e965d7416db8742d76&name_0=PR&name_1=Fast%20test

The test fails on:

SELECT * FROM system.parts FORMAT Null;

The server returns:

Code: 170. DB::Exception: Bad get: has Int128, requested UInt128. (BAD_GET)

The stack points to MergeTreePartition::serializeText, called through StorageSystemParts::processNextStorage.

Does it reproduce on the most recent release?

Yes

How to reproduce

  • Server: 26.10.1.1, as used in the failing CI run.
  • Interface: clickhouse-client over native TCP.
  • Non-default settings: none required for the minimal reproducer documented in PR #119333.
CREATE TABLE smoke_partition_repro
(
    c0 Int128
)
ENGINE = MergeTree
PARTITION BY (CAST(37528, 'UInt64') % c0)
ORDER BY tuple();

INSERT INTO smoke_partition_repro VALUES (167682982);

-- Focused reproduction:
SELECT partition
FROM system.parts
WHERE database = currentDatabase()
  AND table = 'smoke_partition_repro'
  AND active;

-- The query that failed in 01660_system_parts_smoke:
SELECT * FROM system.parts FORMAT Null;

Cleanup, run separately after observing the failure:

DROP TABLE smoke_partition_repro;

Expected behavior

The focused query should return partition value 37528. The unfiltered system.parts query should complete successfully without a type-mismatch exception.

Error message and/or stacktrace

From the failing Fast test report for PR #119167:

Test: 01660_system_parts_smoke Reason: return code: 170 Server version: 26.10.1.1

Code: 170. DB::Exception: Received from localhost:9000.
DB::Exception: Bad get: has Int128, requested UInt128. (BAD_GET)

Query:

SELECT * FROM system.parts FORMAT Null;

Relevant stack frames, with template arguments abbreviated:

  1. src/Core/Field.cpp:1102:15:DB::Field::safeGet<wide::integer<128ul, unsigned int>>
  2. src/Core/Field.h:482:43:DB::ColumnVector<wide::integer<128ul, unsigned int>>::insert
  3. src/Storages/MergeTree/MergeTreePartition.cpp:382:17:DB::MergeTreePartition::serializeText
  4. src/Storages/MergeTree/MergeTreePartition.cpp:409:5:DB::MergeTreePartition::serializeToString
  5. src/Storages/System/StorageSystemParts.cpp:183:58:DB::StorageSystemParts::processNextStorage
  6. src/Storages/System/StorageSystemPartsBase.cpp:337:18:DB::ReadFromSystemPartsBase::initializePipeline

Related issues and pull requests

Related: https://github.com/ClickHouse/ClickHouse/pull/119333 Related: https://github.com/ClickHouse/ClickHouse/pull/119167

Additional context

The same exception occurred in this test on unrelated PRs:

  • #117329 on 2026-09-16.
  • #115979 on 2026-09-09.
  • #102192 on 2026-09-08.