Repository navigation
Cherry pick #122870 to 26.3: Hide a Backup locator named like a COLUMNS matcher in EXPLAIN AST instead of throwing - #123035
Conversation
…T` instead of throwing
With secrets hidden, `EXPLAIN AST` replaces a secret argument with the
masked SQL the secret finder produces for the formatter, parsed back, and
sets the argument's alias on the result. The `Backup` database rule wrote
the locator function name unquoted, so `` `t.COLUMNS`('x') `` was masked as
`t.COLUMNS('[HIDDEN]')`, which parses back as a qualified `COLUMNS`
matcher. A matcher cannot carry an alias, so `EXPLAIN AST` threw
`Can't set alias ... (LOGICAL_ERROR)`.
Print the locator name with `backQuoteIfNeed`, as `ASTFunction` prints a
function name, so the masked text reads back as the same function and
keeps its structure in the dump. In `replaceWithMaskedText`, hide the
argument whole when the parsed text cannot carry an alias, as it already
did for text that does not parse: a bare `COLUMNS` name stays unquoted in
both the formatter and the finder, and the reconstructed `S3(...)` locator
writes a named-collection identifier as written, so its text can also end
in a matcher.
Closes #122810
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…olumns-name Hide a `Backup` locator named like a `COLUMNS` matcher in `EXPLAIN AST` instead of throwing
`ComparisonGraph::normalizeAtom` (the AST overload) flips `less`/`lessOrEquals` into `greater`/`greaterOrEquals` by swapping the two arguments, but it accessed `children[0]` and `children[1]` without checking the argument count. The AST reaching `ConstraintsDescription::buildGraph` is not analyzed, so a constraint expression such as `CHECK less(a)` (a unary `less`) caused an out-of-bounds read: `Assertion 'this->m_holder.m_size > n' failed` in debug builds and a segfault in release builds. The query-tree overload is protected by function resolution and its own `chassert(arguments.size() == 2)`; the AST path had no such guard. Only binary comparisons can be normalized, so anything else is left unchanged and ignored later, where `arguments.size() == 2` is already checked. Found by the AST fuzzer on the new `ALTER ... MODIFY CONSTRAINT` test: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108768&sha=686df51dd6d5f41a3043194c6418c5059a53c793&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%29 #108768 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> (cherry picked from commit 01e999e) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cherry-picked test exercised `ALTER TABLE ... MODIFY CONSTRAINT`, which was introduced together with the fix in #108768 and does not exist on this branch. Replace that case with a `CREATE TABLE` reproducer (`CHECK less(a)`), and cover `ASSUME less(a)` and a zero-argument `less()` as well. Also rename it to `04489_constraint_comparison_wrong_arity`, the name it has on master. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #119244 to 26.3: Do not log kafka secrets
…legacy `s3queue_` prefix
…for columns the filter uses
…erialized-view targets of partitioned tables
…raph-wrong-arity Backport fix for a malformed comparison in a constraint to 26.3
Backport #122681 to 26.3: Build Iceberg min/max hyperrectangles only for columns the filter uses
…as a row policy
Backport #112649 to 26.3: Fix deduplication token attribution for materialized-view targets of partitioned tables
Backport #122057 to 26.3: Mask credentials of an S3 URI in validation exceptions
Backport #123060 to 26.3: Hide queue engine secrets written with the legacy `s3queue_` prefix
…ia embedded NUL byte in certificate CN
…OwnSplitChannel::log`
Backport #117403 to 26.3: Fix ssl_certificate authentication bypass via embedded NUL byte in certificate CN
Backport #121398 to 26.3: Skip the direct join when the right table has a row policy
Backport #122673 to 26.3: Hide HTTP headers of `HTTP` dictionary sources
…n a binary encoded type
…() that used aliases
…budget for the aggregate state read On 26.3 `input_format_binary_max_type_complexity` is read from the query context for every binary type decoding, including an `AggregateFunction` state, while master leaves stored data unlimited. So the `finalizeAggregation` query hit the default budget (`INCORRECT_DATA`) before the stack guard the test expects. Disable the budget for it, like the `format` query before it. #123470 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e key directory cannot be created
Backport #123336 to 26.3: Do not dereference a null `logs_queue` in `OwnSplitChannel::log`
…pleteMultipartUpload
Backport #120313 to 26.3: Hide secret arguments in `EXPLAIN AST` output
Backport #117730 to 26.3: Memory-track the JSON `FLATTENED` path list read from `Native`
Backport #117765 to 26.3: Fix out-of-bounds reads when reading malformed JSON and Dynamic columns
Backport #122574 to 26.3: Use less schema comparison
Backport #122829 to 26.3: Fix crash on invalid Iceberg manifest-list entries
…privilege of the replaced table via `Replicated` databases and `ON CLUSTER`
Backport #121825 to 26.3: Use the remote host filter in Kafka and NATS engines
Resolved, on my fork
I do not have push access here, so the merge is on my fork. Both refs move by fast-forward:
Checked on a 26.3 debug build of this commit (clang-21): |
Backport #120516 to 26.3: Fix access checks in PREWHERE and indexHint() that used aliases
Backport #122667 to 26.3: Fix server crash on a deeply nested Field in a binary encoded type
Backport #123114 to 26.3: S3 client check initial url in backup client
Backport #122211 to 26.3: Undo a filesystem cache reservation when the key directory cannot be created
Backport #109364 to 26.3: Retry transient MinIO InvalidPart on S3 CompleteMultipartUpload
Backport #122272 to 26.3: Fix `CREATE OR REPLACE` bypassing the drop privilege of the replaced table via `Replicated` databases and `ON CLUSTER`
The prerequisite #120313 (`EXPLAIN AST` secret hiding) reached 26.3 through #123453 after this cherry-pick was created, so merge 26.3 first. The only remaining conflict is the include list: keep 26.3's includes and add `Parsers/ASTWithAlias.h`, which the fix needs. `ASTSubquery.h` and `ASTTablesInSelectQuery.h` are master-only context and are not needed here. Backport of #122870 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Original pull-request #122870
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job