Skip to content

More fuzzing oracles - #106849

Merged
PedroTadim merged 22 commits into
masterfrom
more-fuzz2
Jun 10, 2026
Merged

PedroTadim merged 22 commits into
masterfrom
more-fuzz2

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

  • Add a few more strategies to dump Oracle:
    • Truncate the table and ensure all rows are removed.
    • Rename and back.
    • Move or replace a partition with itself.
    • Add and drop a column.
    • Freeze and unfreeze.
  • Add a new array join Oracle. Both the function and the join operator should yield the same result. Not testing the left array join yet.
  • Fuzz new added settings and features.
  • AST fuzz a few statements.

clang-format changed the layout a bit.

Version info

  • Merged into: 26.6.1.611

@clickhouse-gh

clickhouse-gh Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [95c98c2]

Summary: ✅


AI Review

Summary

This PR adds more BuzzHouse oracle coverage, including roundtrip and ARRAY JOIN checks, plus additional dump-oracle strategies and query-fuzzer/table-function mutations. I found one correctness gap in the new oracle generation: arbitrary expressions can be stringified with aliases and then spliced into SQL contexts where aliases are invalid, which causes the oracle to skip comparisons instead of testing the promised invariant.

Findings

⚠️ Majors

  • [src/Client/BuzzHouse/Generator/QueryOracle.cpp:412] The roundtrip oracle needs the generated operand to be a plain expression that is legal everywhere it is later embedded, but generateExpression may create an ExprColAlias and SQLExprToString preserves it as <expr> AS \alias`. The same string is then used inside toString({})andWHERE ... IS NOT NULL/ equality predicates, which cannot acceptAS, so a subset of generated oracle queries becomes syntax errors and silently loses roundtrip coverage. Suggested fix: disable in-expression aliases while generating this operand, strip ExprColAliasbefore stringifying, or materialize the expression in an innerSELECTand refer only to its alias outside. Apply the same invariant to the laterARRAY JOIN` operand path before embedding it in raw SQL.
Tests
  • ⚠️ Please add the smallest focused BuzzHouse regression or seed that proves oracle operands are stringified without in-expression aliases before they are embedded into toString, WHERE, or ARRAY JOIN raw SQL snippets.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: make the new oracle operands alias-safe before stringifying them into raw SQL, and add focused coverage for that invariant.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 9, 2026
Comment thread src/Common/QueryFuzzer.cpp Resolved
@PedroTadim
PedroTadim enabled auto-merge June 10, 2026 16:15
@clickhouse-gh

clickhouse-gh Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.70% 84.60% -0.10%
Functions 92.30% 92.30% +0.00%
Branches 77.30% 77.20% -0.10%

Changed lines: Changed C/C++ lines coverable by tests: 0 (nothing to score) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@PedroTadim
PedroTadim added this pull request to the merge queue Jun 10, 2026
Merged via the queue into master with commit 63522c2 Jun 10, 2026
166 checks passed
@PedroTadim
PedroTadim deleted the more-fuzz2 branch June 10, 2026 20:26
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci 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.

2 participants