Skip to content

Backport #131054 to 26.9: Keep a PREWHERE guard on a subcolumn ahead of a throwing condition on its sibling - #131110

Open
robot-ch-test-poll2 wants to merge 296 commits into
26.9from
backport/26.9/131054
Open

robot-ch-test-poll2 wants to merge 296 commits into
26.9from
backport/26.9/131054

Conversation

@robot-ch-test-poll2

Copy link
Copy Markdown
Contributor

Original pull-request #131054

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

PedroTadim and others added 30 commits October 29, 2026 18:51
Backport #119814 to 26.9: Keep the bucket-order promise of a shard aggregation in the Cascades optimizer
Backport #124999 to 26.9: Add server setting `ai_function_allow_sql_named_collections`
Backport #117802 to 26.9: Move AI functions to the end of PREWHERE
…where`

`clickhouse-test` randomizes it on this branch; with `0` nothing is moved to PREWHERE and the test fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…query_background_access` when the session date is ahead of the server date
…ewhere-05316-26.9

[26.9] Pin query_plan_optimize_prewhere in 05316_ai_functions_last_in_prewhere
Backport #127797 to 26.9: Fix flaky test `05055_format_schema_source_query_background_access` when the session date is ahead of the server date
Backport #126345 to 26.9: Fix flaky test `03821_drop_workload_during_query_race`
Backport #122484 to 26.9: Issue AI function requests concurrently from a server-wide thread pool
Backport #116666 to 26.9: Fix a server abort on Parquet reads that record no missing values
Backport #128476 to 26.9: Check `LowCardinality` indexes against the dictionary when reading data parts
…pgrade when all_... system log tables are replaced on startup
…sDB tuple key filter with a LowCardinality element
Backport #127630 to 26.9: Fix server failing to start once after an upgrade when all_... system log tables are replaced on startup
Backport #113673 to 26.9: Fix signed integer overflow in refreshable materialized view `RANDOMIZE FOR`
Backport #125509 to 26.9: Fix heap-use-after-free in the EmbeddedRocksDB tuple key filter with a LowCardinality element
Backport #124644 to 26.9: Fix stack overflow in Avro schema inference on a deep chain of named types
…r an exception while building the index
…from SQL SECURITY DEFINER views without an invoker
Backport #128291 to 26.9: Fix segfault in `ReverseIndex::insert` after an exception while building the index
clickhouse-gh Bot and others added 20 commits November 11, 2026 17:47
Backport #130488 to 26.9: Validate values of deserialized `gini` states
Backport #130755 to 26.9: Fix Keeper crash on `CheckWatch` request with an unknown watch type
Backport #128978 to 26.9: Do not echo dictionary source file content in YAMLRegExpTree error
Backport #122465 to 26.9: Fix `ssd_cache` dictionaries with the same `PATH` returning each other's values
Backport #123690 to 26.9: Fix reading a subcolumn of a `Nested` member added by `ALTER ADD COLUMN` from older parts
…en the join order optimizer reorders an outer join converted to INNER
…iator whatever their own `automatic_parallel_replicas_mode`
Backport #125801 to 26.9: Parallel replicas followers follow the initiator whatever their own `automatic_parallel_replicas_mode`
Backport #127416 to 26.9: Fix `Cannot fold actions for projection` when the join order optimizer reorders an outer join converted to INNER
Backport #130493 to 26.9: Fix flaky test_async_metadata_refresh
… NULL for it

Port of #124041, a prerequisite of #121154 on this branch: when a link of the monotonic chain
turns a non-NULL bound into NULL, the bound has no position in the `Range` order, so the range
is left unanalyzed instead of compared. Without it the `NOT (coalesce(nullIf(c0, 5), 0) = 1)`
case of `05233_assume_not_null_nullable_partition_key_pruning` still prunes the partition of 5
(4 rows expected, 3 returned), as seen on the 26.9 backport.

#124041 is written against the try/catch chain loop of #117355, which this branch does not have,
so this applies only its check to the branch's loop.

#130788

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #121154 to 26.9: Fix wrong results when a predicate applies a NULL-handling function to a `Nullable` partition key
Backport #130462 to 26.9: Bound the declared length of PostgreSQL messages parsed before authentication
Backport #130952 to 26.9: Reject named collection DDL in readonly mode and with `allow_ddl = 0`
Backport #130192 to 26.9: Keep the `NULL` partition in Delta Lake partition pruning when the filter's set holds `NULL`
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Nov 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [06492df]

Summary: ✅

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Note for whoever resolves this backport: on 26.9, MergeTreeWhereOptimizer::optimize(SelectQueryInfo &, ...) (the AST-based path used by the old analyzer when query_plan_optimize_prewhere or query_plan_enable_optimizations is disabled) still exists, and there RPNBuilderTreeNode::getDAGNode returns null. The same backport on 26.8 therefore segfaults in conditionMayThrow. The fix for 26.8 is #133157. Please include the same null check (!dag_node || before conditionMayThrow) in this backport.

This branch has not been deployed

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

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.