Skip to content

Add regression test for correlated subquery with GROUPING SETS and group_by_use_nulls - #110956

Merged
alexey-milovidov merged 2 commits into
masterfrom
regression-test-102273
Jul 19, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
regression-test-102273

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 18, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Adds a regression test for the fuzzer query from the issue below. A correlated scalar subquery referencing a GROUPING SETS key under group_by_use_nulls = 1 used to fail with a logical error Unexpected return type from bitNot. Expected UInt64. Got Nullable(UInt64), because the correlated column kept its pre-Nullable type while the post-aggregation rows carried Nullable values.

The bug was fixed in the analyzer by the PR linked below, whose test 04053 covers the WITH ROLLUP and WITH CUBE shapes; this test pins the GROUPING SETS shape found by the fuzzer (distilled shape with and without group_by_use_nulls, plus the original fuzzer query scaled down). Verified that the test passes on current master and covers the previously failing pattern.

Closes: #102273
Related: #100365
Related: #102597

Version info

  • Merged into: 26.7.1.1188 (included in 26.7 and later)

…oup_by_use_nulls

The fuzzer query from issue #102273 used to fail with a logical error
"Unexpected return type from `bitNot`. Expected UInt64. Got Nullable(UInt64)"
because the correlated column kept its pre-Nullable type while the
post-aggregation rows carried Nullable values. The bug was fixed in the
analyzer by #100365, which covered `WITH ROLLUP` and `WITH CUBE` shapes in
test 04053; this adds the `GROUPING SETS` shape.

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [04ae628]

Summary: ✅


AI Review

Summary

This PR adds a focused stateless regression test for issue #102273, covering the GROUPING SETS shape that the earlier analyzer fix in #100365 did not exercise. I did not find a correctness or coverage problem in the added .sql / .reference pair: the first two queries pin the group_by_use_nulls NULL versus default-value behavior, and the third preserves the original fuzzer shape in a reduced form.

Missing context / blind spots
  • ⚠️ I could not rerun 04611_correlated_subquery_grouping_sets_use_nulls locally because this checkout has no clickhouse binary in the standard local-run locations. The current PR workflow had only completed Config Workflow, Style check, and Fast test at review time, so the stateless job that will execute this new file was still pending. The author's earlier PR comment says the targeted test already passed before the master merge, and the merge commit did not change the test itself.
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 18, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The previous red CI (Stateless tests (amd_debug, parallel), 40 failed) is unrelated to this PR. This PR's own test 04611_correlated_subquery_grouping_sets_use_nulls passed (OK); all 40 failures were collateral QUOTA_EXCEEDED errors on unrelated tests' framework queries (_cleanup_database / configure_testcase_args).

Root cause: 04603_quota_zero_interval.sh runs CREATE QUOTA ... FOR INTERVAL 1 HOUR MAX queries = 1000 TO default. Because it is scoped TO default (the shared user), once the quota is live the default user quickly exceeds 1000 queries/hour across the whole parallel run, so other tests' queries fail with QUOTA_EXCEEDED (observed queries = 1065/1000, quota template quota_zero_test_...).

This is fixed by the open PR #110954 ("Fix 04603_quota_zero_interval breaking parallel and stress runs"). Merged latest master to refresh CI.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Jul 19, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 19, 2026
Merged via the queue into master with commit 2ef6d10 Jul 19, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the regression-test-102273 branch July 19, 2026 15:58
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 19, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…102273

Add regression test for correlated subquery with `GROUPING SETS` and `group_by_use_nulls`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical error: Unexpected return type from A. Expected B. Got C. Action: (STID: 1611-343c)

2 participants