Skip to content

Backport of #93814 to 25.8: Fix logical error in Map column types when used with empty tuple#1994

Open
ianton-ru wants to merge 1 commit into
stable-25.8from
backport/25.8/93814
Open

Backport of #93814 to 25.8: Fix logical error in Map column types when used with empty tuple#1994
ianton-ru wants to merge 1 commit into
stable-25.8from
backport/25.8/93814

Conversation

@ianton-ru

Copy link
Copy Markdown

Backport of ClickHouse#93814 by @nihalzp

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC) or LOGICAL_ERROR

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix logical error in a rare case when empty tuple is used with Map column. Closes ClickHouse#93784. (ClickHouse#93814 by @nihalzp)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

…array

Fix logical error in `Map` column types when used with empty tuple
@ianton-ru ianton-ru added 25.8 25.8 Altinity Stable backport Backport labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Workflow [PR], commit [cba9643]

@ianton-ru

Copy link
Copy Markdown
Author

Failed stateless tests looks unrelated

03707_set_index_bad_get_null_bug - looks like need changes for explain query plan from ClickHouse#105036

03579_create_table_populate_from_s3 - known bug ClickHouse#107057

@mkmkme mkmkme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical to the upstream one. LGTM

@CarlosFelipeOR

CarlosFelipeOR commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

✅ QA Verification — PASS

Verdict

No regressions introduced by this PR. All CI failures are either infrastructure flakiness (Keeper) or already-resolved issues (#2008). Approved from QA side.

Summary

Backport of upstream #93814 to stable-25.8. The fix (src/Functions/array/array.cpp: insertManyDefaults(columns.size() * input_rows_count)) correctly resolves the LOGICAL_ERROR on empty Tuple() inside a Map column with multiple rows.

The new test 03786_empty_tuple_map_array passed in the following CI jobs:

  • Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel)
  • Stateless tests (amd_binary, old analyzer, s3 storage, DatabaseReplicated, parallel)
  • Stateless tests (amd_debug, AsyncInsert, s3 storage, parallel)
  • Stateless tests (amd_debug, distributed plan, s3 storage, parallel)
  • Stateless tests (amd_debug, parallel)

CI failures — all justified, none is a regression

1. Server died in Stateless tests (amd_binary, old analyzer, s3 storage, DatabaseReplicated, sequential) — Infrastructure (Keeper session-loss cascade), unrelated to this PR.

  • The FAIL rows are crash meta-statuses (Server died, Killed by signal, Fatal messages), not test assertions. The test tagged SERVER_DIED was 03532_crash_in_aggregation_because_of_lost_exception, with a ~36 min duration — it hung, it did not fail.
  • Root cause from the logs: at ~14:25:58 all three DatabaseReplicated nodes lost their Keeper session (Nothing is received in session timeout of 30000 ms, KEEPER_EXCEPTION; 269 occurrences on server1). ~58 min later the CI watchdog killed the servers with signal 6. The crash stack is entirely in shutdown (DDLWorker::shutdown()ThreadFromGlobalPool::join()Poco::Event::wait()), i.e. the DDL worker hung because it could not reach Keeper.
  • 03532 passes on every other run, including this exact job on other PRs and on master. This PR only touches FunctionArray (array.cpp) — nothing related to Keeper, aggregation, or DatabaseReplicated.

2. 03707_set_index_bad_get_null_bug — Resolved by the fix backported in #2008.

3. 03579_create_table_populate_from_s3 — Marked as broken in tests/broken_tests.yaml via #2008.

Both #2008 changes are already merged into stable-25.8 (the base branch of this PR), so these two failures are addressed once this branch is up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

25.8 25.8 Altinity Stable backport Backport stable stable-25.8 verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants