> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Changelog for 2026

# Changelog 2026

<h3 id="267">
  ClickHouse release 26.7, 2026-07-22. [Presentation](https://presentations.clickhouse.com/2026-release-26.7/), [Video](https://www.youtube.com/watch?v=mKBNLaFOVDA)
</h3>

<h4 id="267-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* S3 access originating from user SQL no longer resolves the server's own cloud credentials (environment, IMDS/IRSA, instance profile, AWS config files, `role_arn`-based STS, GCP OAuth metadata) by default; such a request must use explicit credentials or `NOSIGN`. Named collections now default `use_environment_credentials` to `0`. The previous behaviour can be restored per request with `use_environment_credentials = 1` (or globally via the `<s3>` config) together with the new setting `s3_allow_server_credentials_in_user_queries` (disabled by default). Explicitly supplied and operator-provisioned config credentials are unaffected. On server startup or `RESTORE`, a persistent `S3`/`S3Queue` table, dynamic S3 disk, or `DataLakeCatalog` whose definition resolves such credentials is loaded anonymously (inaccessible until re-credentialed) instead of aborting startup, controlled by the new server setting `s3_load_table_anonymously_if_credentials_restricted` (enabled by default). [#106855](https://github.com/ClickHouse/ClickHouse/pull/106855) ([Raúl Marín](https://github.com/Algunenano)).
* The `**/` glob (any number of directories) now also matches the same directory. Previously, `**/` in glob patterns was not handled as a special case, so `data/**/file.txt` would not match `data/file.txt` (zero directory levels). [#97676](https://github.com/ClickHouse/ClickHouse/pull/97676) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reject the `zip`/`zipx` backup archive format for backups stored on object storage — direct `S3(...)`/`AzureBlobStorage(...)` destinations and `Disk(...)` destinations backed by S3 or Azure — for both `BACKUP` and `RESTORE`. Zip requires seeking to read its central directory, which is very slow over object storage. Use a tar-based format such as `tar.gz` instead. [#101770](https://github.com/ClickHouse/ClickHouse/pull/101770) ([Yash ](https://github.com/Onyx2406)).
* Extended the supported range of `DateTime64` from `[1900-01-01, 2299-12-31]` to `[0000-01-01, 9999-12-31]`. Values outside the former range are now computed correctly (via cctz) instead of being clamped to the boundary. With precision 8 or 9 the range remains narrower because the ticks are stored as `Int64` (with nanosecond precision the maximum is still `2262-04-11`). Backward compatibility: if you used out-of-range date-times before, but relied on the very specific saturation rules inside the old range, keep in mind that now the results are changing to be more correct. [#107907](https://github.com/ClickHouse/ClickHouse/pull/107907) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `AggregatingMergeTree` now rejects, at table creation time, schemas where a column is neither part of the sorting key nor an aggregate-state measure (`AggregateFunction`/`SimpleAggregateFunction`). Such columns are silently collapsed to an arbitrary value during background merges, producing wrong results for queries that `GROUP BY` or filter on them. Set `allow_dimensions_outside_sorting_key = 1` to restore the previous behavior. Closes [#751](https://github.com/ClickHouse/ClickHouse/issues/751). [#108087](https://github.com/ClickHouse/ClickHouse/pull/108087) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Removed the config-based workload scheduling configuration (the `resources` and `workload_classifiers` server config sections). Use `CREATE RESOURCE` and `CREATE WORKLOAD` queries instead. The obsolete config sections are ignored with a warning. [#108286](https://github.com/ClickHouse/ClickHouse/pull/108286) ([Sergei Trifonov](https://github.com/serxa)).
* ClickHouse now always uses the unified insert deduplication hash for both synchronous and asynchronous inserts; the legacy per-insert deduplication behaviours are removed. The server setting `insert_deduplication_version` is kept as a migration guard: the server refuses to start if it is set to a legacy value (`old_separate_hashes` or `compatible_double_hashes`). To upgrade from a version that used a legacy value, first run a release that supports `compatible_double_hashes` (which writes both the legacy and unified hashes). For replicated tables run it for at least `replicated_deduplication_window_seconds` (one hour by default; the default windows retain the unified hashes of all inserts for that window, which is considered enough for an insert retry loop). For non-replicated tables with `non_replicated_deduplication_window` > 0 that window is count-based rather than time-based, so run `compatible_double_hashes` for at least that many inserts. Then remove the setting (or set it to `new_unified_hash`) before upgrading to this version. [#108361](https://github.com/ClickHouse/ClickHouse/pull/108361) ([Sema Checherinda](https://github.com/CheSema)). If you never set `insert_deduplication_version`, you can ignore this item.
* Removed the long-deprecated functions `snowflakeToDateTime`, `snowflakeToDateTime64`, `dateTimeToSnowflake` and `dateTime64ToSnowflake`. They were deprecated back in v24.6 in favor of `snowflakeIDToDateTime`, `snowflakeIDToDateTime64`, `dateTimeToSnowflakeID` and `dateTime64ToSnowflakeID`, which should be used instead. The setting `allow_deprecated_snowflake_conversion_functions` (which used to re-enable them) is now obsolete and has no effect. [#108711](https://github.com/ClickHouse/ClickHouse/pull/108711) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The setting `use_legacy_to_time` is now `0` by default, so `toTime` converts values into the `Time` data type instead of converting a date with time to a fixed date. The legacy behavior is still available via the `toTimeWithFixedDate` function or by setting `use_legacy_to_time = 1`. [#108729](https://github.com/ClickHouse/ClickHouse/pull/108729) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Naive Bayes models (used by `naiveBayesClassifier`) are now configured as a dictionary with the `NAIVE_BAYES` layout, built at load time from a table of pre-aggregated per-class n-gram counts, instead of the previous server-side configuration (an XML config file referencing serialized `.bin` model files), which is no longer supported — existing models must be recreated as dictionaries. Three new functions are added alongside `naiveBayesClassifier`: `naiveBayesClassifierWithProb` returns the predicted class together with its probability, `naiveBayesClassifierWithAllProbs` returns every class with its probability, and `naiveBayesNgrams` tokenizes text into n-grams the same way the dictionary does, for building the training data from raw labelled text. Additionally, several performance optimizations have been applied: on a 9.7 MiB code-point trigram language model, it uses \~49× less memory (from 1.84 GiB to 38 MiB), loads \~11× faster, and classifies \~11× faster. [#108773](https://github.com/ClickHouse/ClickHouse/pull/108773) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* The `hasColumnInTable` function no longer accepts the optional `hostname`, `username`, and `password` arguments for checking a column on an arbitrary remote server; only the `hasColumnInTable(database, table, column)` form remains. The removed remote mode was a security concern: it let any user trigger outbound connections to arbitrary hosts and leaked credentials into query logs, and it was not gated by any privilege. [#110881](https://github.com/ClickHouse/ClickHouse/pull/110881) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="267-new-feature">
  New Feature
</h4>

* Added `EXPLAIN ANALYZE` for examination of query performance: the query is executed, and the actual execution metrics are rendered in the familiar query plan format. [#106586](https://github.com/ClickHouse/ClickHouse/pull/106586) ([Kirill Kopnev](https://github.com/Fgrtue)). [#110668](https://github.com/ClickHouse/ClickHouse/pull/110668) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Added support for `WHERE` clauses in projection definitions. Projections with `WHERE` only materialize rows matching the predicate, and the optimizer can use them (cost-based) when the query's `WHERE` implies the projection's `WHERE`. [#102347](https://github.com/ClickHouse/ClickHouse/pull/102347) ([S Bala Vignesh](https://github.com/SBALAVIGNESH123)).
* Added the `skip_unavailable_shards_mode` setting (also available as a `Distributed` engine setting) to control which exceptions from a remote shard are silently ignored when `skip_unavailable_shards` is enabled. [#79091](https://github.com/ClickHouse/ClickHouse/pull/79091) ([cjw](https://github.com/byte-sourcerer)).
* Add `groupFormat` aggregate function that formats rows in each group using a specified output format and returns the result as a string. [#93201](https://github.com/ClickHouse/ClickHouse/pull/93201) ([Yang Hu](https://github.com/wandersofb)).
* Added `AWS_MSK_IAM` as a supported value for `kafka_sasl_mechanism`, enabling ClickHouse to authenticate with Amazon MSK using IAM roles without managing SASL/SCRAM credentials. [#96100](https://github.com/ClickHouse/ClickHouse/pull/96100) ([kalavt](https://github.com/kalavt)).
* Add aggregate function combinator `-Tuple`, which applies the underlying aggregate function to each element of a `Tuple` column independently and returns a `Tuple` of the results, preserving element names: `sumTuple(t)` for `t = (a, b)` returns `(sum(a), sum(b))`. Aggregate functions with several arguments take one tuple per argument, paired by position: `corrTuple((a1, a2), (b1, b2))` returns `(corr(a1, b1), corr(a2, b2))`. Unlike `-ForEach` over arrays, elements may have different types, and per-element result types and names are preserved. [#98190](https://github.com/ClickHouse/ClickHouse/pull/98190) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Text indexes now support a `postprocessor` argument — an arbitrary expression that transforms each token after tokenization (for example, `lower`). [#98939](https://github.com/ClickHouse/ClickHouse/pull/98939) ([Jimmy Aguilar Mena](https://github.com/Ergus)). [#108606](https://github.com/ClickHouse/ClickHouse/pull/108606) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Added the `system.stemmers` system table, which lists all languages that can be specified for the `stem` function. [#100611](https://github.com/ClickHouse/ClickHouse/pull/100611) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Add support for `WITH TIES` for negative `LIMIT`. [#100930](https://github.com/ClickHouse/ClickHouse/pull/100930) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Added support for the standard SQL `AT TIME ZONE` and `AT LOCAL` postfix operators as syntactic sugar for `toTimeZone`. The expression `expr AT TIME ZONE zone` is now equivalent to `toTimeZone(expr, zone)`, and `expr AT LOCAL` is equivalent to `toTimeZone(expr, timeZone())`. [#106092](https://github.com/ClickHouse/ClickHouse/pull/106092) ([lizepeng](https://github.com/lvzhipin03)).
* The `URL` table engine and `url` table function now dispatch to the appropriate backend based on the URL scheme: `file://` is served by the `File` engine, `s3://`/`gs://`/`gcs://`/`oss://` by `S3`, `az://`/`azure://`/`abfss://`/`abfs://` by `AzureBlobStorage`, `hdfs://` by `HDFS`, and `http(s)://` by the `URL` engine as before. The `url_base` setting is applied before scheme dispatch. Only the S3 schemes resolved by the default `url_scheme_mappers` are dispatched; other S3-compatible vendor schemes (`cos`, `obs`, ...) are not, and require using the `s3` engine/function directly. [#106093](https://github.com/ClickHouse/ClickHouse/pull/106093) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the `Remote` and `RemoteSecure` table engines, the persistent counterparts of the `remote` and `remoteSecure` table functions. `CREATE TABLE ... ENGINE = Remote('addresses', db, table, ...)` now works in addition to `CREATE TABLE ... AS remote(...)`. [#106189](https://github.com/ClickHouse/ClickHouse/pull/106189) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added engine-agnostic `SYSTEM STOP`, `SYSTEM START`, `SYSTEM PAUSE`, `SYSTEM CANCEL`, and `SYSTEM REFRESH` commands, and their `... ALL BACKGROUND` server-wide forms, to control the background activity of `Kafka`, `RabbitMQ`, `NATS`, `S3Queue`/`AzureQueue` tables and refreshable materialized views through one unified interface. For refreshable materialized views they alias the existing `SYSTEM ... VIEW` commands. As part of supporting these controls on NATS, JetStream tables now acknowledge messages only after a successful insert (at-least-once, previously messages were auto-acknowledged on delivery and could be lost if the insert failed). A new `nats_wait_for_flush_interval` setting (default `false`, preserving the previous low-latency behaviour) optionally keeps a consumption cycle open for the whole flush interval instead of flushing as soon as the queue drains. A new `nats_commit_on_select` setting makes a direct `SELECT` on a JetStream table consume (acknowledge) the messages it reads. [#107476](https://github.com/ClickHouse/ClickHouse/pull/107476) ([Samuel Krempaský](https://github.com/NIKTONIKTO717)).
* Added support for the `mysql`, `postgresql`, and `sqlite` table functions and table engines to accept a user's query (instead of a table name) and pass it to the external database as is, written either as a subquery `(SELECT ...)` or as `query('SELECT ...')`. The structure of the resulting table is inferred from the query result, and such a table is read-only. Closes [#46758](https://github.com/ClickHouse/ClickHouse/issues/46758). Based on the initial implementation by [Denis Vidiaev](https://github.com/the-devid) ([#79652](https://github.com/ClickHouse/ClickHouse/pull/79652)). [#107740](https://github.com/ClickHouse/ClickHouse/pull/107740) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added tabs to the ClickHouse Web UI (Play) for working with multiple queries at once. Tabs, their titles, parameters, active state, and small result snapshots are persisted across reloads (large and image results are not restored), integrate with browser history and the URL, and can be switched with the mouse wheel. [#107826](https://github.com/ClickHouse/ClickHouse/pull/107826) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Introduce the `QueryRunner` table engine. Records inserted into a `QueryRunner` table represent queries that the engine executes. The engine can be used for asynchronous query execution, batch execution of generated queries, directing queries to remote clusters, benchmarks, fuzzing, and testing with shadow traffic. [#107888](https://github.com/ClickHouse/ClickHouse/pull/107888) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add the `GeoJSON` output format for writing [GeoJSON](https://geojson.org/) `FeatureCollection` documents, producing one feature per row. The single geo-typed column (`Point`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Ring`, or `Geometry`) becomes each feature's `geometry`; a column named `id` becomes the feature `id`; and any remaining columns become the feature `properties`, where a lone object-typed column named `properties` (a `JSON`, `Map`, or named `Tuple`) is written directly as the `properties` object. A `Ring` is written as a single-ring `Polygon`. The new `format_geojson_validate_geometry` setting (enabled by default) controls whether geometries that are not valid GeoJSON shapes — such as a `Polygon` with fewer than four points or an unclosed `Polygon` ring — are rejected when reading and writing. Additionally, the `GeoJSON` input format now infers the `id` column as `Nullable(String)` instead of `String`, so a feature with an absent or explicit `"id": null` member is read as `NULL` and kept distinct from an empty string `""`. Based on the initial implementation by [Mark Needham](https://github.com/mneedham) ([#98124](https://github.com/ClickHouse/ClickHouse/pull/98124)). [#108065](https://github.com/ClickHouse/ClickHouse/pull/108065) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Added the `dotProductTransposed` function (alias `scalarProductTransposed`) that computes the approximate inner product between a `QBit` column and a reference vector, complementing the existing `L2DistanceTransposed` and `cosineDistanceTransposed` functions. [#108100](https://github.com/ClickHouse/ClickHouse/pull/108100) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Added quantized transposed distance functions `cosineDistanceTransposedQuantized`, `L2DistanceTransposedQuantized` and `dotProductTransposedQuantized` that operate on a `QBit(Int8)` of `quantizeBFloat16ToInt8` Lloyd-Max codes, dequantizing the stored codes on the fly. A floating-point reference vector is the full-precision query, compared at `Float32` precision (a `Float64` query is narrowed); an `Array(Int8)` reference is itself dequantized, for a symmetric quantized-vs-quantized distance. [#109405](https://github.com/ClickHouse/ClickHouse/pull/109405) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added an optional stride parameter to the `QBit` data type (`QBit(T, dimension, stride)`) that stores groups of dimensions in separate streams, so a vector search can read only the first dimensions efficiently (e.g. for Matryoshka embeddings). The transposed distance functions accept an optional fourth `used_dims` argument to read a reduced number of dimensions. [#108103](https://github.com/ClickHouse/ClickHouse/pull/108103) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added support for the `Int8` element type in the `QBit` data type, enabling storage and transposed-distance vector search (`L2DistanceTransposed`, `cosineDistanceTransposed`) over quantized 8-bit integer vectors. [#108105](https://github.com/ClickHouse/ClickHouse/pull/108105) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* New function `randomHadamardTransform(vector[, seed[, output_dims]])`: a deterministic randomized Hadamard transform of a float vector — an orthogonal, norm-preserving rotation useful for preprocessing embeddings before quantization, and (when truncated) as a Johnson–Lindenstrauss / subsampled-randomized-Hadamard random projection. [#108227](https://github.com/ClickHouse/ClickHouse/pull/108227) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support configuring lazy loading of dictionaries on a per-dictionary basis with the `dictionary_lazy_load` setting in the dictionary definition, overriding the global `dictionaries_lazy_load` server setting, so that some dictionaries can be loaded lazily while others are loaded eagerly. [#108314](https://github.com/ClickHouse/ClickHouse/pull/108314) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Added a built-in documentation search page, available at the `/docs` path of the HTTP interface, that provides instant search over the `system.documentation` table and renders the reference documentation (with syntax highlighting, math, and cross-links). [#108345](https://github.com/ClickHouse/ClickHouse/pull/108345) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added function `xxHash64Spark`, which computes Spark-compatible `xxHash64` values for `String` and `NULL` inputs using seed `42` and returns `Int64`. [#108436](https://github.com/ClickHouse/ClickHouse/pull/108436) ([Lalit Yadav](https://github.com/lalitium)).
* `ALTER USER`, `ALTER ROLE` and `ALTER SETTINGS PROFILE` now accept `SET name = value` as an alias for `MODIFY SETTING name = value`. It changes individual settings in place while keeping the rest, unlike the bare `SETTINGS` clause which replaces the whole settings list. This makes it less likely to accidentally wipe a user's other settings. [#108722](https://github.com/ClickHouse/ClickHouse/pull/108722) ([Groene AI](https://github.com/groeneai)).
* Support `ALTER TABLE ... MODIFY CONSTRAINT [IF EXISTS] name CHECK expr` to change the expression of an existing constraint in place. [#108768](https://github.com/ClickHouse/ClickHouse/pull/108768) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: added a per-column color coding switch (the 🌈 icon in a column header) to toggle between bar, heatmap, categorical, and no visualization. The selected modes are remembered in the URL and browser history. [#108873](https://github.com/ClickHouse/ClickHouse/pull/108873) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `Keeper` now correctly handles `ZooKeeper`'s `CreateContainer` opcode (19), gated behind a new opt-in `create_container` feature flag (disabled by default, like `create_ttl`). Once enabled after a full ensemble upgrade, external `ZooKeeper` clients (e.g. Java `ZooKeeper` 3.9+) can create container nodes against `Keeper` instead of getting `ConnectionLoss`; container nodes report the expected `ephemeralOwner` sentinel value, and a background GC thread on the leader auto-deletes childless containers. A plain `Create` request carrying the `CONTAINER` create-mode flag without opcode 19 continues to be rejected (`ZBADARGUMENTS`): no known `ZooKeeper` client emits that combination. This is server-side protocol compatibility only: ClickHouse's own `ZooKeeper` client (`zkutil`) is unchanged and has no API to create container nodes itself. [#108908](https://github.com/ClickHouse/ClickHouse/pull/108908) ([unintended](https://github.com/unintended)).
* Added functions `geoToUTM`, `UTMToGeo`, `geoToMGRS` and `MGRSToGeo` for converting between WGS84 geographic coordinates and the UTM and MGRS coordinate systems. [#108939](https://github.com/ClickHouse/ClickHouse/pull/108939) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the `digits(n, offset[, length])` function, which returns the digits of `n` starting at the 1-based `offset` and spanning `length` digits, or to the end of the number if `length` is omitted. [#109012](https://github.com/ClickHouse/ClickHouse/pull/109012) ([Umang Agrawal](https://github.com/1000ms)).
* Add the `sqr` arithmetic function for calculating the square of a number. [#109061](https://github.com/ClickHouse/ClickHouse/pull/109061) ([Lalit Yadav](https://github.com/lalitium)).
* Added a new function `dictGetRoot` which returns the topmost ancestor (the root) of a key in a hierarchical dictionary. It is a convenient equivalent of `dictGetHierarchy(dict_name, key)[-1]`. [#109459](https://github.com/ClickHouse/ClickHouse/pull/109459) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `SYSTEM UNLOAD DICTIONARY` and `SYSTEM UNLOAD DICTIONARIES` commands to release dictionary memory without dropping the dictionary definition. Dictionaries will be reloaded lazily on the next access. [#109639](https://github.com/ClickHouse/ClickHouse/pull/109639) ([Matheus Nerone](https://github.com/Manerone)).
* Added functions `geometryIntersectCartesian` and `geometryIntersectSpherical` that return whether two geometries intersect. Unlike `polygonsIntersectCartesian`/`polygonsIntersectSpherical`, they accept any geometry data type (`Point`, `LineString`, `MultiLineString`, `Ring`, `Polygon`, `MultiPolygon`), including the common `Geometry` type, and the two arguments may be of different types. [#110062](https://github.com/ClickHouse/ClickHouse/pull/110062) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Query parameters (`{name:Type}` substitutions) can now be used as setting values, both in the `SETTINGS` clause of a query (such as `SELECT` or `INSERT`) and in standalone `SET` queries, e.g., `SELECT ... SETTINGS max_threads = {threads:UInt64}` and `SET max_threads = {threads:UInt64}`. [#108760](https://github.com/ClickHouse/ClickHouse/pull/108760) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="267-experimental-feature">
  Experimental Feature
</h4>

* Wildcard expansion for the `url` table function and the `URL` table engine: wildcards in the URL path are expanded by listing HTTP index pages (HTML or plaintext directory listings) and extracting matching URLs, with limits on the index page size and on the number of directories read. Enabled by the `allow_experimental_url_wildcard_from_index_pages` setting. [#95181](https://github.com/ClickHouse/ClickHouse/pull/95181) ([Yue Ni](https://github.com/niyue)).
* Text indexes can now store token positions (the `support_phrase_search` index argument) to enable exact phrase matching with direct reads for the `hasPhrase` function. Requires enabling the `MergeTree` setting `allow_experimental_text_index_phrase_search`. [#103172](https://github.com/ClickHouse/ClickHouse/pull/103172) ([Elmi Ahmadov](https://github.com/ahmadov)). The argument was initially introduced under the name `positions`. [#109900](https://github.com/ClickHouse/ClickHouse/pull/109900) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Support manifest file compaction for `Iceberg` tables via `OPTIMIZE TABLE ... MANIFEST` (guarded by the `allow_experimental_iceberg_compaction` setting). Closes [#95174](https://github.com/ClickHouse/ClickHouse/issues/95174). [#98178](https://github.com/ClickHouse/ClickHouse/pull/98178) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)). Fix `OPTIMIZE TABLE ... MANIFEST` for `Iceberg` tables when manifest partition tuples do not match their partition spec. [#111368](https://github.com/ClickHouse/ClickHouse/pull/111368) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Add a Real Doubles (RD) variant and an optional `ALP(AUTO|STD|RD)` argument to the experimental `ALP` codec. Bare `ALP` now auto-selects between the existing `STD` scheme and `RD` instead of always using `STD`. [#99654](https://github.com/ClickHouse/ClickHouse/pull/99654) ([Nazarii Piontko](https://github.com/nazarii-piontko)).
* Add an in-memory SLRU cache for deserialized `Paimon` metadata files (manifest lists and manifests). When enabled via the `use_paimon_metadata_files_cache` setting, repeated queries against the same `Paimon` table skip re-downloading and re-parsing metadata from object storage. [#104657](https://github.com/ClickHouse/ClickHouse/pull/104657) ([XiaoBinMu](https://github.com/Binnn-MX)).
* Added "drivers" for executable user-defined functions. A driver declared in `<user_defined_executable_function_drivers_config>` can be used in `CREATE FUNCTION name ARGUMENTS (...) RETURNS T ENGINE = DriverName(...) AS '...code...'` to compile or otherwise process a user code snippet at function-creation time and produce a runnable executable UDF. The resulting configuration is stored in `<dynamic_user_defined_executable_functions_path>`, and the originating query is persisted as `ATTACH FUNCTION` so the function survives server restarts. A proof-of-concept `c_function_body` driver compiles and runs C function bodies inside sandboxed Docker containers in `executable_pool` mode. Based on the initial implementation by [Daniil Timižev](https://github.com/dahbka-lis) ([#77128](https://github.com/ClickHouse/ClickHouse/pull/77128)). [#105131](https://github.com/ClickHouse/ClickHouse/pull/105131) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Serve `SELECT count(*) FROM t WHERE col <op> default(col)` from per-column sparsity statistics in `serialization.json` without any data scan when the predicate exactly partitions the column into defaults and non-defaults (under the new experimental setting `optimize_trivial_count_with_sparsity_filter`, off by default). [#105890](https://github.com/ClickHouse/ClickHouse/pull/105890) ([Raúl Marín](https://github.com/Algunenano)).
* Prometheus Query API requests to `/api/v1/query` and `/api/v1/query_range` are now recorded in `system.query_log` with `read_rows` and `read_bytes` metrics. [#106611](https://github.com/ClickHouse/ClickHouse/pull/106611) ([James Cunningham](https://github.com/JTCunning)).
* The experimental `ReaderExecutor` read path (`use_reader_executor`, off by default) can now hold a remote source connection open and reuse it across sequential reads, reducing the number of object storage requests on scans. [#107735](https://github.com/ClickHouse/ClickHouse/pull/107735) ([Sema Checherinda](https://github.com/CheSema)). It now also supports reading encrypted files, with a global encryption-header cache configured by the `encryption_header_cache_size` server setting and cleared by `SYSTEM DROP ENCRYPTION HEADERS CACHE`. [#109702](https://github.com/ClickHouse/ClickHouse/pull/109702) ([Sema Checherinda](https://github.com/CheSema)).
* Support distributed query-plan reads for `SELECT ... FINAL` on `MergeTree`-family tables when `make_distributed_plan` is enabled. [#108148](https://github.com/ClickHouse/ClickHouse/pull/108148) ([Alexander Gololobov](https://github.com/davenger)).
* Add experimental plan-based parallel replicas execution for `MergeTree` queries. [#108504](https://github.com/ClickHouse/ClickHouse/pull/108504) ([Igor Nikonov](https://github.com/devcrafter)).
* Added the experimental `Quantize` vector codec family and an opt-in two-stage approximate vector-search rewrite over quantized companion streams. [#108565](https://github.com/ClickHouse/ClickHouse/pull/108565) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Revive the experimental `SZ3` error-bounded lossy compression codec for `Float32`/`Float64` (and arrays of them) columns, originally implemented by [Konstantin Vedernikov](https://github.com/scanhex12) ([#83088](https://github.com/ClickHouse/ClickHouse/pull/83088)). It requires `allow_experimental_codecs`. [#108788](https://github.com/ClickHouse/ClickHouse/pull/108788) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Fixed reading data compressed with `SZ3('ALGO_LORENZO_REG', ...)`, which previously failed with `CORRUPTED_DATA`, and avoided undefined behavior when compressing non-finite floating-point values (`NaN` and infinities). [#110762](https://github.com/ClickHouse/ClickHouse/pull/110762) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the experimental `ZXC` codec — an asymmetric LZ codec with slow compression and very fast decompression, with a compression ratio between `LZ4` and `ZSTD`. It requires `allow_experimental_codecs = 1`, and `system.compression_codecs` reports it as experimental. [#110620](https://github.com/ClickHouse/ClickHouse/pull/110620) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#111007](https://github.com/ClickHouse/ClickHouse/pull/111007) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* You can now authenticate to OneLake using a pre-obtained bearer token via the `onelake_bearer_token` setting, instead of a `onelake_client_id` and `onelake_client_secret`. This avoids sharing a long-lived client secret. The token is not refreshed, so the database must be recreated once it expires. [#109104](https://github.com/ClickHouse/ClickHouse/pull/109104) ([Asya Shneerson](https://github.com/asya-ch)).
* AI functions no longer take the named collection as the first positional argument. Credentials come from the `ai_function_text_default_credentials` / `ai_function_embedding_default_credentials` settings or from a `credentials` key in an optional trailing `Map(String, String)` argument, which also carries tunables (`model`, `max_tokens`, `temperature`, `system_prompt`, `instructions`, `dimensions`). [#109232](https://github.com/ClickHouse/ClickHouse/pull/109232) ([George Larionov](https://github.com/george-larionov)). The `aiEmbed` function now takes `model` as a required positional argument (`aiEmbed(text, model[, params])`) instead of reading it from the named collection, which ensures reproducibility for embeddings. [#110619](https://github.com/ClickHouse/ClickHouse/pull/110619) ([George Larionov](https://github.com/george-larionov)).
* Fix `data_uncompressed_bytes` for skip indices packed into `skp_idx.packed` (via `packed_skip_index_max_bytes`): the reported uncompressed size was the compressed size, which could also prevent `distributed_index_analysis` from activating. [#109272](https://github.com/ClickHouse/ClickHouse/pull/109272) ([Raúl Marín](https://github.com/Algunenano)).
* Added experimental packed data part storage for `MergeTree` tables, which stores most of a part's files in a single `data.packed` archive instead of a file per stream (projections and a few service files, such as `txn_version.txt`, are still written separately). It is controlled by the `min_bytes_for_full_part_storage`, `min_rows_for_full_part_storage`, and `min_level_for_full_part_storage` settings and is disabled by default. Once a table writes packed parts, older server versions cannot read them, so enabling this format prevents downgrading the server. [#108118](https://github.com/ClickHouse/ClickHouse/pull/108118) ([Raúl Marín](https://github.com/Algunenano)).
* Added an experimental table function `eval`, which evaluates a constant expression to a query string and executes the resulting single `SELECT` query. The feature is disabled by default and can be enabled with the setting `allow_experimental_eval_table_function`. Author: [Yue Ni](https://github.com/niyue). [#110132](https://github.com/ClickHouse/ClickHouse/pull/110132) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `zstd` compression support to the experimental Prometheus remote-write v1 HTTP handler. [#110907](https://github.com/ClickHouse/ClickHouse/pull/110907) ([James Cunningham](https://github.com/JTCunning)).
* Writing to `DeltaLake` tables (the `allow_experimental_delta_lake_writes` setting) was promoted to Beta. [#107034](https://github.com/ClickHouse/ClickHouse/pull/107034) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Added `ProfileEvents` `DistributedPlanRemoteTasks`, `DistributedPlanLocalExecution`, and `DistributedPlanHostsUsed` to observe the execution of experimental distributed query plans (`make_distributed_plan`). [#107985](https://github.com/ClickHouse/ClickHouse/pull/107985) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Removed the experimental RocksDB-based storage in Keeper (`experimental_use_rocksdb`). A better new on-disk storage is coming soon. [#108000](https://github.com/ClickHouse/ClickHouse/pull/108000) ([Michael Kolupaev](https://github.com/al13n321)).
* Distributed index analysis (an experimental feature controlled by the `distributed_index_analysis` setting) now sends big lists of data part names to remote servers as scalars instead of embedding them into the query text. This avoids possible failures due to the `max_ast_elements` / `max_query_size` limits and removes the AST parsing overhead. [#110419](https://github.com/ClickHouse/ClickHouse/pull/110419) ([Azat Khuzhin](https://github.com/azat)).
* Optimize the experimental `timeSeries*ToGrid` aggregation functions: buckets are now aligned to both step and window, and the final aggregation is much faster when the window is much larger than the step. The serialization format of the aggregation state was changed in an incompatible way (these functions are experimental). [#106724](https://github.com/ClickHouse/ClickHouse/pull/106724) ([Vitaly Baranov](https://github.com/vitlibar)).
* External target tables of a `TimeSeries` table are now registered as referential dependencies: similarly to materialized views, this disallows dropping an external target table before dropping the `TimeSeries` table that references it (if `check_referential_table_dependencies` is enabled). [#108388](https://github.com/ClickHouse/ClickHouse/pull/108388) ([Vitaly Baranov](https://github.com/vitlibar)).
* Add the PromQL function `increase`. [#111023](https://github.com/ClickHouse/ClickHouse/pull/111023) ([Vitaly Baranov](https://github.com/vitlibar)).

<h4 id="267-performance-improvement">
  Performance Improvement
</h4>

* `JOIN`s can now use the primary key index or skip indexes on the left-hand side table to prune granules. Controlled by the setting `enable_join_runtime_filters_index_analysis`. [#109085](https://github.com/ClickHouse/ClickHouse/pull/109085) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Serialization and deserialization of vectors of trivially serializable types now use a single buffer I/O call instead of processing individual elements. [#89842](https://github.com/ClickHouse/ClickHouse/pull/89842) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Optimize inverse dictionary lookups: a constant equality predicate such as `WHERE dictGet(dict, attr, key_expr) = value` is now constant-folded directly into a key filter (`key_expr = const`, `key_expr IN [...]`, or `WHERE 0`) instead of being rewritten to an `IN (SELECT ... FROM dictionary(...))` subquery, and the constant path of `dictGetKeys` now executes in parallel. [#91164](https://github.com/ClickHouse/ClickHouse/pull/91164) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Add a new setting `merge_tree_generic_exclusion_search_max_steps` that limits the number of steps the generic exclusion search algorithm spends analyzing the primary key index of each data part. The budget is spent on the largest remaining key ranges first, so even a small budget prunes the bulk of the data; ranges that were not fully analyzed are read whole, so query results stay correct but more granules may be read. The limit is applied loosely: it may be exceeded by at most `merge_tree_coarse_index_granularity` steps, plus one step for each range the part is already divided into (for example, by the query condition cache). The default value 0 means unlimited steps. [#92779](https://github.com/ClickHouse/ClickHouse/pull/92779) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Queries with `ORDER BY` and `LIMIT` on views over `Distributed` tables now use the merge-sorted-streams optimization: the outer `ORDER BY`/`LIMIT` is pushed into a simple view's inner query, so each shard sorts its data locally and the coordinator merges pre-sorted streams instead of performing a full sort. [#94102](https://github.com/ClickHouse/ClickHouse/pull/94102) ([matanper](https://github.com/matanper)).
* Enable `optimize_or_like_chain` by default. Closes [#87779](https://github.com/ClickHouse/ClickHouse/issues/87779). [#94517](https://github.com/ClickHouse/ClickHouse/pull/94517) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Mark rotated non-replicated `MergeTree` system log tables without TTL as `table_readonly` to avoid unnecessary background operations. The `table_readonly` `MergeTree` setting now also suppresses all background work on a plain `MergeTree` table — regular, TTL (`DELETE`/`MOVE`/recompression) and recompression merges, background mutations, and background part moves — and rejects the mutating partition commands (`ATTACH`/`MOVE`/`DROP`/`DROP DETACHED`/`FETCH`/`REPLACE PARTITION` and `MOVE PARTITION ... TO TABLE` into the table), in addition to the inserts, mutations, and `OPTIMIZE` it already rejected. As a result, a `table_readonly` table with a TTL no longer reclaims its expired data while the setting is enabled. [#95079](https://github.com/ClickHouse/ClickHouse/pull/95079) ([Mathuranath Metivier](https://github.com/matt-metivier)).
* Improve the performance of fetching a single user record from `system.users` when the server has many users. [#96699](https://github.com/ClickHouse/ClickHouse/pull/96699) ([Alistair Evans](https://github.com/alistairjevans)).
* Reading in order with parallel replicas now uses the same logic of splitting the table into `max_threads` parts as local reading, for better parallelism. [#101434](https://github.com/ClickHouse/ClickHouse/pull/101434) ([Nikita Taranov](https://github.com/nickitat)).
* Use partition minmax index bounds to prune more granules during primary key analysis for `MergeTree` tables, when a primary key column is also an input column of the partition key. For example, in a `MergeTree` table with `ORDER BY (id, event_time)` and `PARTITION BY toYYYYMM(event_time)`, ClickHouse will use the partition minmax index on `event_time` during primary key index analysis to make more informed granule-pruning decisions. Controlled by the new setting `use_partition_minmax_for_primary_key_pruning` (enabled by default). [#103480](https://github.com/ClickHouse/ClickHouse/pull/103480) ([UnamedRus](https://github.com/UnamedRus)).
* Enable the query condition cache for queries that use Top-K dynamic filtering (`ORDER BY ... LIMIT n`). The cache entry is partitioned by the Top-K plan parameters, so the same query reuses cached `WHERE` filter results, while a different `LIMIT`, sort column, or sort direction produces a fresh entry. [#104478](https://github.com/ClickHouse/ClickHouse/pull/104478) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the `use_constant_folding_in_index_analysis` setting (disabled by default). When enabled, `MergeTree` primary-key, `MinMax`, and skip-index analysis fold partition-level constants into the filter predicate separately for each part, improving pruning for filters whose branches depend on partition values, e.g. `(a = 1 AND b >= 1) OR (a = 2 AND b > 10)` with `PARTITION BY a`. [#104582](https://github.com/ClickHouse/ClickHouse/pull/104582) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Push `LIMIT` into aggregation-in-order to enable early termination when the `GROUP BY` key matches the `ORDER BY` key and the table sorting key, significantly reducing the number of rows read. [#104859](https://github.com/ClickHouse/ClickHouse/pull/104859) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Updating profile events is now up to 30 times faster, using per-CPU atomics for server-wide and per-user counters. Controlled by the `user_profile_events_per_cpu` server setting (it uses around 640 KiB per user on 64 cores, so with a very large number of users it may make sense to keep it disabled). [#105056](https://github.com/ClickHouse/ClickHouse/pull/105056) ([Azat Khuzhin](https://github.com/azat)).
* Enable `allow_aggregate_partitions_independently` by default. When a `GROUP BY` key suits the partition key, ClickHouse can aggregate each partition independently and skip the global merging step. Runtime heuristics automatically skip the optimization when the partition layout would make it unfavorable (too few partitions, too many partitions, or significantly skewed partition sizes). [#105128](https://github.com/ClickHouse/ClickHouse/pull/105128) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Vector search queries with rescoring (`vector_search_with_rescoring = 1`) now compute the exact distance only for the rows returned by the vector index, applying an exact row-position filter instead of brute-force rescoring neighbouring rows from the same `MergeTree` granule. [#105591](https://github.com/ClickHouse/ClickHouse/pull/105591) ([Sergey Kuznetsov](https://github.com/skuznetsov)). [#108846](https://github.com/ClickHouse/ClickHouse/pull/108846) ([Sergey Kuznetsov](https://github.com/skuznetsov)).
* Improve the performance of the `partial_merge` join algorithm on `FixedString` keys by comparing runs of values at once instead of one comparison call per value. [#105737](https://github.com/ClickHouse/ClickHouse/pull/105737) ([Artem Zuikov](https://github.com/4ertus2)).
* `SHOW TABLES` and `system.tables` on data lake catalogs (Iceberg REST, Glue, Unity, Hive, Paimon) now push namespace-bound predicates down to the catalog, avoiding a full catalog scan. Closes [#105022](https://github.com/ClickHouse/ClickHouse/issues/105022). [#106029](https://github.com/ClickHouse/ClickHouse/pull/106029) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Bound untracked memory per CPU to avoid overcommit and out-of-memory errors (the limits are configured with the `max_per_cpu_untracked_memory` and `per_cpu_untracked_memory_thread_buffer` server settings). [#106055](https://github.com/ClickHouse/ClickHouse/pull/106055) ([Azat Khuzhin](https://github.com/azat)).
* Speed up operators that scan a sorted stream for runs of equal key values — `DISTINCT` in order, `LIMIT BY` in order, negative `LIMIT BY` in order, `full_sorting_merge` and `partial_merge` joins. [#106502](https://github.com/ClickHouse/ClickHouse/pull/106502) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Implemented a native reader and writer for the `Arrow` and `ArrowStream` formats that does not use the Apache Arrow library, avoiding extra data copies and conversions. It is now the default (settings `input_format_arrow_use_native_reader` and `output_format_arrow_use_native_writer`) and is faster for both reading and writing. [#106522](https://github.com/ClickHouse/ClickHouse/pull/106522) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Re-enable LTO for jemalloc after fixing a thread-cache corruption that appeared with LTO, which improves performance. [#106898](https://github.com/ClickHouse/ClickHouse/pull/106898) ([Azat Khuzhin](https://github.com/azat)).
* Reduced memory usage and improved the performance of `JOIN`s. The right-hand side of a hash join now uses a compact 8-byte index-based row reference, so the hash-table entries of `ALL` joins are as small as those of `ANY` joins for every key type. Benchmarked on large `parallel_hash` join queries — `INNER` and `ANY` joins of 100–300 million row tables on `UInt64` and `String` keys, with both unique and duplicated keys: the median query became about 12% faster and used about 15% less peak memory, with no query becoming slower. `INNER` joins on `UInt64` keys gained the most (median about 21% faster with 38% less memory). [#107189](https://github.com/ClickHouse/ClickHouse/pull/107189) ([Harikrishnan Prabakaran](https://github.com/harikrishnan94)).
* Single-column non-Nullable `LowCardinality(String)` join keys are now natively supported in the hash join. [#107264](https://github.com/ClickHouse/ClickHouse/pull/107264) ([Nikita Taranov](https://github.com/nickitat)).
* Added the `dpsub` join-order enumeration algorithm (dynamic programming over subsets), providing optimal join plans with lower optimization overhead than `dpsize` and support for non-inner joins. [#107351](https://github.com/ClickHouse/ClickHouse/pull/107351) ([Fisnik Kastrati](https://github.com/fkastrati)).
* Speed up filesystem cache loading on startup by encoding each cache file's size in its name (`<offset>_<size>`), avoiding a `stat` per file. Loading of cache files written by older versions remains supported. [#107415](https://github.com/ClickHouse/ClickHouse/pull/107415) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve the performance of `arrayElement` on `Array(LowCardinality(String))` and of the map `LIKE` functions on `Map`s with `LowCardinality(String)` keys or values, by avoiding unnecessary string materialization. [#107450](https://github.com/ClickHouse/ClickHouse/pull/107450) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Avoid converting single-level aggregation to two-level aggregation when memory usage is small, by tracking the memory of the aggregation state itself instead of the memory of the whole query. [#107490](https://github.com/ClickHouse/ClickHouse/pull/107490) ([Hechem Selmi](https://github.com/m-selmi)).
* Speed up analysis of aggregating queries: the cache key for the aggregation hash-table size statistics is now computed from the query plan instead of building the full query AST. [#107643](https://github.com/ClickHouse/ClickHouse/pull/107643) ([Dmitry Novik](https://github.com/novikd)).
* Improve the performance of `INTERSECT ALL` and `EXCEPT ALL` (the default mode for `INTERSECT` and `EXCEPT`) by several times, by keying the multiset on the row value instead of hashing each row with SipHash. [#107649](https://github.com/ClickHouse/ClickHouse/pull/107649) ([Raúl Marín](https://github.com/Algunenano)).
* Rebuild row policy filters without holding the cache lock, improving query scalability under concurrent `CREATE ROW POLICY` and `DROP ROW POLICY`. [#107917](https://github.com/ClickHouse/ClickHouse/pull/107917) ([Azat Khuzhin](https://github.com/azat)).
* Speed up the `match`, `extract`, `extractAll`, `replaceRegexpOne` and `replaceRegexpAll` functions for simple regular expressions by compiling them to native code with LLVM. Controlled by the new setting `compile_regular_expressions` (enabled by default); patterns outside the supported subset transparently fall back to the RE2 engine. [#108004](https://github.com/ClickHouse/ClickHouse/pull/108004) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Sped up ZSTD decompression on AArch64 (ARM) for columns with small match offsets, such as fixed-width integer columns, by vectorizing short-offset overlapping copies with NEON. For example, decompression of a `UInt64` column is up to \~2.3x faster on AWS Graviton 4. [#108049](https://github.com/ClickHouse/ClickHouse/pull/108049) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Use the `libdeflate` library for gzip/zlib/deflate compression and decompression, making it faster (compression \~1.15× with a better ratio, decompression \~1.4–1.5×) for `.gz`/HTTP/`url`/`s3` data and the Parquet GZIP codec. [#108074](https://github.com/ClickHouse/ClickHouse/pull/108074) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improved performance of text-search queries combined with a primary key filter. [#108114](https://github.com/ClickHouse/ClickHouse/pull/108114) ([Anton Popov](https://github.com/CurtizJ)).
* Use runtime statistics collected during the first run of a query to optimize subsequent runs: the `hash` join algorithm can automatically switch to `parallel_hash` based on the collected statistics. [#108125](https://github.com/ClickHouse/ClickHouse/pull/108125) ([Hechem Selmi](https://github.com/m-selmi)). The size of join runtime filters is optimized using the hash table size from runtime join statistics, controlled by the new setting `join_runtime_filter_size_from_hash_table_stats`. [#108313](https://github.com/ClickHouse/ClickHouse/pull/108313) ([Hechem Selmi](https://github.com/m-selmi)).
* LZ4 decompression speed was improved for fixed-size, low-cardinality columns. [#108175](https://github.com/ClickHouse/ClickHouse/pull/108175) ([Nikita Taranov](https://github.com/nickitat)).
* Speed up the default-whitespace `trimLeft`/`trimRight`/`trimBoth` functions (and their aliases `ltrim`/`rtrim`/`trim`): consecutive rows that need no trimming are copied in a single batch, and the per-row space scan runs only for rows that actually have a leading or trailing space. [#108177](https://github.com/ClickHouse/ClickHouse/pull/108177) ([Groene AI](https://github.com/groeneai)).
* Improve the performance of `replaceAll` and `replaceRegexpAll` when the pattern is a single character and the replacement is a single character (for example `replaceRegexpAll(s, ' ', '_')`). Such replacements no longer change the string layout, so the column is now copied once and matching bytes are rewritten in place instead of running a per-match search loop. [#108178](https://github.com/ClickHouse/ClickHouse/pull/108178) ([Groene AI](https://github.com/groeneai)).
* Improve performance of the `pointInPolygon` function with a constant polygon. The preprocessed-polygon cache is now keyed on the raw constant arguments, so a constant polygon is parsed only once (on a cache miss) instead of being re-parsed on every input block. [#108184](https://github.com/ClickHouse/ClickHouse/pull/108184) ([Groene AI](https://github.com/groeneai)).
* Speed up parsing of the canonical `YYYY-MM-DD hh:mm:ss` date-time representation in best-effort mode (`date_time_input_format = 'best_effort'`, `cast_string_to_date_time_mode = 'best_effort'`), which is the default. This recovers a parsing performance regression introduced when those defaults were switched from `basic` to `best_effort`. [#108187](https://github.com/ClickHouse/ClickHouse/pull/108187) ([Groene AI](https://github.com/groeneai)).
* Avoid maintaining `system.predicate_statistics_log` selectivity counters on the `MergeTree` read path when the feature is disabled (`predicate_statistics_sample_rate = 0`, the default). This removes a per-granule atomic update and an `O(rows)` filter popcount from every read, recovering a performance regression that was most visible on AArch64. [#108190](https://github.com/ClickHouse/ClickHouse/pull/108190) ([Groene AI](https://github.com/groeneai)).
* Speed up parsing of floating-point numbers from text with `precise_float_parsing = 1`, making it as fast as or faster than the default parser on almost all inputs. Also bumps the bundled `fast_float` library to v8.2.10. [#108205](https://github.com/ClickHouse/ClickHouse/pull/108205) ([Raúl Marín](https://github.com/Algunenano)).
* Use the `simdutf` library for base64 encoding and decoding functions, improving their performance. [#108333](https://github.com/ClickHouse/ClickHouse/pull/108333) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Optimize `DISTINCT` for expensive high-cardinality keys. [#108366](https://github.com/ClickHouse/ClickHouse/pull/108366) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* On non-Linux builds (macOS and FreeBSD), jemalloc no longer purges dirty pages eagerly (a `madvise` syscall per `free`); it now uses a background purging thread with a finite `dirty_decay_ms`, like on Linux. This significantly speeds up allocation-churning workloads such as recursive CTEs (\~2x on a recursive-CTE benchmark on macOS) with negligible RSS impact. [#108430](https://github.com/ClickHouse/ClickHouse/pull/108430) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Speed up query planning under the analyzer for expressions that reference the same `WITH` alias or repeat the same subexpression many times (for example deeply nested `if`/`multiIf` chains), by not rebuilding shared subexpressions when constructing the actions DAG. [#108523](https://github.com/ClickHouse/ClickHouse/pull/108523) ([Dmitry Novik](https://github.com/novikd)).
* Runtime filters are now built on equality keys even when the `ON` clause also contains non-equality predicates, reducing the number of rows entering the hash join for joins that mix equality and non-equality conditions. `LEFT ANTI JOIN` is unaffected. [#108579](https://github.com/ClickHouse/ClickHouse/pull/108579) ([Antonio Álvarez Caballero](https://github.com/29antonioac)).
* Enable `-fno-math-errno` globally across the codebase, which allows the compiler to optimize math functions better. [#108628](https://github.com/ClickHouse/ClickHouse/pull/108628) ([Nikita Taranov](https://github.com/nickitat)).
* Lower the software-prefetch threshold for aggregation and join hash tables from `4 * L2 cache size` to `L2 cache size`, so prefetch is enabled once the hash table no longer fits in L2. This recovers a regression on `GROUP BY` and `JOIN` over medium-sized hash tables (\~1-8 MiB) on platforms whose reported L2 is large (e.g. AArch64 with a 2 MiB L2). [#108655](https://github.com/ClickHouse/ClickHouse/pull/108655) ([Groene AI](https://github.com/groeneai)).
* Improve window function performance. Window queries over wide tables that include `SELECT *` now use significantly less memory and run faster. Window aggregates, including `quantile*`, `uniq*`, and `groupArray`, are faster with `OVER ()` and `OVER (ORDER BY ... RANGE ...)`. The `cume_dist` function is also faster, and windows using `PARTITION BY` or `ORDER BY` now perform better on columns with many repeated values. [#108688](https://github.com/ClickHouse/ClickHouse/pull/108688) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Sped up query analysis for queries with many or very large `AND`-chains of comparisons: the `optimize_and_compare_chain` optimization is now bounded by a work budget (new setting `optimize_and_compare_chain_max_hash_work`) instead of hashing a large fraction of the query tree, and lambda resolution no longer recomputes lambda-body hashes for its recursion guard. [#108757](https://github.com/ClickHouse/ClickHouse/pull/108757) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a performance regression when reading `JSON`/`Dynamic` columns with multiple threads: a per-value lookup of the `input_format_binary_max_type_complexity` setting caused reference-count contention on the shared query context, serializing parallel reads; the setting value is now cached per thread. [#108797](https://github.com/ClickHouse/ClickHouse/pull/108797) ([Seva Potapov](https://github.com/seva-potapov)).
* Fixed a performance regression (introduced in [#71781](https://github.com/ClickHouse/ClickHouse/issues/71781)) where reading many small files from object storage via the `s3` and other table functions stopped prefetching and fell back to synchronous reads, significantly slowing single-threaded and low-concurrency reads of lots of tiny files. [#108872](https://github.com/ClickHouse/ClickHouse/pull/108872) ([Nikita Fomichev](https://github.com/fm4v)). The initial small-object prefetch is now also issued when object storage reads go through the filesystem cache (`filesystem_cache_name`), so reads of many small files (e.g. `S3Queue` ingestion) with the cache enabled are no longer synchronous and latency-bound. [#109478](https://github.com/ClickHouse/ClickHouse/pull/109478) ([Nikita Fomichev](https://github.com/fm4v)).
* Parse deeply nested array and tuple literals in linear instead of quadratic time. [#108892](https://github.com/ClickHouse/ClickHouse/pull/108892) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduce the overhead coming from lock contention in the `parallel_hash` join algorithm. [#108938](https://github.com/ClickHouse/ClickHouse/pull/108938) ([Hechem Selmi](https://github.com/m-selmi)).
* Speed up `estimateCompressionRatio` for `T64`-encoded columns by computing the compressed size analytically instead of compressing. [#109054](https://github.com/ClickHouse/ClickHouse/pull/109054) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Remove a single-threaded bottleneck in the shuffle step of distributed query plans: each upstream stream now scatters its rows by destination bucket independently instead of funneling the whole data stream through a single transform. [#109206](https://github.com/ClickHouse/ClickHouse/pull/109206) ([Alexander Gololobov](https://github.com/davenger)).
* Reduced Keeper server idle CPU usage. [#109255](https://github.com/ClickHouse/ClickHouse/pull/109255) ([Michael Kolupaev](https://github.com/al13n321)).
* Speed up serialization and merges of `JSON` columns whose shared data contains many sparse paths: when flattening shared data into per-path columns, the per-row scan over all accumulated path columns is removed, and gaps are backfilled in bulk instead of inserting default values one cell at a time. [#109341](https://github.com/ClickHouse/ClickHouse/pull/109341) ([Groene AI](https://github.com/groeneai)).
* Reduce CPU overhead of expression evaluation for queries with a large number of columns (e.g. vector search over a `QBit` column with a small stride, where each vector expands into hundreds of bit-plane sub-columns that are all fed into a single `*DistanceTransposed` call). [#109380](https://github.com/ClickHouse/ClickHouse/pull/109380) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve the performance of H3 geo functions (`h3ToGeoBoundary`, `h3ToGeo`, `h3CellAreaM2`/`h3CellAreaRads2`, `geoToH3`) by computing paired sine/cosine together and eliminating redundant trigonometric calls in the coordinate transforms. Results are unchanged (bit-for-bit identical). [#109399](https://github.com/ClickHouse/ClickHouse/pull/109399) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve performance of comparisons (`<`, `>`, `<=`, `>=`) of wide integer types (`Int128`, `UInt128`, `Int256`, `UInt256` and types based on them, such as `Decimal128`) by up to 7 times, and of converting signed integers to `Int256` (up to 7 times on mixed-sign data), by making the comparison and sign-extension code branchless. [#109474](https://github.com/ClickHouse/ClickHouse/pull/109474) ([Manuel](https://github.com/raimannma)).
* Optimized `uniqCombined` (including the case of aggregation without keys) and `uniqHLL12`. [#109794](https://github.com/ClickHouse/ClickHouse/pull/109794) ([Anton Popov](https://github.com/CurtizJ)). [#109831](https://github.com/ClickHouse/ClickHouse/pull/109831) ([Anton Popov](https://github.com/CurtizJ)).
* Functions `arraySort` and `arrayReverseSort` are several times faster over numeric arrays (including `Decimal` and `DateTime64`) when called without a lambda. [#109832](https://github.com/ClickHouse/ClickHouse/pull/109832) ([Manuel](https://github.com/raimannma)).
* Speed up `addDays`, `addWeeks`, `subtractDays`, and `subtractWeeks` on `DateTime` and `DateTime64` values in fixed-offset time zones (such as UTC) by taking an arithmetic fast path. [#109836](https://github.com/ClickHouse/ClickHouse/pull/109836) ([Manuel](https://github.com/raimannma)).
* Optimized analysis of the text index. [#109886](https://github.com/ClickHouse/ClickHouse/pull/109886) ([Anton Popov](https://github.com/CurtizJ)).
* Parallelize processing of non-joined rows in the `parallel_hash` join algorithm in two more cases: when there is a residual filter, and in the case of small join keys (single-level hash map). [#110008](https://github.com/ClickHouse/ClickHouse/pull/110008) ([Hechem Selmi](https://github.com/m-selmi)).
* Built-in web UI responses (the Play UI, dashboards, and static-file handlers) are now compressed according to the client's `Accept-Encoding` header, using zstd, gzip, deflate, brotli, lz4, xz, snappy, or bzip2. For example, the `/play` page shrinks from \~350 KB uncompressed to under 120 KB with zstd, reducing load times on slow connections. Already-compressed responses are left untouched, and `Vary: Accept-Encoding` is emitted for correct CDN and cache partitioning. [#110108](https://github.com/ClickHouse/ClickHouse/pull/110108) ([Sayantanu Dey](https://github.com/sayantanu-dey)).
* Push a filter below a window function or below `LIMIT BY` when it is safe: a predicate written above them (an outer `WHERE` around the subquery, or a conjunct in `QUALIFY`) that references only the window `PARTITION BY` columns, or only the `LIMIT BY` key columns (for `LIMIT n BY` with `n >= 1` and no `OFFSET`), now reaches storage and enables primary key and partition pruning, skip indexes, and projections. For example, `SELECT ... row_number() OVER (PARTITION BY key ORDER BY ts) AS rn ... QUALIFY rn = 1 AND key = 'x'` no longer reads and windows the whole table. [#110114](https://github.com/ClickHouse/ClickHouse/pull/110114) ([Groene AI](https://github.com/groeneai)). [#110116](https://github.com/ClickHouse/ClickHouse/pull/110116) ([Groene AI](https://github.com/groeneai)).
* With `join_use_nulls = 1`, a null-rejecting `WHERE` that references columns from both sides of an outer join (e.g. `WHERE l.k = 42 AND r.k = 42`) now converts the join to `INNER` (or `LEFT`/`RIGHT`) and prunes the primary key, the same as with `join_use_nulls = 0`. Previously the conversion was skipped in this case and both tables were read in full. [#110121](https://github.com/ClickHouse/ClickHouse/pull/110121) ([Groene AI](https://github.com/groeneai)).
* Functions with a single non-const `Nullable` argument now share the argument's null map with the result instead of allocating and merging a new one. [#110151](https://github.com/ClickHouse/ClickHouse/pull/110151) ([Manuel](https://github.com/raimannma)).
* Avoid a heap allocation per hyperrectangle check in primary key index analysis, speeding up mark filtering by 5-26% depending on the query shape. [#110153](https://github.com/ClickHouse/ClickHouse/pull/110153) ([Manuel](https://github.com/raimannma)).
* Improve performance of functions `arrayMin` and `arrayMax` over numeric arrays by \~1.3-1.5x by using a vectorized reduction instead of a per-element comparison loop. [#110163](https://github.com/ClickHouse/ClickHouse/pull/110163) ([Manuel](https://github.com/raimannma)).
* Vectorize decompression of the `Delta` codec. Decoding is now 1.5–5 times faster for 8/16/32-bit data types, making scans of `Delta`-compressed columns up to 20% faster. [#110189](https://github.com/ClickHouse/ClickHouse/pull/110189) ([Manuel](https://github.com/raimannma)).
* Speed up string search functions (`like`, `position`, `match`, `countSubstrings`, `hasToken`, etc.) over `Enum` columns with a constant needle by searching only the distinct enum names and mapping the results back per row, instead of searching every row. [#110325](https://github.com/ClickHouse/ClickHouse/pull/110325) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Speed up aggregate functions `groupBitOr`/`groupBitAnd`/`groupBitXor` and the variance family (`varPop`, `varSamp`, `stddevPop`, `stddevSamp`, `skewPop`, `skewSamp`, `kurtPop`, `kurtSamp`, `covarPop`, `covarSamp`, `corr`) with vectorized batch processing: up to 4x faster with the `-If` combinator on unpredictable conditions, and up to 3x faster for the variance family without it. [#110461](https://github.com/ClickHouse/ClickHouse/pull/110461) ([Manuel](https://github.com/raimannma)).
* Speed up the analysis of the text index (the stage that selects which granules to read): use exclusion search instead of iterating over all granules, and avoid creating a temporary bitmap for each range check. [#110530](https://github.com/ClickHouse/ClickHouse/pull/110530) ([Anton Popov](https://github.com/CurtizJ)).
* Account for the on-disk size of `Map` subcolumns in the automatic `PREWHERE` optimization. This fixes a performance regression in `PREWHERE` introduced in [#99200](https://github.com/ClickHouse/ClickHouse/pull/99200). Part of [#110462](https://github.com/ClickHouse/ClickHouse/issues/110462). [#110623](https://github.com/ClickHouse/ClickHouse/pull/110623) ([Pavel Kruglov](https://github.com/Avogar)).
* Speed up parsing of `UUID` values from text (e.g. `JSONExtract` into `LowCardinality(UUID)`, `toUUID`, `CAST AS UUID`) by validating and converting hex digits in a single pass instead of two. [#110625](https://github.com/ClickHouse/ClickHouse/pull/110625) ([Groene AI](https://github.com/groeneai)).
* Significantly improve performance of the `timeSeries*ToGrid` aggregate functions by using faster sorting and hash table implementations. [#110875](https://github.com/ClickHouse/ClickHouse/pull/110875) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Queries like `SELECT * FROM t WHERE id` now use index skipping on the `id` column. Closes [#89222](https://github.com/ClickHouse/ClickHouse/issues/89222). [#89603](https://github.com/ClickHouse/ClickHouse/pull/89603) ([Aditya Chopra](https://github.com/adityachopra29)).
* Added the `query_plan_merge_expression_into_join` setting (enabled by default) to allow merging expression steps into `JOIN` steps during the join reordering optimization. This enables join reordering across subqueries that wrap joins (e.g., when a `JOIN` is inside a subquery with computed columns), leading to better optimization of complex join trees. [#98533](https://github.com/ClickHouse/ClickHouse/pull/98533) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Optimize `AND` chains with multiple comparison conditions on the same expression: detect contradictions (e.g., `a < 3 AND a > 5` → `false`) and prune redundant conditions (e.g., `a = 3 AND a < 5` → `a = 3`). [#99736](https://github.com/ClickHouse/ClickHouse/pull/99736) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Materialized CTEs referenced from multiple branches of a `UNION` query are now materialized once and shared across all branches. Previously, each branch received its own copy of the CTE, which was inlined and evaluated separately. [#102107](https://github.com/ClickHouse/ClickHouse/pull/102107) ([Dmitry Novik](https://github.com/novikd)).
* Threads in `BackgroundSchedulePool` are now created lazily on demand instead of all at once at server startup. A new server setting `background_schedule_pool_initial_size` (default `16`) controls how many workers are pre-spawned; the pool grows up to `background_schedule_pool_size` when needed. This reduces the number of idle threads on lightly-loaded servers. Closes [#85265](https://github.com/ClickHouse/ClickHouse/issues/85265). [#105066](https://github.com/ClickHouse/ClickHouse/pull/105066) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Skip unnecessary mark file loads for the `JSON` type's advanced shared data serialization. [#107051](https://github.com/ClickHouse/ClickHouse/pull/107051) ([Pavel Kruglov](https://github.com/Avogar)).
* The cache of preprocessed constant polygons for the function `pointInPolygon` is now shared between queries and threads and bounded by the new server setting `point_in_polygon_cache_size` (default 256 MiB, `0` disables the cache, changeable at runtime). Previously, the cache kept up to `max_threads` copies of each preprocessed polygon, grew without bound across distinct polygons, and was never released until server restart. It can be cleared with `SYSTEM DROP POINT IN POLYGON CACHE`, and the current usage is reported in `system.metrics` as `PointInPolygonCacheBytes`, `PointInPolygonCacheCells`, and `PointInPolygonCacheSizeLimit`. Closes [#106393](https://github.com/ClickHouse/ClickHouse/issues/106393). [#107247](https://github.com/ClickHouse/ClickHouse/pull/107247) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Keeper no longer holds its internal snapshots lock while serializing and writing a snapshot to disk or moving snapshots between disks, so snapshot transfers to other nodes and Raft processing are no longer stalled by local snapshot creation. [#107595](https://github.com/ClickHouse/ClickHouse/pull/107595) ([Antonio Andelic](https://github.com/antonio2368)).
* Parallelize the filesystem cache background eviction (controlled by the `keep_free_space_ratio` settings). Added a new setting `keep_free_space_eviction_threads` to control the parallelism, and increased the default of `keep_free_space_remove_batch` from `100` to `250`. [#108147](https://github.com/ClickHouse/ClickHouse/pull/108147) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Limit the number of concurrently staged parts in the Azure Blob Storage read-then-write copy (used by backups when native copy is unavailable) to `max_inflight_parts_for_one_file`, preventing excessive memory usage when many large files are copied in parallel. [#108232](https://github.com/ClickHouse/ClickHouse/pull/108232) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Enabled all three text index caches globally — previously, they were only enabled within queries. Also, the posting lists cache size is now zero, which effectively disables it again, because posting lists are large and caching them is too costly. [#108274](https://github.com/ClickHouse/ClickHouse/pull/108274) ([Robert Schulze](https://github.com/rschu1ze)).
* Add streaming in-memory marks compression during marks loading to reduce peak memory usage. Closes [#108285](https://github.com/ClickHouse/ClickHouse/issues/108285). [#108325](https://github.com/ClickHouse/ClickHouse/pull/108325) ([Pavel Kruglov](https://github.com/Avogar)).
* The new filesystem cache setting `reserve_granularity` (default 4 MiB) reserves space ahead in coarser granules, reducing lock contention on the filesystem cache space reservation hot path. [#108369](https://github.com/ClickHouse/ClickHouse/pull/108369) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Reduce the amount of memory used by the filesystem cache metadata (per file segment and per key). [#108477](https://github.com/ClickHouse/ClickHouse/pull/108477) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Queries to `system.iceberg_history` with `WHERE` filters on the `database` and `table` columns now access only the matching databases, which can save time if you have many unrelated remote databases on the server. [#108492](https://github.com/ClickHouse/ClickHouse/pull/108492) ([Den Kalantaevskii](https://github.com/Diskein)).
* Removed unnecessary locking in the filesystem cache to reduce lock contention. [#108932](https://github.com/ClickHouse/ClickHouse/pull/108932) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Reduced memory usage of `BACKUP` and `RESTORE` metadata handling. Opening a backup (for `RESTORE`, or as the base of an incremental `BACKUP`) now parses the `.backup` metadata as a stream instead of loading it into an in-memory XML document tree, which for large (especially incremental) backups avoids allocating a multi-gigabyte DOM tree. [#109107](https://github.com/ClickHouse/ClickHouse/pull/109107) ([Julia Kartseva](https://github.com/jkartseva)). Finalizing a `BACKUP` no longer copies the file infos of all files into a temporary vector, which, for backups of millions of files, transiently cost several gigabytes. [#109861](https://github.com/ClickHouse/ClickHouse/pull/109861) ([Julia Kartseva](https://github.com/jkartseva)). Writing backup entries also no longer copies the current host's file-info list. [#111162](https://github.com/ClickHouse/ClickHouse/pull/111162) ([Julia Kartseva](https://github.com/jkartseva)).
* Reduce memory consumption in the aggregator. [#109224](https://github.com/ClickHouse/ClickHouse/pull/109224) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Support the query condition cache for local `Parquet` files read via the `File` table engine (previously supported only for object storage and data lakes). [#109247](https://github.com/ClickHouse/ClickHouse/pull/109247) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduced the memory usage of the text index header cache by 2-2.5 times. More headers of data parts fit into the cache (setting `text_index_header_cache_size`), reducing disk reads for text search queries. [#109332](https://github.com/ClickHouse/ClickHouse/pull/109332) ([Anton Popov](https://github.com/CurtizJ)).
* The transposed vector distance functions `L2DistanceTransposed`, `cosineDistanceTransposed` and `dotProductTransposed` now apply the partial bit-plane read optimization to `Nullable(QBit)` columns, reading only the requested bit planes instead of the whole column. [#109358](https://github.com/ClickHouse/ClickHouse/pull/109358) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `IS NOT DISTINCT FROM` and `IS TRUE` now use primary-key and minmax indexes to prune granules, the same as `=`. Previously `k IS NOT DISTINCT FROM 42` and `(k = 42) IS TRUE` scanned all granules. [#110006](https://github.com/ClickHouse/ClickHouse/pull/110006) ([Groene AI](https://github.com/groeneai)).
* Pooled connections are no longer pinged before each use. This removes a `Ping`-`Pong` round trip that was added to every reused connection, reducing the latency of distributed queries and of `clickhouse-benchmark`. A stale pooled connection is detected with a zero-timeout poll (a non-blocking check that adds no round trip) and recovered by reconnecting. [#110068](https://github.com/ClickHouse/ClickHouse/pull/110068) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed spurious reconnections of pooled HTTP keep-alive connections over TLS (HTTPS, S3). The stale-connection check used `poll` on the socket, which misreports a live secure connection carrying an unread TLS post-handshake record (a session ticket or `KeyUpdate`) as closed; it now uses a non-blocking `MSG_PEEK` on plain sockets and `SSL_peek`/`SSL_has_pending` on TLS sockets, which also correctly detects an orderly TLS shutdown and a TLS record that has only partially arrived. [#110402](https://github.com/ClickHouse/ClickHouse/pull/110402) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Queries accelerated by TopK dynamic filtering (`ORDER BY ... LIMIT k`) now make fuller use of the query condition cache: the cache is populated even when lazy materialization is applied to the query, and such queries can reuse entries previously written by an ordinary query that had the same `WHERE` predicate. [#110507](https://github.com/ClickHouse/ClickHouse/pull/110507) ([Shankar Iyer](https://github.com/shankar-iyer)).
* A `LIKE`/`NOT LIKE` pattern without wildcards (`%`, `_`) now uses an exact primary key range, so it reads the same number of granules as the equivalent `=`/`!=` predicate instead of a wider prefix range. [#107077](https://github.com/ClickHouse/ClickHouse/pull/107077) ([Groene AI](https://github.com/groeneai)).
* Fix redundant file segment lock contention (a performance regression introduced in 26.1) when reading data through the filesystem cache. [#109577](https://github.com/ClickHouse/ClickHouse/pull/109577) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fixed skip indexes defined on `Tuple` subcolumns not being used when the field is accessed via `tupleElement(t, 'name')`, `tupleElement(t, N)`, or `t.N` while the full tuple is also read in the same query (e.g. `SELECT *`). All of these forms now prune granules the same way as the named subcolumn access `t.name`. [#110056](https://github.com/ClickHouse/ClickHouse/pull/110056) ([Groene AI](https://github.com/groeneai)).
* Fixed slow `ORDER BY ... LIMIT` queries on `Distributed` tables when `prefer_localhost_replica` selects a local replica: the preliminary limit was removed from the local-shard plan, preventing lazy materialization and dynamic top-K filtering. [#110136](https://github.com/ClickHouse/ClickHouse/pull/110136) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Fixed the text index not being used for the `ILIKE` operator when the index is defined over an expression rather than a bare column (for example `assumeNotNull(col)` with a `lower(...)` preprocessor): such queries were reading all granules instead of using the index. This closes [#110350](https://github.com/ClickHouse/ClickHouse/issues/110350). [#110595](https://github.com/ClickHouse/ClickHouse/pull/110595) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Reduce lock contention in the filesystem cache: queries reading from the cache no longer block on the priority queue lock when updating an entry's LRU priority. [#109065](https://github.com/ClickHouse/ClickHouse/pull/109065) ([Antonio Andelic](https://github.com/antonio2368)).
* Text index queries that use a filter-only `postprocessor` expression (for example `if(..., '', token)`) now discard empty tokens up front instead of materializing them row by row, improving performance. [#109049](https://github.com/ClickHouse/ClickHouse/pull/109049) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Reduce lock contention in system log queues, lowering query tail latency on busy clusters. [#110539](https://github.com/ClickHouse/ClickHouse/pull/110539) ([Sean Haynes](https://github.com/seandhaynes)).
* Improved the performance of substring search functions (`position`, `countSubstrings`, `multiSearch*`, `replaceAll`, `replaceOne`, and their case-insensitive and UTF-8 variants) with a non-constant needle by up to 1.5x by using SIMD-backed string searchers on the per-row path instead of a naive implementation. [#110580](https://github.com/ClickHouse/ClickHouse/pull/110580) ([Raúl Marín](https://github.com/Algunenano)).
* Lazy materialization is now applied to `ReplacingMergeTree` queries with `FINAL`, a filter, and a small `LIMIT` even without `ORDER BY`. Columns not needed by the filter and the `FINAL` merge are fetched only for the rows that remain after the limit, which makes such queries much faster when they select wide columns with a selective filter. Controlled by `query_plan_optimize_lazy_materialization` and `query_plan_max_limit_for_lazy_materialization`. [#110722](https://github.com/ClickHouse/ClickHouse/pull/110722) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Improved async insert performance when deduplication is enabled and one flush is split across multiple partitions: ClickHouse now reuses the computed deduplication hashes across partitions instead of recomputing them for each one. [#111150](https://github.com/ClickHouse/ClickHouse/pull/111150) ([Valery Petrov](https://github.com/valerypetrov)).

<h4 id="267-improvement">
  Improvement
</h4>

* Added a setting `input_format_csv_missing_nullable_as_empty_string` (disabled by default). When enabled, a missing value of a `Nullable(String)` column in CSV input is read as an empty `String` instead of `NULL`, regardless of `input_format_csv_empty_as_default`. [#58225](https://github.com/ClickHouse/ClickHouse/pull/58225) ([kevinyhzou](https://github.com/KevinyhZou)). [#107577](https://github.com/ClickHouse/ClickHouse/pull/107577) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Functions `toDateOrNull`, `toDateTimeOrNull` and `toDateTime64OrNull` now accept integer arguments of all native integer types (interpreted the same way as by `toDate`, `toDateTime` and `toDateTime64`, with an optional timezone argument), returning `NULL` for values out of range of the result type. For example, `toDateTimeOrNull(1583851242, 'Asia/Shanghai')` returns `2020-03-10 22:40:42` and `toDateTimeOrNull(4294967296)` returns `NULL`. [#79791](https://github.com/ClickHouse/ClickHouse/pull/79791) ([Jitendra](https://github.com/jitendra1411)).
* Added an `is_wildcard` column to the `system.grants` table that indicates whether a grant uses wildcard prefix matching (e.g., `GRANT SELECT ON db*.*`). Previously, wildcard and exact grants on the same name were indistinguishable in `system.grants`. Closes [#92835](https://github.com/ClickHouse/ClickHouse/issues/92835). [#98577](https://github.com/ClickHouse/ClickHouse/pull/98577) ([DQ](https://github.com/il9ue)).
* Allow Snappy compression in the HTTP interface (`Accept-Encoding: snappy`) and add the `snappy_mode` setting to choose between the Hadoop Snappy block format and the Snappy framing format for generic `file`/`url` snappy I/O. [#100752](https://github.com/ClickHouse/ClickHouse/pull/100752) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support compatibility with the old analyzer under the `analyzer_compatibility_allow_non_aggregate_in_having` setting. If enabled, non-aggregate conjunctions are moved from `HAVING` to `WHERE`. [#104232](https://github.com/ClickHouse/ClickHouse/pull/104232) ([Dmitry Novik](https://github.com/novikd)).
* Added a new server setting `memory_worker_rss_speculative_reserve_ratio` (default `1.0`) which makes the global memory tracker speculatively reserve memory on top of the observed RSS when the RSS growth outpaces the tracker's bookkeeping between samples. With it, allocations get `MEMORY_LIMIT_EXCEEDED` earlier, and the kernel OOM-killer is less likely to fire first. Set the ratio to `0` to disable the speculation. [#104976](https://github.com/ClickHouse/ClickHouse/pull/104976) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added opt-in Prometheus metrics for filesystem cache eviction activity (`filesystem_cache_evictions_total`, `filesystem_cache_evicted_bytes_total`, `filesystem_cache_evicted_segment_hits`, `filesystem_cache_evicted_segment_size_bytes`, and their per-user variants labeled with `user_id`), exposed per cache via `system.dimensional_metrics`, `system.histogram_metrics`, and the Prometheus endpoint. They are controlled by the cache disk-config settings `expose_prometheus_eviction_metrics` and `expose_prometheus_eviction_metrics_per_user` (both off by default), which can be toggled at runtime via `SYSTEM RELOAD CONFIG`. [#105020](https://github.com/ClickHouse/ClickHouse/pull/105020) ([Sacheendra Talluri](https://github.com/sacheendra)).
* Make `EXPLAIN [PLAN] actions=1, compact=1, pretty=1` the default. [#105036](https://github.com/ClickHouse/ClickHouse/pull/105036) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Bump `delta-kernel-rs` (the library behind the `DeltaLake` integration) to v0.23.0. [#105861](https://github.com/ClickHouse/ClickHouse/pull/105861) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Add `du` and `wc` commands to `clickhouse-disks`. They, respectively, print the total size in bytes for a given file or directory, and list the number of bytes, lines, and words in a file. [#106268](https://github.com/ClickHouse/ClickHouse/pull/106268) ([Asya Shneerson](https://github.com/asya-ch)).
* Added a new asynchronous metric `UntrackedMemory` (visible in `system.asynchronous_metrics`) that reports memory already allocated by threads but not yet accounted in the global memory tracking counter: each thread accumulates small allocations locally and reports them in bulk. This helps explain discrepancies between `MemoryTracking` and the process's actual memory usage. `MEMORY_LIMIT_EXCEEDED` error messages now also include the amount of untracked memory, making it easier to understand why a query or the server hit its memory limit. [#106386](https://github.com/ClickHouse/ClickHouse/pull/106386) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Upgrade ClickStack (the observability UI) to version 2.28.0. [#106406](https://github.com/ClickHouse/ClickHouse/pull/106406) ([Aaron Knudtson](https://github.com/knudtty)).
* Added support for `BFloat16` in `dotProduct` and improved its performance by batching the SIMD path. [#106569](https://github.com/ClickHouse/ClickHouse/pull/106569) ([Nikita Taranov](https://github.com/nickitat)).
* Made the settings `max_named_collection_num_to_throw`, `max_table_num_to_throw`, `max_replicated_table_num_to_throw`, `max_view_num_to_throw`, `max_dictionary_num_to_throw`, and `max_database_num_to_throw` changeable without a server restart. [#106821](https://github.com/ClickHouse/ClickHouse/pull/106821) ([Maxim Orlovsky](https://github.com/UberDever)).
* Support the `REDUCED_REDUNDANCY`, `STANDARD_IA`, `ONEZONE_IA`, `GLACIER_IR`, and `EXPRESS_ONEZONE` values (in addition to `STANDARD` and `INTELLIGENT_TIERING`) for the `s3_storage_class_name` setting. [#107251](https://github.com/ClickHouse/ClickHouse/pull/107251) ([Aditya Kumar](https://github.com/adityaksolves)).
* Added the create-time `materialized_postgresql_use_extended_date_and_time_types` setting for the `MaterializedPostgreSQL` database engine. By default (enabled), PostgreSQL `date`/`timestamp` columns are inferred as `Date32`/`DateTime64`; setting it to `0` at `CREATE DATABASE` time infers the narrower `Date`/`DateTime` types. The setting is not applicable to the `MaterializedPostgreSQL` table engine. [#107428](https://github.com/ClickHouse/ClickHouse/pull/107428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `SOME` / `ALL` array quantifier (`expr OP SOME(array)` / `expr OP ALL(array)`) now also supports the keyword comparison predicates `IS DISTINCT FROM` and `IS NOT DISTINCT FROM`, and the string-search predicates `LIKE`, `ILIKE`, `NOT LIKE`, `NOT ILIKE`, and `REGEXP`, rewritten to `arrayExists` / `arrayAll`. [#107454](https://github.com/ClickHouse/ClickHouse/pull/107454) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a memory leak that occurred when opening a SQLite database failed (for example, when the `sqlite` table function or the `SQLite` database engine is given a path that cannot be opened). [#107807](https://github.com/ClickHouse/ClickHouse/pull/107807) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI (`play.html`), the run shortcut hint now shows `Cmd+Enter` on Mac and `Ctrl+Enter` on other platforms instead of always showing `Ctrl/Cmd+Enter`, and the `, +Shift to run all` part of the hint is shown only when there are multiple queries. [#107817](https://github.com/ClickHouse/ClickHouse/pull/107817) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#108957](https://github.com/ClickHouse/ClickHouse/pull/108957) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `Alias` table engine now supports reading with parallel replicas when the target table is of the `MergeTree` family. [#107830](https://github.com/ClickHouse/ClickHouse/pull/107830) ([Kai Zhu](https://github.com/nauu)).
* Added the `uniq_v2` column statistics type — a lightweight alternative to the `uniq` statistics, based on the `uniqCombined64` sketch. [#107863](https://github.com/ClickHouse/ClickHouse/pull/107863) ([Han Fei](https://github.com/hanfei1991)). Deprecated the `minmax` column statistics type and changed the default value of `auto_statistics_types` to `basic, uniq_v2`. [#108680](https://github.com/ClickHouse/ClickHouse/pull/108680) ([Han Fei](https://github.com/hanfei1991)).
* AI functions (`aiGenerate`, `aiEmbed`, `aiClassify`, `aiExtract`, `aiTranslate`) now retry transient network failures (connection resets, TLS connect failures, timeouts, unreachable addresses) when `ai_function_max_retries` is set, matching the retry behavior of the `url` table function. Previously, only provider-side HTTP error responses were retried. [#107927](https://github.com/ClickHouse/ClickHouse/pull/107927) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `INSERT` into a `MergeTree` table now honors query cancellation and `max_execution_time` while writing many parts, instead of potentially running long after being killed. [#107929](https://github.com/ClickHouse/ClickHouse/pull/107929) ([Michael Kolupaev](https://github.com/al13n321)).
* In the Web UI (`play.html`), the Web Terminal icon can now be opened in a new browser tab with a middle-button click or Ctrl/Cmd/Shift+click. [#108006](https://github.com/ClickHouse/ClickHouse/pull/108006) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* AI SQL generation in the client no longer sends the `temperature` parameter unless it is explicitly set via `ai.temperature` in the configuration. This fixes AI SQL generation for models that reject the `temperature` parameter. [#108014](https://github.com/ClickHouse/ClickHouse/pull/108014) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the `system.masking_policies` table and `SHOW MASKING POLICIES` introspection to open-source builds. Masking policies themselves remain a ClickHouse Cloud feature, so the table is empty in open-source builds, but introspection queries no longer fail with an error. [#108030](https://github.com/ClickHouse/ClickHouse/pull/108030) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The Keeper-based Kafka consumer now randomizes the order in which it acquires temporary partition locks across replicas, improving fairness of partition distribution and reducing lock contention. Previously, the intended shuffle had no effect. [#108033](https://github.com/ClickHouse/ClickHouse/pull/108033) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added autocompletion to the Web UI (`play.html`), based on `system.completions` and the WASM-based SQL lexer. [#108059](https://github.com/ClickHouse/ClickHouse/pull/108059) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `clickhouse-client` and `clickhouse-local` now show as-you-type autocompletion hints (inline "ghost" text) for the best matching suggestion when the cursor is at the end of the input. The most relevant suggestions (recently used and identifiers already present in the query) are ranked first. Navigate with Up/Down (or Ctrl-Up/Ctrl-Down); accept a single or selected hint with Tab or Right, and accept a selected hint with Enter; Tab also opens the classic completion list. Controlled by the new `--hints` option (on by default; requires `--highlight`). [#108070](https://github.com/ClickHouse/ClickHouse/pull/108070) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support the `length` function for the `QBit` data type — it returns the dimension of the vector as a constant. [#108071](https://github.com/ClickHouse/ClickHouse/pull/108071) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Support `CAST` from a `QBit` to an `Array`, reconstructing the original vector — the inverse of the existing `Array` to `QBit` conversion. [#108072](https://github.com/ClickHouse/ClickHouse/pull/108072) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Requests to REST data lake catalogs (such as OneLake) now include a ClickHouse `User-Agent` header. [#108117](https://github.com/ClickHouse/ClickHouse/pull/108117) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* `arrayFold` now respects query cancellation and `max_execution_time`. Previously, a fold over a very long array ran entirely inside a single function call and could not be interrupted, so `KILL QUERY` and time limits were ignored until the fold finished. [#108192](https://github.com/ClickHouse/ClickHouse/pull/108192) ([Groene AI](https://github.com/groeneai)).
* `MVTEncodeGeom` now snaps geometry to the integer pixel grid before clipping and clips polygons with the `wagyu` library, so the clipped output is valid (self-intersecting rings are repaired) and edge-aligned, matching PostGIS `ST_AsMVTGeom`. [#108248](https://github.com/ClickHouse/ClickHouse/pull/108248) ([Saarthak Gupta](https://github.com/saarthak2002)).
* Add per-phase query pre-execution `ProfileEvents`: `QueryParseMicroseconds`, `QueryAnalysisMicroseconds`, `QueryPlanBuildMicroseconds` and `QueryPipelineBuildMicroseconds`. They expose where time is spent before query execution (parsing, analysis, query plan building, pipeline building) and are available in `system.query_log` and `system.events`. [#108282](https://github.com/ClickHouse/ClickHouse/pull/108282) ([Jordi Villar](https://github.com/jrdi)).
* `ALTER TABLE` operations that would produce table metadata exceeding `max_query_size` are now rejected upfront, preventing tables from becoming unloadable by components such as DDL distribution and replica recovery. [#108283](https://github.com/ClickHouse/ClickHouse/pull/108283) ([Andrew Kravchuk](https://github.com/lockie)).
* Added `settings` and `engine_settings` columns to `system.backups` and `system.backup_log`. `settings` exposes the backup/restore-specific settings requested for an operation (e.g., `allow_s3_native_copy`, `deduplicate_files`, `structure_only`), and `engine_settings` exposes the settings effectively used by the backup engine's reader and writer (e.g., the S3 request settings such as `allow_native_copy`, which may differ from what was requested after merging the endpoint configuration). This makes it possible to see which settings a `BACKUP`/`RESTORE` operation actually ran with. [#108334](https://github.com/ClickHouse/ClickHouse/pull/108334) ([Julia Kartseva](https://github.com/jkartseva)).
* Added a `source` column to `system.documentation` containing the path of the source file where each entity's documentation is defined. The table now also documents compression codecs, profile events, current metrics, asynchronous metrics, and the system tables themselves (with their columns), and the documentation of settings now includes their type and default value. [#108346](https://github.com/ClickHouse/ClickHouse/pull/108346) ([Alexey Milovidov](https://github.com/alexey-milovidov)). An empty setting default value is now rendered as *empty string* instead of empty backticks. [#108708](https://github.com/ClickHouse/ClickHouse/pull/108708) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support asynchronous reads from remote replicas (`async_socket_for_remote`) on macOS by implementing the epoll-based polling primitives on top of `kqueue`. This lets distributed queries read shards in parallel on macOS instead of serially. [#108403](https://github.com/ClickHouse/ClickHouse/pull/108403) ([Raúl Marín](https://github.com/Algunenano)).
* Support `BFloat16` in binary math functions. [#108442](https://github.com/ClickHouse/ClickHouse/pull/108442) ([Zhang Yifan](https://github.com/zhangyifan27)).
* `MergeTree` can now read a compressed stream whose blocks use different codecs. This is the read-side prerequisite for adaptive codec selection ([#105404](https://github.com/ClickHouse/ClickHouse/issues/105404)). [#108592](https://github.com/ClickHouse/ClickHouse/pull/108592) ([Raufs Dunamalijevs](https://github.com/rienath)).
* The automatic value of `max_threads` and similar settings is now shown in `system.settings` as `auto(8)` instead of `'auto(8)'`; the surrounding single quotes were a long-standing artifact baked into the value. Cross-version compatibility is preserved: the legacy quoted form is still accepted when parsing settings received from older servers. [#108657](https://github.com/ClickHouse/ClickHouse/pull/108657) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Several usability fixes for the `/schema` Web UI: load the schema on Enter, theme-aware scrollbars, readable table names, consistent per-database grouping of independent tables, no text selection while dragging, and a `play`-style authentication form (Credential Management API, URL-supplied credentials with password stripping, and live credential validation). [#108724](https://github.com/ClickHouse/ClickHouse/pull/108724) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The text index lazy posting-list apply mode is no longer experimental and can be selected with `text_index_posting_list_apply_mode = 'lazy'` without `allow_experimental_text_index_lazy_apply`. The density-threshold setting was renamed from `text_index_density_threshold` to `text_index_lazy_intersection_density_threshold`. [#108814](https://github.com/ClickHouse/ClickHouse/pull/108814) ([Anton Popov](https://github.com/CurtizJ)).
* Add a `delta_sharing` catalog type to `DataLakeCatalog` for Databricks Delta Sharing's Iceberg REST endpoint, whose namespaces are flat and which ignores the `parent` listing filter. Use it instead of `catalog_type = 'rest'` for such endpoints, where `SHOW TABLES` would otherwise hang. [#108865](https://github.com/ClickHouse/ClickHouse/pull/108865) ([Seva Potapov](https://github.com/seva-potapov)).
* Added a new `clickhouse-client`/`clickhouse-local` option `--echo-query-separator` that prints a custom separator before the formatted echoed query, making it easier to tell the typed query apart from its reformatted echo. Disabled by default. [#108888](https://github.com/ClickHouse/ClickHouse/pull/108888) ([David Meng](https://github.com/davidmenggx)).
* Improvements to the database panel of the Web UI: the number of tables is shown in parentheses next to a database name when it is expanded. [#108891](https://github.com/ClickHouse/ClickHouse/pull/108891) ([Alexey Milovidov](https://github.com/alexey-milovidov)). A refresh button next to an expanded database reloads its list of tables. [#108958](https://github.com/ClickHouse/ClickHouse/pull/108958) ([Alexey Milovidov](https://github.com/alexey-milovidov)). When the panel is reopened, the previously expanded databases are restored. [#108964](https://github.com/ClickHouse/ClickHouse/pull/108964) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow calculating the combined skip-index benefit in `EXPLAIN WHATIF`: it shows the data ratio for the intersection of all existing suitable hypothetical indices. [#108934](https://github.com/ClickHouse/ClickHouse/pull/108934) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed the horizontal scroll position of the result table being reset in the Web UI when clicking a link in a cell and returning to the page. [#108941](https://github.com/ClickHouse/ClickHouse/pull/108941) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `MySQL` database engine, table engine, and table function now map MySQL's spatial column types (`LINESTRING`, `POLYGON`, `MULTILINESTRING`, `MULTIPOLYGON`, and the generic `GEOMETRY`) to the corresponding ClickHouse geometric types instead of `String`. This is controlled by the new `geometry` flag of the `mysql_datatypes_support_level` setting, enabled by default. `POINT` is still always converted to `Point`. The generic `GEOMETRY` column maps to the umbrella `Geometry` type; reading a value whose subtype has no ClickHouse counterpart (`MULTIPOINT`, `GEOMETRYCOLLECTION`) throws an exception at read time. [#108944](https://github.com/ClickHouse/ClickHouse/pull/108944) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI (`play.html`): full keyboard navigation — arrow-key navigation in the database panel and result table, keyboard access to the toolbar buttons, theme switcher, and download menu, and visible focus outlines. [#108972](https://github.com/ClickHouse/ClickHouse/pull/108972) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* HTTP interface: when credentials are provided both via URL parameters (`user`/`password`) and an `Authorization` header, the URL parameters now take precedence instead of the request being rejected. This fixes downloading results from the Web UI (`play.html`) failing with `AUTHENTICATION_FAILED` (error 516) when the browser has remembered Basic credentials. [#108980](https://github.com/ClickHouse/ClickHouse/pull/108980) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Restore `show_data_lake_catalogs_in_system_tables` as the setting that controls only `DataLakeCatalog` visibility in `system.tables`, `system.columns`, and `system.completions`. Added `show_remote_databases_in_system_tables`, enabled by default, to let users hide `MySQL` and `PostgreSQL` databases from those system tables separately. [#109082](https://github.com/ClickHouse/ClickHouse/pull/109082) ([Pablo Marcos](https://github.com/pamarcos)).
* Use the precise (closest-representable) float parsing algorithm by default and apply the `precise_float_parsing` setting to input formats (`CSV`, `TSV`, `JSON`, `VALUES`, ...) and numeric literals, not just `toFloat*`/`CAST`. Set `precise_float_parsing = 0` for the previous, faster in some cases but less accurate, behavior. Closes [#60146](https://github.com/ClickHouse/ClickHouse/issues/60146). Closes [#74647](https://github.com/ClickHouse/ClickHouse/issues/74647). Closes [#68914](https://github.com/ClickHouse/ClickHouse/issues/68914). [#109086](https://github.com/ClickHouse/ClickHouse/pull/109086) ([Raúl Marín](https://github.com/Algunenano)).
* A query with a single CTE is now formatted with the same newline and indentation as a query with multiple CTEs. Previously `WITH a AS (...)` kept the CTE on the same line as `WITH`, while two or more CTEs put `WITH` on its own line with each CTE indented. [#109092](https://github.com/ClickHouse/ClickHouse/pull/109092) ([Groene AI](https://github.com/groeneai)).
* Web UI: when the highlighted completion is the same as the already-typed word, or the same word in a different case (e.g. `HASH` offered for a typed `hash`), pressing Right/Tab/Enter no longer rewrites the word or gets swallowed by the autocompletion — the key moves the caret or inserts a newline as expected. [#109106](https://github.com/ClickHouse/ClickHouse/pull/109106) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#109384](https://github.com/ClickHouse/ClickHouse/pull/109384) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added rainbow parentheses, matched-bracket, matching-identifier, and digit-group highlighting to the Web UI (`play.html`), matching `clickhouse-client`. [#109108](https://github.com/ClickHouse/ClickHouse/pull/109108) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI, `Tab` and `Shift+Tab` now indent and unindent the selected lines by 4 spaces. [#109110](https://github.com/ClickHouse/ClickHouse/pull/109110) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: highlight the position of a syntax error in the query editor with a red background. The highlight is cleared as soon as the user returns focus to the editor. [#109112](https://github.com/ClickHouse/ClickHouse/pull/109112) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `clickhouse-compressor --stat` and default-codec detection for old parts now report corrupted block headers as corruption instead of a misleading end-of-file error. [#109157](https://github.com/ClickHouse/ClickHouse/pull/109157) ([Raufs Dunamalijevs](https://github.com/rienath)).
* ClickHouse Keeper now respects the `os_collect_psi_metrics` setting and skips PSI metrics collection when it is disabled. [#109179](https://github.com/ClickHouse/ClickHouse/pull/109179) ([Maxim Orlovsky](https://github.com/UberDever)).
* In the Web UI, when query tabs are shown, the connection parameters (host, user, password) are hidden behind a key button in the top-right corner and shown in a drop-down on demand. [#109243](https://github.com/ClickHouse/ClickHouse/pull/109243) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: show a single-value result (one row, one column, e.g. `SHOW CREATE TABLE`) with full height instead of clamping it to three lines. [#109245](https://github.com/ClickHouse/ClickHouse/pull/109245) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI, clicking a table in the databases panel with the middle mouse button, with Shift, or with the platform's new-tab modifier (Cmd on macOS, Ctrl elsewhere) now opens its query in a new Web UI tab. [#109246](https://github.com/ClickHouse/ClickHouse/pull/109246) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Key the query condition cache for remote (object storage) `Parquet` files by ETag in addition to the path, so that overwriting an object in place no longer serves stale cached results. [#109310](https://github.com/ClickHouse/ClickHouse/pull/109310) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI, empty strings and NULLs are no longer colorized in the categorical coloring mode. [#109342](https://github.com/ClickHouse/ClickHouse/pull/109342) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: clicking a table's icon in the database panel now shows the list of its columns, with type icons, a size bar proportional to the compressed size, and a tooltip with the compressed/uncompressed size and compression ratio. [#109346](https://github.com/ClickHouse/ClickHouse/pull/109346) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: show the full tab title as a tooltip on hover when it is truncated. [#109354](https://github.com/ClickHouse/ClickHouse/pull/109354) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI, middle-clicking a tab's title (or Ctrl/Shift/Cmd+clicking it) now duplicates the tab. [#109357](https://github.com/ClickHouse/ClickHouse/pull/109357) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: resize the final progress and query statistics areas uniformly so they do not wrap awkwardly when the browser window is narrow. [#109363](https://github.com/ClickHouse/ClickHouse/pull/109363) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: selecting a database in the database panel now uses it as the default database for queries run from the editor. [#109372](https://github.com/ClickHouse/ClickHouse/pull/109372) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support `reinterpret` of an `Array` of fixed-size elements as a `String`, the inverse of the existing `reinterpret` of a `String`/`FixedString` as an `Array`. [#109383](https://github.com/ClickHouse/ClickHouse/pull/109383) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI, do not display the per-column color-coding toggles when the result has no more than a single row. [#109385](https://github.com/ClickHouse/ClickHouse/pull/109385) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow `CAST` between `QBit` types that differ in the element type and/or the stride, as long as the dimension stays the same (for example `CAST(x AS QBit(Float64, N))` from a `QBit(Float32, N)`). Stride-only changes are lossless; element-type changes follow the corresponding `Array` conversion semantics (for example `Float32` to `BFloat16` may lose precision, and `accurateCast` / `accurateCastOrNull` reject rows that are not exactly representable). [#109387](https://github.com/ClickHouse/ClickHouse/pull/109387) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Functions `quantizeBFloat16ToInt8` and `dequantizeInt8ToBFloat16` now also accept `Array` and `QBit` arguments, applying the Lloyd-Max codec to the whole vector (returning `Array`/`QBit` of the corresponding element type), in addition to the existing scalar overloads. [#109398](https://github.com/ClickHouse/ClickHouse/pull/109398) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: the Documentation link now carries the current user name in the URL. [#109419](https://github.com/ClickHouse/ClickHouse/pull/109419) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support `arraySum`, `arrayAvg`, and `arrayProduct` for arrays of `BFloat16`. [#109420](https://github.com/ClickHouse/ClickHouse/pull/109420) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The MySQL-style format specifier `%f` in `parseDateTime` / `parseDateTime64` (and their `OrZero` / `OrNull` variants) now accepts between 1 and 6 fractional digits, interpreted as left-aligned microseconds like MySQL's `STR_TO_DATE`, instead of requiring exactly 6. Also fixed misaligned `PrettyCompact` tables in the built-in function documentation examples. [#109421](https://github.com/ClickHouse/ClickHouse/pull/109421) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: query tabs are now persistent — each tab keeps its rendered result (including images and charts) and its running query when you switch away and back, and long queries continue running in the background. Tab titles show a spinner, progress bar, and completion check-mark for their query. [#109425](https://github.com/ClickHouse/ClickHouse/pull/109425) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: correctly display an error when a query fails after some of its result has already been streamed, instead of showing a client-side `SyntaxError: Unexpected end of JSON input` (or, with `http_write_exception_in_output_format`, marking the failed query as successful). [#109430](https://github.com/ClickHouse/ClickHouse/pull/109430) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added pinned columns to the Web UI: a column can be pinned from its header so that it stays visible (stuck to the edge) while the results table is scrolled horizontally. [#109439](https://github.com/ClickHouse/ClickHouse/pull/109439) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the advanced dashboard (`/dashboard`), charts for specific metrics can now be added directly by the metric name as it appears in the source code or documentation, which makes it easier to add multiple metrics during debugging sessions. [#109449](https://github.com/ClickHouse/ClickHouse/pull/109449) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Web UI: fixed the connection settings drop-down closing when selecting text with the mouse and dragging past its border. [#109451](https://github.com/ClickHouse/ClickHouse/pull/109451) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Web UI: hovering over a result table column header now shows the full column name and type as a tooltip, so truncated headers can be read in full. [#109463](https://github.com/ClickHouse/ClickHouse/pull/109463) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Fixed column header titles being clipped with an ellipsis even when the column was wide enough to show the full title. [#110397](https://github.com/ClickHouse/ClickHouse/pull/110397) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support SSD cache dictionaries (`SSD_CACHE` layout) and the `FileLog` table engine on macOS builds. [#109493](https://github.com/ClickHouse/ClickHouse/pull/109493) ([Raúl Marín](https://github.com/Algunenano)).
* Web UI: do not restore tabs with empty queries when the page is opened. [#109529](https://github.com/ClickHouse/ClickHouse/pull/109529) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix unreadable as-you-type autocompletion hints and bright colors in the interactive client on terminals whose `TERM` does not contain `256` (e.g. Ghostty, kitty, Alacritty, foot): bright colors are now emitted as aixterm bright color codes unconditionally instead of falling back to bold + dark color, which modern terminals render as a dark, hard-to-read color on dark backgrounds. [#109622](https://github.com/ClickHouse/ClickHouse/pull/109622) ([Alasdair Brown](https://github.com/sdairs)).
* Enable jemalloc per-CPU arenas and allocation profiling on macOS builds. [#109684](https://github.com/ClickHouse/ClickHouse/pull/109684) ([Raúl Marín](https://github.com/Algunenano)).
* Allow altering some authentication settings of a `OneLake` data lake catalog database with `ALTER DATABASE ... MODIFY SETTING`. [#110019](https://github.com/ClickHouse/ClickHouse/pull/110019) ([alesapin](https://github.com/alesapin)).
* The `Hive` engine now reads `ORC` file metadata (min/max indexes, row counts) with ClickHouse's native `ORC` reader instead of the Apache Arrow `ORC` adapter. [#110086](https://github.com/ClickHouse/ClickHouse/pull/110086) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduced the binary size by \~10.5 MB by executing comparison and arithmetic operations on rarely used mixed type pairs (`Decimal` vs integer of a different width, and pairs involving `Int128`/`UInt128`/`Int256`/`UInt256`) via a conversion to a common type instead of a dedicated compiled kernel for every combination of types. Same-type pairs, commonly used pairs, and the memory-bound `plus`/`minus`/`multiply` keep their dedicated kernels; results, result types and exceptional cases are unchanged. [#110131](https://github.com/ClickHouse/ClickHouse/pull/110131) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* A subquery on the right side of `IN` whose single column is an array one dimension deeper than the left argument is now interpreted as the set of the array's elements (like an array literal or an array-returning function), instead of failing with a confusing type-mismatch error. For example, `x IN (SELECT groupArray(x) FROM ...)` now works. [#110169](https://github.com/ClickHouse/ClickHouse/pull/110169) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reading from a `SQLite` table engine or `sqlite` table function no longer busy-spins a full CPU core when the SQLite database is locked by another connection. The read now idles while waiting for the lock and stays cancellable. [#110248](https://github.com/ClickHouse/ClickHouse/pull/110248) ([Groene AI](https://github.com/groeneai)).
* Round elapsed time, rate, and ratio values in log and exception messages to three digits, so numbers like `1.345844286 sec.` are no longer printed at full precision. [#110277](https://github.com/ClickHouse/ClickHouse/pull/110277) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI (Play), `BFloat16` is now recognized as a floating point number and its columns are right-aligned and colorized accordingly. [#110433](https://github.com/ClickHouse/ClickHouse/pull/110433) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support the `SETTINGS` clause for the `PostgreSQL` table engine and the `postgresql` table function (for example `SETTINGS postgresql_connection_pool_size = 50`), bringing feature parity with the `MySQL` engine. [#110614](https://github.com/ClickHouse/ClickHouse/pull/110614) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `SHOW CREATE TABLE` (and `SHOW CREATE VIEW` / `SHOW CREATE DICTIONARY`) now suggests a similarly-named table in the error message when the requested table does not exist, the same way `SELECT` queries do. [#110633](https://github.com/ClickHouse/ClickHouse/pull/110633) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Enable the `merge_selector_enable_heuristic_to_lower_max_parts_to_merge_at_once` setting by default: the merge selector now automatically lowers the maximum number of parts to merge at once based on how full the partition is. See [#91163](https://github.com/ClickHouse/ClickHouse/pull/91163). [#110726](https://github.com/ClickHouse/ClickHouse/pull/110726) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Accept PostgreSQL cleanup commands `RESET`, `UNLISTEN`, and `DISCARD` as no-ops in the PostgreSQL wire protocol instead of failing them with a syntax error. This improves compatibility with drivers such as Skunk that send `RESET ALL` and `UNLISTEN *` during connection setup and cleanup. [#110780](https://github.com/ClickHouse/ClickHouse/pull/110780) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Change the default value of the `auto_statistics_types` setting from `basic, uniq` to `basic, uniq_v2`. [#110878](https://github.com/ClickHouse/ClickHouse/pull/110878) ([Han Fei](https://github.com/hanfei1991)).
* `randomHadamardTransform` now computes an exact, length-preserving transform for any vector length whose largest odd factor is at most 64 (for example `3584 = 512 * 7`, common in embedding models), extending the previous `2^N`, `2^k * {12, 20}`, and `2^k * 9` families. A full transform of a length that cannot be represented exactly now raises an exception instead of silently zero-padding to a longer vector; pass `output_dims` to compute a truncated projection of an arbitrary length. [#111006](https://github.com/ClickHouse/ClickHouse/pull/111006) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `LOGICAL_ERROR` exception during backup of a `Replicated` database that is being dropped and recreated concurrently; such backups now fail cleanly with `CANNOT_GET_REPLICATED_DATABASE_SNAPSHOT`. [#100651](https://github.com/ClickHouse/ClickHouse/pull/100651) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Surface the real underlying error when a zip archive cannot be unpacked (for example, when the archive is read from S3 and the read buffer refuses a seek). Previously, the actual error was hidden behind the generic `Couldn't unpack zip archive: Code = -100` / `Couldn't open zip archive` message. [#105103](https://github.com/ClickHouse/ClickHouse/pull/105103) ([Groene AI](https://github.com/groeneai)).
* Fix a confusing "Maybe you meant X?" hint after a server restart (or `DETACH DATABASE`/`ATTACH DATABASE`): dropping an already-dropped table could suggest the just-dropped name as the alternative. [#106238](https://github.com/ClickHouse/ClickHouse/pull/106238) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error (`Logical error: 'removed'`, aborting the server in debug builds) in the background table-drop queue, triggered when the same explicit UUID is reused across several `CREATE OR REPLACE TABLE` queries, which enqueues more than one dropped table sharing that UUID. [#107031](https://github.com/ClickHouse/ClickHouse/pull/107031) ([Groene AI](https://github.com/groeneai)).
* Fixed an `Inconsistent AST formatting` logical error that could abort the server in debug and sanitizer builds when an aliased lambda was used as the operand of an access operator (tuple element `.N` or array element `[]`) at a non-first position of an expression list, e.g. `SELECT 1, ((p0, p1) -> p0 AS a7).4[3] FROM t`. [#107092](https://github.com/ClickHouse/ClickHouse/pull/107092) ([Groene AI](https://github.com/groeneai)).
* A cluster table function (`urlCluster`, `fileCluster`, `s3Cluster`, ...) nested inside another distributed query, such as `clusterAllReplicas(..., urlCluster(...))`, is now rejected with a `BAD_ARGUMENTS` error instead of failing with a logical error (`Distributed task iterator is not initialized`). [#107107](https://github.com/ClickHouse/ClickHouse/pull/107107) ([Groene AI](https://github.com/groeneai)).
* `OPTIMIZE ... DRY RUN` interrupted by a query timeout (`max_execution_time` with `timeout_overflow_mode = 'break'`) now returns `TIMEOUT_EXCEEDED` instead of a logical error about `rows_sources` (which aborted the server in debug/sanitizer builds). [#107114](https://github.com/ClickHouse/ClickHouse/pull/107114) ([Groene AI](https://github.com/groeneai)).
* Stop logging a benign `Net Exception: Socket is not connected` error during `ZooKeeper` session finalize on macOS. `clickhouse keeper-client` no longer prints this spurious error to stderr at exit. [#107438](https://github.com/ClickHouse/ClickHouse/pull/107438) ([Groene AI](https://github.com/groeneai)).
* Fixed a signed integer overflow when a refreshable materialized view retries a failed refresh with `refresh_retries` set to a very large value (near `Int64` max). The overflow could abort the server in builds with the undefined behavior sanitizer. [#108005](https://github.com/ClickHouse/ClickHouse/pull/108005) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (server abort in debug/sanitizer builds) when a `JOIN` uses the null-safe comparison operator (`<=>` / `IS NOT DISTINCT FROM`) and one of the keys is a scalar subquery, e.g. `... JOIN t2 ON (SELECT x FROM t1) <=> t2.k`, with the old analyzer (`enable_analyzer = 0`). Such a query now returns a regular `NOT_FOUND_COLUMN_IN_BLOCK` error instead of a logical error. [#108123](https://github.com/ClickHouse/ClickHouse/pull/108123) ([Groene AI](https://github.com/groeneai)).
* Vector search queries that select the `_distance` column now return a proper error instead of failing with a logical error. [#108423](https://github.com/ClickHouse/ClickHouse/pull/108423) ([Robert Schulze](https://github.com/rschu1ze)).
* Fix a `std::future_error` (`The associated promise has been destructed prior to the associated state becoming ready`) that could surface, and abort the server in debug and sanitizer builds, when scheduling the final asynchronous S3/Azure multipart-upload completion task failed (for example under thread-pool exhaustion). The real scheduling error is now reported instead. [#108730](https://github.com/ClickHouse/ClickHouse/pull/108730) ([Groene AI](https://github.com/groeneai)).
* Avoid excessive server log output and an oversized error message when compiling a very large regular expression (for example a `LIKE` or `match` pattern with hundreds of thousands of wildcards); such patterns now fail with a clear `CANNOT_COMPILE_REGEXP` error. [#108821](https://github.com/ClickHouse/ClickHouse/pull/108821) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed undefined behaviour when stringifying an out-of-range protocol packet type (e.g. in the `Unexpected packet from server` / `Received ... packet` error messages) for a desynced or fuzzed connection. [#108885](https://github.com/ClickHouse/ClickHouse/pull/108885) ([Groene AI](https://github.com/groeneai)).
* Fixed a confusing internal error (`Method getResultType is not supported for TABLE query tree node`) when a table expression was used as the left argument of the `IN` operator; such queries now produce a clear error message. [#109412](https://github.com/ClickHouse/ClickHouse/pull/109412) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed reading an Iceberg table with a metadata file whose version number is all digits but exceeds the 32-bit integer range (for example `v99999999999999999999.metadata.json`). Such a name previously produced an opaque `std::out_of_range` (`STD_EXCEPTION`) instead of a clear `BAD_ARGUMENTS` error. [#109619](https://github.com/ClickHouse/ClickHouse/pull/109619) ([Groene AI](https://github.com/groeneai)).
* Fixed a possible `Logical error: 'ReadBuffer is canceled. Can't read from it.'` when a row-based input format (e.g. `TSV`/`CSV`) failed to parse input and the underlying read had already been canceled (for example a malformed HTTP chunk or a truncated body). Building the verbose parse diagnostics no longer reads from a canceled buffer. [#109708](https://github.com/ClickHouse/ClickHouse/pull/109708) ([Groene AI](https://github.com/groeneai)).
* Row policy filter expressions using `arrayJoin` (or its `unnest` alias) are now rejected with a clear error; previously such policies raised a `column->size() == num_rows` logical error at query time. [#109753](https://github.com/ClickHouse/ClickHouse/pull/109753) ([Raúl Marín](https://github.com/Algunenano)). [#109973](https://github.com/ClickHouse/ClickHouse/pull/109973) ([Raúl Marín](https://github.com/Algunenano)).
* Reading a Paimon table whose schema contains an unsupported nested type (for example a `ROW` field) now reports a clear `BAD_ARGUMENTS` error naming the unsupported type, instead of a bare `DB::Exception. (OK)` with error code 0 and no message. [#109762](https://github.com/ClickHouse/ClickHouse/pull/109762) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` (`std::length_error`) when a query with the experimental setting `make_distributed_plan = 1` used a very large `distributed_plan_default_reader_bucket_count` or `distributed_plan_default_shuffle_join_bucket_count`. Such values are now rejected with `INVALID_SETTING_VALUE`. [#109770](https://github.com/ClickHouse/ClickHouse/pull/109770) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`query tree node does not have valid source node`) when a recursive CTE resolved an identifier from an outer scope as a correlated column (with `allow_experimental_correlated_subqueries = 1`). Such queries now return a clear `UNSUPPORTED_METHOD` error. [#109863](https://github.com/ClickHouse/ClickHouse/pull/109863) ([Groene AI](https://github.com/groeneai)).
* Fix a signed integer overflow when `ORDER BY ... WITH FILL` skips a very large gap over an `Int64`/`UInt64` column (e.g. a step of 2 across a gap near 2^63). The overflow was undefined behavior under sanitizers and silently wrapped in release builds. [#109937](https://github.com/ClickHouse/ClickHouse/pull/109937) ([Groene AI](https://github.com/groeneai)).
* Fix a `Bad cast from type DB::FunctionNode to DB::ConstantNode` logical error (server abort in debug/sanitizer builds) when running `SELECT ... ORDER BY ... WITH FILL` against a `Distributed` table with a low `optimize_const_name_size`. [#109938](https://github.com/ClickHouse/ClickHouse/pull/109938) ([Groene AI](https://github.com/groeneai)).
* Fixed an `Invalid number of rows in Chunk` logical error when an `INTERPOLATE` target is an alias of a `WITH FILL` column with the old analyzer (`enable_analyzer = 0`). Such queries are now rejected with a clear `INVALID_WITH_FILL_EXPRESSION` error. [#110103](https://github.com/ClickHouse/ClickHouse/pull/110103) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error (server abort in debug/sanitizer builds) when the `indexHint`/`ignore`/`isZeroOrNull` functions are given an argument whose type resolves to `Nothing`, e.g. inside expressions like `indexHint(assumeNotNull(materialize(NULL)))`. [#110192](https://github.com/ClickHouse/ClickHouse/pull/110192) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error `Too large size (...) passed to allocator` that could occur when an out-of-range value was set for a read buffer size setting such as `max_read_buffer_size` or `max_read_buffer_size_local_fs`. Such values are now clamped to 256 MiB by the settings sanity check, and additionally at the consumption site for `INSERT ... FROM INFILE`, which reads files inside `clickhouse-client` where the sanity check does not apply. [#110207](https://github.com/ClickHouse/ClickHouse/pull/110207) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `CHECK TABLE` now reports the actual corruption for a projection part that failed to load its metadata, instead of a misleading `Columns doesn't match ... Expected: 0 columns` error. [#110262](https://github.com/ClickHouse/ClickHouse/pull/110262) ([Raúl Marín](https://github.com/Algunenano)).
* A type mismatch when a value read from a PostgreSQL source (e.g. the `postgresql` table function or the `PostgreSQL` table engine) cannot be parsed into the declared column type (for example a `text` column declared as `Int32`) is now reported as a proper query error; previously it aborted the server in debug and sanitizer builds. [#110264](https://github.com/ClickHouse/ClickHouse/pull/110264) ([Groene AI](https://github.com/groeneai)).
* Support the query profiler, memory and trace profilers, and `system.trace_log` symbolization on macOS. [#109825](https://github.com/ClickHouse/ClickHouse/pull/109825) ([Raúl Marín](https://github.com/Algunenano)).
* Update `chdig` to [v26.7.1](https://github.com/azat/chdig/releases/tag/v26.7.1): compressed stack traces for sharing, query patterns, separate-arena memory support, Perfetto improvements, and compatibility fixes. [#110938](https://github.com/ClickHouse/ClickHouse/pull/110938) ([Azat Khuzhin](https://github.com/azat)).
* Fix incorrect monotonicity inference for `intDiv` on an unsigned key divided by a signed constant, which could disable primary-key index pruning for `IN`/`NOT IN` predicates that cross the signed boundary of the result type; debug builds also hit a `LOGICAL_ERROR` `Invalid binary search result in MergeTreeSetIndex`. [#107586](https://github.com/ClickHouse/ClickHouse/pull/107586) ([Groene AI](https://github.com/groeneai)).
* Added the `allow_lossy_numeric_supertype` setting (disabled by default). When enabled, `if`, `multiIf`, `coalesce`, `ifNull`, `array`, and `map` over numeric arguments that have no lossless common type (for example `Decimal` and `Float64`, or `Int64` and `Float64`) resolve to `Float64` instead of `Variant`, so the result can be used with aggregate functions such as `sum`, `avg`, `min`, and `max`. Relevant aggregate-function error messages now mention the setting by name. Closes [#106707](https://github.com/ClickHouse/ClickHouse/issues/106707). [#107236](https://github.com/ClickHouse/ClickHouse/pull/107236) ([Groene AI](https://github.com/groeneai)).
* Start the Prometheus endpoint (for metrics-only configurations) and asynchronous metrics collection before tables are loaded, so metrics are visible during the potentially long metadata loading phase. [#108402](https://github.com/ClickHouse/ClickHouse/pull/108402) ([Christoph Wurm](https://github.com/cwurm)).

<h4 id="267-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Fix `TRUNCATE TABLE` and `DROP PARTITION` failing on tables with many deduplication blocks, where removing them in a single ZooKeeper request could exceed the default 1 MB `jute.maxbuffer` limit. [#105991](https://github.com/ClickHouse/ClickHouse/pull/105991) ([Clayton McClure](https://github.com/cmcclure-twilio)). This only affects you if you use Apache ZooKeeper (not recommended) instead of ClickHouse Keeper.
* Fix the usage of qualified column names (`database.table.column`) in the `WHERE` clause of mutations, such as `DELETE FROM` and `ALTER TABLE ... UPDATE/DELETE`, over `MergeTree`-family tables; previously such queries failed with a missing-columns error. Closes [#71760](https://github.com/ClickHouse/ClickHouse/issues/71760). [#109491](https://github.com/ClickHouse/ClickHouse/pull/109491) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix the query result cache for PromQL queries. The `promql` dialect bypassed the non-deterministic-function check and could serve stale results anchored at `now()`; the Prometheus HTTP API (`/api/v1/query`, `/api/v1/query_range`) never stored cache entries at all. [#110887](https://github.com/ClickHouse/ClickHouse/pull/110887) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Fix the server failing to start when the `TZ` environment variable is empty. Closes [#68920](https://github.com/ClickHouse/ClickHouse/issues/68920). [#68921](https://github.com/ClickHouse/ClickHouse/pull/68921) ([Ardenwick](https://github.com/ardenwick)).
* Fixed the server failing to start when a `Backup` database engine refers to a backup that has become unavailable (for example, when its files were deleted or the underlying storage is inaccessible). The database is now loaded without tables instead of preventing the whole server from starting. [#83188](https://github.com/ClickHouse/ClickHouse/pull/83188) ([Vitaly Orlov](https://github.com/orloffv)).
* When using background inserts into tables with the `Distributed` engine, delays caused by repeated errors when sending data to remote shards now decrease once the errors are resolved. Previously, the delay would only increase and never reset. [#87378](https://github.com/ClickHouse/ClickHouse/pull/87378) ([Andrei Kochemirovskii](https://github.com/Blackmorse)).
* Fix `broken_data_files` in `system.distribution_queue` and the `BrokenDistributedFilesToInsert` metric always reporting `0` for broken files discovered when scanning the `Distributed` async-insert queue at startup. [#92124](https://github.com/ClickHouse/ClickHouse/pull/92124) ([KG.Xu](https://github.com/squalfof)).
* Fix recovery of logging after a disk-full error. Previously, when the log disk became full, ClickHouse would enter a failed state and continuously spam error messages to syslog (potentially writing 100+ GB/hour), never recovering even after disk space was freed. Now the logging system automatically recovers once disk space becomes available, without requiring a server restart. [#93127](https://github.com/ClickHouse/ClickHouse/pull/93127) ([jaehanbyun](https://github.com/jaehanbyun)).
* Forward static S3 credentials to Unity `DataLakeCatalog` table reads when `vended_credentials` is disabled, preventing anonymous object-storage access failures. [#96910](https://github.com/ClickHouse/ClickHouse/pull/96910) ([kgeg401](https://github.com/kgeg401)).
* Fix a crash in the schema parsing code of the `DeltaLake` table engine. [#97112](https://github.com/ClickHouse/ClickHouse/pull/97112) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix a security issue where an unauthenticated TCP client could probe table existence and replication status via the interserver port. [#99854](https://github.com/ClickHouse/ClickHouse/pull/99854) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix a syntax error when an alias follows a subquery in `DESCRIBE TABLE`. Fixes [#100031](https://github.com/ClickHouse/ClickHouse/issues/100031). [#100205](https://github.com/ClickHouse/ClickHouse/pull/100205) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed an exception in correlated subqueries when outer columns become `Nullable` under `group_by_use_nulls` with `ROLLUP`/`CUBE`. [#100365](https://github.com/ClickHouse/ClickHouse/pull/100365) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a server abort (in sanitizer builds) and silent data loss during table startup when a rolled-back transactional `MergeTree` part intersects a committed part. [#100992](https://github.com/ClickHouse/ClickHouse/pull/100992) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fixed `indexOfAssumeSorted` returning incorrect results for `Array(LowCardinality(String))` columns in `MergeTree` tables. [#101771](https://github.com/ClickHouse/ClickHouse/pull/101771) ([Yash ](https://github.com/Onyx2406)).
* Fix incorrect primary-key pruning when a table's sorting key wraps a `Date` column in `toDateTime` (for example, `ORDER BY toDateTime(date_column)`) and a query filters on the original column with a comparison like `WHERE date_column >= '...'`. `toDateTime(Date)` overflows for `Date` values beyond the `DateTime` range (after `2106-02-07`), so the stored key is non-monotonic; ClickHouse no longer uses primary key pruning for this key/predicate combination because doing so could drop granules that contain matching rows. Closes [#101744](https://github.com/ClickHouse/ClickHouse/issues/101744). [#101814](https://github.com/ClickHouse/ClickHouse/pull/101814) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed `intDivOrNull`, `moduloOrNull` and `positiveModuloOrNull` returning `0` instead of `NULL`, and `intDivOrNull` and `intDivOrZero` raising an exception instead of returning `NULL` / `0`, when the division leads to a floating-point exception (division by zero or `INT_MIN / -1`), including for mixed signed/unsigned arguments. [#101976](https://github.com/ClickHouse/ClickHouse/pull/101976) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix `LOGICAL_ERROR` exceptions when reading `Iceberg` or `DeltaLake` tables in corner cases such as concurrent `Iceberg` metadata updates or reads through the `merge` table function over `DeltaLake` tables. [#102033](https://github.com/ClickHouse/ClickHouse/pull/102033) ([Groene AI](https://github.com/groeneai)).
* Fix outbound HTTP requests (e.g. the `aiGenerate` function, the `url` table function, S3) failing with `No route to host` on hosts that advertise both IPv4 and IPv6 addresses when only one address family is routable. The HTTP connection pool now falls back to the next resolved address when the first one fails with a network error, instead of propagating the error on the very first request. [#103786](https://github.com/ClickHouse/ClickHouse/pull/103786) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a server abort during `RESTORE` of backups containing tables with cyclic dependencies. [#103824](https://github.com/ClickHouse/ClickHouse/pull/103824) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Schema inference for Arrow `time32`/`time64` columns (e.g. `SELECT * FROM file(..., 'Arrow')`) now infers `Time64` instead of `DateTime64`; anything downstream relying on the old inferred type will observe the new type after an upgrade. Also, `Time`/`Time64` values can now be exported to Arrow with the appropriate Apache Arrow time type selected by precision. Fixes [#104038](https://github.com/ClickHouse/ClickHouse/issues/104038). [#104316](https://github.com/ClickHouse/ClickHouse/pull/104316) ([/bin/cat](https://github.com/Maoyao233)).
* Fixed a race between `ALTER TABLE ... RENAME COLUMN` and a concurrent `OPTIMIZE TABLE ... FINAL` (or any background merge) in `MergeTree` that could silently replace the renamed column's data with default values. [#104822](https://github.com/ClickHouse/ClickHouse/pull/104822) ([Groene AI](https://github.com/groeneai)).
* Fixed a `Block structure mismatch` logical error during a concurrent `INSERT` while an `ALTER TABLE ... RENAME COLUMN` is in flight, in an `Atomic` database with `lazy_load_tables = 1` after `DETACH DATABASE`/`ATTACH DATABASE`. [#104852](https://github.com/ClickHouse/ClickHouse/pull/104852) ([Groene AI](https://github.com/groeneai)).
* Fix `groupConcat` when the parametric and two-argument spellings are mixed, e.g. `groupConcat(',', 2)(x, '/')`: the row-limit parameter was silently dropped, so every row was returned instead of the requested number; the delimiter from the second argument now correctly overrides the parameter. [#104882](https://github.com/ClickHouse/ClickHouse/pull/104882) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix a `LOGICAL_ERROR` (`Expected one block from input stream`) thrown by `KILL QUERY`/`KILL MUTATION`/`KILL PART_MOVE_TO_SHARD`/`KILL TRANSACTION` when their `WHERE` clause contains a per-row subquery, or when `max_block_size` is small enough that the internal `SELECT` over the relevant `system.*` table emits more than one block. [#104927](https://github.com/ClickHouse/ClickHouse/pull/104927) ([Groene AI](https://github.com/groeneai)).
* Fixed `CAST` from smaller to larger interval units returning wrong results (for example, `CAST(toIntervalSecond(60) AS IntervalMinute)` returned `0` instead of `1`). Closes [#104986](https://github.com/ClickHouse/ClickHouse/issues/104986). [#105058](https://github.com/ClickHouse/ClickHouse/pull/105058) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix a logical error (`Assertion 'row < chunk.getNumRows()' failed`) in `LIMIT ... WITH TIES` queries running with the read-in-order pipeline (`optimize_read_in_order = 1` and `read_in_order_use_virtual_row_per_block = 1`). [#105102](https://github.com/ClickHouse/ClickHouse/pull/105102) ([Groene AI](https://github.com/groeneai)).
* Fix a leak in refreshable materialized views (`MATERIALIZED VIEW ... REFRESH ...`): the temporary inner table that a refresh rotates out via `EXCHANGE TABLES` could not be dropped if it was larger than `max_table_size_to_drop`, so every subsequent refresh created yet another temporary inner table, growing the view's data directory until the disk was exhausted. The refresh task's internal drop now bypasses `max_table_size_to_drop` and `max_partition_size_to_drop`; those safety nets still apply to user-issued `DROP TABLE` of the view itself. Closes [#104900](https://github.com/ClickHouse/ClickHouse/issues/104900). [#105106](https://github.com/ClickHouse/ClickHouse/pull/105106) ([Groene AI](https://github.com/groeneai)).
* Fix an unexpected `DATA_TYPE_CANNOT_BE_USED_IN_KEY` error on `ALTER` queries that do not change the sorting key (changing settings, comments, codecs, adding a non-key column, etc.) for `MergeTree` tables that have a `SimpleAggregateFunction` (or another type allowed only with `allow_suspicious_primary_key = 1`) in the sorting key. [#105111](https://github.com/ClickHouse/ClickHouse/pull/105111) ([Groene AI](https://github.com/groeneai)).
* Fixed a use-after-free when querying `system.clusters` replica-state columns (such as `is_active`, `unsynced_after_recovery`, `recovery_time`) while a `Replicated` database is being dropped or detached. Also, benign Keeper exceptions swallowed in this code path (the affected database is treated as transiently unavailable and skipped) are now logged at the `Information` level instead of `Error`, so they no longer reach clients at the default `send_logs_level = 'warning'`. [#105149](https://github.com/ClickHouse/ClickHouse/pull/105149) ([Groene AI](https://github.com/groeneai)).
* Fixed an issue where running multiple statements in `clickhouse-local --ignore-error` would echo every subsequent statement inside the error message for each lexical error or unmatched-parenthesis error. [#105480](https://github.com/ClickHouse/ClickHouse/pull/105480) ([Groene AI](https://github.com/groeneai)).
* Fix a rare server crash when refreshable materialized views are dropped or replaced concurrently with their refresh scheduling. [#105588](https://github.com/ClickHouse/ClickHouse/pull/105588) ([Groene AI](https://github.com/groeneai)).
* Reject `ALTER TABLE ... DELETE` and `ALTER TABLE ... UPDATE` on `Iceberg` tables whose data file format is not `Parquet` with a clear `NOT_IMPLEMENTED` error instead of crashing the server or silently corrupting the table. [#105893](https://github.com/ClickHouse/ClickHouse/pull/105893) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results from a view defined with `EXCEPT` or `INTERSECT` whose operand is a `UNION` chain, after `DETACH`/`ATTACH` or a server restart. The formatter was missing parentheses around `UNION` children of `INTERSECT`/`EXCEPT`, so the stored SQL was reparsed with reversed precedence. [#105935](https://github.com/ClickHouse/ClickHouse/pull/105935) ([Groene AI](https://github.com/groeneai)).
* Fix `JSON` data misdetected as `TSKV` during format auto-detection. Closes [#100797](https://github.com/ClickHouse/ClickHouse/issues/100797). [#106009](https://github.com/ClickHouse/ClickHouse/pull/106009) ([Pavel Kruglov](https://github.com/Avogar)).
* Forbid creating a `minmax` skip index directly on `JSON` columns — it could later fail inserts with a `NO_COMMON_TYPE` exception when mixed-type arrays were inserted. Create the index on typed subcolumns instead (e.g. `INDEX idx json.field TYPE minmax`). [#106094](https://github.com/ClickHouse/ClickHouse/pull/106094) ([linhaojie](https://github.com/linhaojie)).
* Fixed a logical error (`Parsed partition value ... doesn't match partition value for an existing part with the same partition ID`) thrown by `OPTIMIZE TABLE ... PARTITION ...` and other queries that resolve a partition value, on tables with a `Time`-typed partition key. [#106202](https://github.com/ClickHouse/ClickHouse/pull/106202) ([Groene AI](https://github.com/groeneai)).
* Fix a data part being incorrectly marked as having a broken projection after a lightweight delete leaves no projection part behind — either when the projection is rebuilt with zero output rows or when it is dropped (`lightweight_mutation_projection_mode = 'rebuild'`/`'drop'`). The broken state previously disabled projection optimization for queries on that part. [#106273](https://github.com/ClickHouse/ClickHouse/pull/106273) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed `removeDirectory` on `plain` object storage disks (such as `s3_plain`) removing all files inside a non-empty directory as if the removal were recursive; removing a non-empty directory now fails with `CANNOT_RMDIR`, and recursive removal handles the contents explicitly. [#106281](https://github.com/ClickHouse/ClickHouse/pull/106281) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Fixed a logical error (`Part ... doesn't exist`) that could abort the server during recovery of a quorum `INSERT` from a Keeper hardware error when the quorum was concurrently marked as failed. [#106424](https://github.com/ClickHouse/ClickHouse/pull/106424) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `LOGICAL_ERROR` exception about duplicate column names when applying row policies. [#106438](https://github.com/ClickHouse/ClickHouse/pull/106438) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix `CREATE OR REPLACE TABLE` and `REPLACE TABLE` leaving a stranded `_tmp_replace_*` table on disk and replacing the original table with an empty one when the existing target exceeds `max_table_size_to_drop`. The size check now runs before the swap, so a violation aborts cleanly with the user-visible table name in the error. [#106782](https://github.com/ClickHouse/ClickHouse/pull/106782) ([Groene AI](https://github.com/groeneai)).
* Fix `JSON_QUERY`/`JSON_VALUE`/`JSON_EXISTS` returning `Dynamic` instead of `String`/`UInt8` on `Dynamic` arguments. Closes [#106461](https://github.com/ClickHouse/ClickHouse/issues/106461). [#106877](https://github.com/ClickHouse/ClickHouse/pull/106877) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed wrong results when querying a `ReplacingMergeTree` table with `FINAL` and a filter on a text index while `query_plan_optimize_lazy_final` was enabled. The lazy `FINAL` optimization built reading steps that did not reproduce the direct read from the text index, so the filter dropped all matching rows. [#106894](https://github.com/ClickHouse/ClickHouse/pull/106894) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Apply `query_masking_rules` to messages appended to exceptions, so URL-encoded credentials in `(in file/uri ...)` suffixes of errors from the `jdbc`/`odbc` table functions are not leaked when masking rules are configured. [#106916](https://github.com/ClickHouse/ClickHouse/pull/106916) ([Gaurav Dubey](https://github.com/gaurav0107)).
* Fixed parts being marked as broken and detached on any part reload (server restart, `DETACH`/`ATTACH`) for tables with a `LowCardinality(Nullable(...))` column in the partition key. Since 26.5, the per-part minmax index file was not written when such a column's minimum and maximum were `NULL`, while the part consistency check still required the file. Parts written by affected versions lack the minmax index file and still need to be re-attached manually. Closes [#106837](https://github.com/ClickHouse/ClickHouse/issues/106837). [#106945](https://github.com/ClickHouse/ClickHouse/pull/106945) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fix a `LOGICAL_ERROR` (`Unexpected expression in JOIN ON section. Expected boolean (UInt8), got 'Nothing'`) when a non-equi `JOIN ... ON` predicate references a `Nothing`-typed column, such as one produced by `ARRAY JOIN []`. [#106981](https://github.com/ClickHouse/ClickHouse/pull/106981) ([Groene AI](https://github.com/groeneai)).
* Fix a rare `LOGICAL_ERROR` (`Attempt to release query context that does not exist`) and the accompanying server crash when reading `MergeTree` tables through a filesystem cache disk created with `enable_filesystem_query_cache_limit = 1`. [#107028](https://github.com/ClickHouse/ClickHouse/pull/107028) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash when moving an empty part to a `plain_rewritable` disk (for example, with `ALTER TABLE ... MOVE PARTITION ... TO DISK` for an empty part kept by `remove_empty_parts = 0`). [#107040](https://github.com/ClickHouse/ClickHouse/pull/107040) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect row order in `ORDER BY` queries over `UNION ALL` with `optimize_read_in_order` and `read_in_order_use_virtual_row` enabled. Closes [#106879](https://github.com/ClickHouse/ClickHouse/issues/106879). [#107053](https://github.com/ClickHouse/ClickHouse/pull/107053) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a `LOGICAL_ERROR` (`Unsupported argument types`) in the `geohashesInBox` function when its coordinate arguments mixed constant and non-constant values, or when a coordinate was a `BFloat16`. Mixed const/non-const `Float32` arguments now work, and `BFloat16` arguments are rejected with a clear error. [#107063](https://github.com/ClickHouse/ClickHouse/pull/107063) ([Groene AI](https://github.com/groeneai)).
* Fixed wrong results (duplicate rows) for `SELECT DISTINCT` over a `GROUP BY` with `WITH CUBE`, `WITH ROLLUP`, or `GROUPING SETS` on the same keys. The `query_plan_remove_redundant_distinct` optimization no longer removes the `DISTINCT` in these cases, because the grouping modifiers emit extra rows with the key columns defaulted, which can collide with real group values. [#107072](https://github.com/ClickHouse/ClickHouse/pull/107072) ([Groene AI](https://github.com/groeneai)).
* Fix a wrong result in an `OUTER JOIN` when the `WHERE` filter is a conjunction that contains a constant term (for example `p AND 1`, or `WHERE p QUALIFY NULL` where the `QUALIFY NULL` is merged into `WHERE`). The constant conjunct could be pushed into the non-preserved side of the join and removed from the post-join filter, so the join produced non-matched rows with the side columns defaulted, and those rows incorrectly passed the filter. [#107084](https://github.com/ClickHouse/ClickHouse/pull/107084) ([Groene AI](https://github.com/groeneai)).
* Fixed `executable_pool` user-defined functions configured with `<lifetime>` not picking up changes to the underlying script. Previously, only `SYSTEM RELOAD FUNCTIONS` would re-read an edited script; periodic `<lifetime>` reloads kept executing the old version. [#107087](https://github.com/ClickHouse/ClickHouse/pull/107087) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` exception (`Cannot find input column ... on its position in inputs of expression actions DAG`) for a correlated scalar subquery over a source projecting the same column identifier twice (e.g. `SELECT number, *`) when `correlated_subqueries_default_join_kind = 'left'`. [#107112](https://github.com/ClickHouse/ClickHouse/pull/107112) ([Groene AI](https://github.com/groeneai)).
* Fixed a data race on the server-global trace collector between a worker thread starting its profiler and server shutdown. [#107307](https://github.com/ClickHouse/ClickHouse/pull/107307) ([Groene AI](https://github.com/groeneai)).
* Incremental backups no longer store `S3` credentials in the `<base_backup>` locator of the `.backup` metadata file. Backups created with `use_same_s3_credentials_for_base_backup = 1`, or with explicit base backup credentials matching this backup locator, store a non-secret marker and are restored without extra restore-time settings; for backups created with different explicit base backup credentials or extra base authentication arguments, pass them to `RESTORE` with the `base_backup` setting. Backups created by older versions with embedded credentials remain restorable. [#107357](https://github.com/ClickHouse/ClickHouse/pull/107357) ([Pablo Marcos](https://github.com/pamarcos)).
* Fixed the `CSVWithNames` and `CSVWithNamesAndTypes` header having fewer columns than the data when `output_format_csv_serialize_tuple_into_separate_columns` is enabled (the default). The header (and the types row) now flattens `Tuple` columns into their leaf fields with dotted names (e.g. `t.a`, `t.b`), so the header column count matches the data. A new setting `output_format_csv_header_serialize_tuple_into_separate_columns` (default `1`) controls this and can be set to `0` to restore the previous single-name header. [#107371](https://github.com/ClickHouse/ClickHouse/pull/107371) ([Groene AI](https://github.com/groeneai)).
* Fixed reading `Iceberg` v3 tables whose `Parquet` data files contain reserved row-lineage columns (such as `_row_id`); the native `Parquet` reader no longer raises `ICEBERG_SPECIFICATION_VIOLATION` for reserved field IDs that are not part of the table schema. [#107377](https://github.com/ClickHouse/ClickHouse/pull/107377) ([Greg Maher](https://github.com/gregakinman)).
* Fixed a rare server abort during shutdown (`std::future_error`: `The associated promise has been destructed prior to the associated state becoming ready`) caused by a scheduled task being dropped from a thread pool queue before it ran. [#107383](https://github.com/ClickHouse/ClickHouse/pull/107383) ([Groene AI](https://github.com/groeneai)).
* Fix the `MaterializedPostgreSQL` table and database engines so that a single table or database can be replicated from a non-default PostgreSQL schema (`materialized_postgresql_schema`), including the case where tables with the same name exist in several schemas of the same database (previously they would share a publication and replication slot and cross-talk). [#107425](https://github.com/ClickHouse/ClickHouse/pull/107425) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `MaterializedPostgreSQL` stopping replication of an entire database (with `LOGICAL_ERROR: Columns number mismatch`) when a single replicated table's structure changed while the server was down. Now only the affected table is skipped and can be recovered with `DETACH`/`ATTACH`. [#107427](https://github.com/ClickHouse/ClickHouse/pull/107427) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `BACKUP` of a `MaterializedPostgreSQL` database no longer hangs forever with `Table ... were created or changed its definition during scanning`, and now actually backs up the table data (delegated to the underlying `ReplacingMergeTree`), which can be restored as a standalone `ReplacingMergeTree`. [#107433](https://github.com/ClickHouse/ClickHouse/pull/107433) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a regression where setting `compatibility = '26.6'` (which implicitly enables the `hive` partition strategy) silently accepted `{_partition_id}` in S3/object storage table paths instead of raising `BAD_ARGUMENTS`. [#107437](https://github.com/ClickHouse/ClickHouse/pull/107437) ([Lefteris](https://github.com/LefterisXefteris)).
* Fixed a memory leak in the bundled `mongo-c-driver` that could occur when reading from MongoDB (for example, via a MongoDB dictionary or the `mongodb` table function) if a retryable read error was followed by a failed retry server selection. [#107448](https://github.com/ClickHouse/ClickHouse/pull/107448) ([Groene AI](https://github.com/groeneai)).
* Fix an exception when inserting into an `Iceberg` table whose metadata was created by an external engine and omits the optional `snapshots`, `metadata-log`, or `snapshot-log` arrays. Such inserts now succeed instead of failing. [#107473](https://github.com/ClickHouse/ClickHouse/pull/107473) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed `DELETE FROM` (lightweight delete) requiring the `ALTER UPDATE` privilege in addition to `ALTER DELETE`. A user granted only `ALTER DELETE` can now run `DELETE FROM`, as documented. [#107491](https://github.com/ClickHouse/ClickHouse/pull/107491) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed `NOT_FOUND_COLUMN_IN_BLOCK` when reading Hive-partitioned files with `use_hive_partitioning = 1` and a `WHERE`/`PREWHERE` clause that filters a real (non-virtual) column while a Hive partition column is also selected. [#107505](https://github.com/ClickHouse/ClickHouse/pull/107505) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`Different order of columns in UNION subquery`) when the old analyzer (`enable_analyzer = 0`) reads a subset of columns from a subquery whose `UNION` children are `INTERSECT`/`EXCEPT` set operations. [#107511](https://github.com/ClickHouse/ClickHouse/pull/107511) ([Groene AI](https://github.com/groeneai)).
* Fix `NULL` values being silently converted to empty strings when inserting `Arrow`/`ORC` data into a `LowCardinality(Nullable(...))` column. This was a regression introduced in 26.5. [#107532](https://github.com/ClickHouse/ClickHouse/pull/107532) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix a logical error (`Stream ... variant_discr ... is not found`) that could occur when merging or reading a `MergeTree` part produced by a mutation of a table with a `Dynamic` column. [#107562](https://github.com/ClickHouse/ClickHouse/pull/107562) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a logical error (`WhichDataType(const_type).isArray()`) during primary-key analysis when `pointInPolygon` is called with a constant polygon argument of a wrapper type such as `Variant` or `Dynamic` (for example, `pointInPolygon((x, y), if(c, [(0, 0), ...], NULL))`). [#107589](https://github.com/ClickHouse/ClickHouse/pull/107589) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error (`Last stored last_written_position in meta file ... is bigger than current last_written_pos`) in the `FileLog` engine that could happen when a watched file was deleted and recreated reusing the same inode. [#107617](https://github.com/ClickHouse/ClickHouse/pull/107617) ([Groene AI](https://github.com/groeneai)).
* Fix a rare server abort (`std::future_error`: `The associated promise has been destructed prior to the associated state becoming ready`) during ZooKeeper client request processing, when an asynchronous Keeper request was dropped while being sent, for example under memory pressure. [#107647](https://github.com/ClickHouse/ClickHouse/pull/107647) ([Groene AI](https://github.com/groeneai)).
* Fixed `RESTORE` for `ReplicatedMergeTree` tables so duplicate-content parts from a backup are preserved instead of being silently deduplicated. [#107652](https://github.com/ClickHouse/ClickHouse/pull/107652) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix runtime join filter producing wrong results for `JSON` columns. Closes [#107646](https://github.com/ClickHouse/ClickHouse/issues/107646). [#107663](https://github.com/ClickHouse/ClickHouse/pull/107663) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed incorrect results from distributed queries selecting `ALIAS` columns that share a common subexpression: columns could be misaligned and values returned under the wrong column. [#107675](https://github.com/ClickHouse/ClickHouse/pull/107675) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Quotas keyed by `normalized_query_hash` now account all resources (`read_rows`, `read_bytes`, `result_rows`, `result_bytes`, `execution_time`, `written_bytes`, `errors`) per query pattern, like the query-count counters, instead of accounting them against a single shared per-user bucket. [#107681](https://github.com/ClickHouse/ClickHouse/pull/107681) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `Block structure mismatch in UnionStep stream` logical error (server abort on debug/sanitizer builds, `Code: 49` on release builds) that occurred when sibling branches of a `UNION`/`INTERSECT`/`EXCEPT` differed only in their `WHERE` predicate and one branch's predicate was constant-folded to a `Const` column. [#107719](https://github.com/ClickHouse/ClickHouse/pull/107719) ([Groene AI](https://github.com/groeneai)).
* Fix logical errors (`Bad cast`) caused by inconsistent stripping of `LowCardinality` nested inside `Variant` and `Dynamic` columns, for example in `concat`, `format`, and primary key analysis. Closes [#107598](https://github.com/ClickHouse/ClickHouse/issues/107598). [#107773](https://github.com/ClickHouse/ClickHouse/pull/107773) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed a severe work-distribution skew with parallel replicas when the cluster contains inactive replicas (for example, stale entries left after autoscaling). Such replicas are no longer counted by the reading coordinator, so work is balanced across the online replicas instead of piling onto a single one. [#107805](https://github.com/ClickHouse/ClickHouse/pull/107805) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the `Not-ready Set is passed as the second argument` exception that could occur when building an `IN` subquery set during primary key analysis failed silently (for example, a subquery timeout with `overflow_mode = 'break'`), leaving the set permanently unbuilt for the query pipeline. [#107924](https://github.com/ClickHouse/ClickHouse/pull/107924) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a server crash in predicate pushdown (`enable_optimize_predicate_expression`, legacy analyzer) when a `UNION` subquery appears inside a `JOIN ... ON` condition. [#107930](https://github.com/ClickHouse/ClickHouse/pull/107930) ([Groene AI](https://github.com/groeneai)).
* Fix spurious `CHECKSUM_DOESNT_MATCH` and `Parquet` read errors (and, for some formats, silently wrong results) when an S3 or S3-compatible (e.g. GCS) object is overwritten in place while being read. Such reads now fail with a clear, retryable error instead of returning data stitched from two object versions; controlled by the new setting `s3_validate_etag_on_read` (on by default). [#107934](https://github.com/ClickHouse/ClickHouse/pull/107934) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed a `SELECT` failing with `NOT_FOUND_COLUMN_IN_BLOCK` on a table that has a `set` data-skipping index when a row policy filters it using an always-true condition combined with a check on a non-indexed column. [#107971](https://github.com/ClickHouse/ClickHouse/pull/107971) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed executable user-defined function command parameter parsing so placeholders with empty or invalid names are not accepted as parameters. [#107983](https://github.com/ClickHouse/ClickHouse/pull/107983) ([Goutam Adwant](https://github.com/goutamadwant)).
* Fix performance regression for `Map` subcolumns with `PREWHERE`. Closes [#107912](https://github.com/ClickHouse/ClickHouse/issues/107912). Caused by [#99200](https://github.com/ClickHouse/ClickHouse/pull/99200). [#107988](https://github.com/ClickHouse/ClickHouse/pull/107988) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix an out-of-bounds write when reading a `Variant` column from a malformed `Native` block whose discriminators reference a variant index that does not exist. [#107991](https://github.com/ClickHouse/ClickHouse/pull/107991) ([uwezkhan](https://github.com/uwezkhan)).
* Fix wrong query results from incorrect primary key and partition pruning when `toStartOfDay`, `toStartOfISOYear`, `toDaysSinceYearZero`, `toRelativeSecondNum`, `toRelativeMinuteNum`, `toRelativeHourNum`, `toRelativeWeekNum`, `toRelativeDayNum`, `toMonthNumSinceEpoch`, or `toYearNumSinceEpoch` is applied to a `Date32` key column containing dates outside the range the function can represent (in particular dates before `1970-01-01`). These functions report themselves as monotonic to the primary index, but previously wrapped around for such arguments, so the index could prune granules that actually contained matching rows; they now saturate at the bounds of their result type and stay monotonic over the whole `Date32` range. [#108018](https://github.com/ClickHouse/ClickHouse/pull/108018) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `accurateCastOrNull` of a `Tuple` whose element is `Dynamic`/`Variant`: a genuine source `NULL` was treated as a conversion failure. For a `Nullable` target element a source `NULL` now stays an element `NULL` (matching a plain `Tuple(Nullable(...))` source); for a non-`Nullable` target element a source `NULL` now nulls the whole tuple instead of producing the element default; parse/overflow failures still null the whole tuple. [#108023](https://github.com/ClickHouse/ClickHouse/pull/108023) ([Groene AI](https://github.com/groeneai)). Also fix a logical error when casting a `Dynamic` or `Variant` column nested inside a `Tuple` to a non-`Nullable` element type with `accurateCastOrNull` or `accurateCastOrDefault`. [#108061](https://github.com/ClickHouse/ClickHouse/pull/108061) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `numericIndexedVectorPointwiseMultiply` returning an empty result when multiplying by an all-ones vector that has a different BSI (bit-sliced index) configuration. [#108027](https://github.com/ClickHouse/ClickHouse/pull/108027) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `toTime64` and `CAST(... AS Time64)` not clamping out-of-range values to the `Time64` range in `saturate` and `ignore` overflow modes, which could produce values that display identically but compare as different. [#108028](https://github.com/ClickHouse/ClickHouse/pull/108028) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `getClientHTTPHeader` is now correctly treated as non-deterministic, so its result is no longer incorrectly reused by the query result cache. [#108029](https://github.com/ClickHouse/ClickHouse/pull/108029) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `clickhouse-client --port 9440` again automatically enables a secure (TLS) connection; this was broken by a refactoring that stopped passing the port to the secure-connection check. [#108032](https://github.com/ClickHouse/ClickHouse/pull/108032) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* A transient error while refreshing data parts of a read-only table no longer permanently stops the background refresh task. [#108034](https://github.com/ClickHouse/ClickHouse/pull/108034) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed memory/CPU/mutation overload warnings in `system.warnings` lagging one asynchronous-metrics cycle behind (and being absent on the first cycle). [#108035](https://github.com/ClickHouse/ClickHouse/pull/108035) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `mongodb` table function now accepts `oid_columns` passed as a named argument (e.g. `oid_columns='_id'`), instead of rejecting it with `BAD_ARGUMENTS`. [#108039](https://github.com/ClickHouse/ClickHouse/pull/108039) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `Bad cast from type DB::ColumnNullable to DB::ColumnVector<...>` exception (logical error) when a qualified asterisk (`t.*`) selects a `JOIN USING` key and that join is nested below a `PASTE`/`CROSS`/comma join or an outer `ON` join, with `join_use_nulls = 0`. [#108043](https://github.com/ClickHouse/ClickHouse/pull/108043) ([Groene AI](https://github.com/groeneai)).
* Fixed incorrect handling of zero-width assertions (`\b`, `^`, `$`) in the regexp "match all" functions `extractAll`, `extractAllGroupsVertical`, `extractAllGroupsHorizontal`, `countMatches` and `splitByRegexp`. For example, `extractAll('new york is the greatest', '\b(\w)')` now correctly returns the first letter of each word instead of every letter. [#108047](https://github.com/ClickHouse/ClickHouse/pull/108047) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `CREATE TABLE ... AS SELECT` on `Atomic` databases leaving an empty table behind when the query fails — for example when the user has no access to a table referenced from a subquery. Previously a retry reported that the table already exists instead of the original error. The table is now created via a temporary table and becomes visible only after it has been fully populated. [#108048](https://github.com/ClickHouse/ClickHouse/pull/108048) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow querying a `range_hashed` or `complex_key_range_hashed` dictionary that uses a `DateTime64`, `Decimal` or floating-point range with a matching argument to `dictGet`/`dictHas`. Previously such queries failed with `must be convertible to Int64`, and open-ended intervals of `Decimal`/`DateTime64` ranges incorrectly returned the default value. [#108052](https://github.com/ClickHouse/ClickHouse/pull/108052) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an exception (`CANNOT_PARSE_TEXT`) when loading a dictionary with a composite key whose key columns are not the first columns in the dictionary definition, with a local `ClickHouse` source using an explicit query. Source columns are now matched to the dictionary structure by name instead of by position. [#108053](https://github.com/ClickHouse/ClickHouse/pull/108053) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed the `values` table function failing with `ARGUMENT_OUT_OF_BOUND` when a decimal literal that is not exactly representable in a narrow floating-point column (such as `0.1` for a `Float32` column) is used, e.g. `SELECT * FROM values('x Float32', 0.1)`. Such values are now accepted and converted to the nearest representable value, consistent with `CAST` and `INSERT ... VALUES`. [#108055](https://github.com/ClickHouse/ClickHouse/pull/108055) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `LOGICAL_ERROR` (`No available columns`) when executing `SELECT count()` (or other trivial queries) on a table where the user is granted `SELECT` access only on an `ALIAS` column. [#108056](https://github.com/ClickHouse/ClickHouse/pull/108056) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `mapFilter`, `mapSort` (and its variants) and `mapConcat` dropping `LowCardinality` from the key and value types of a `Map`. Previously `mapFilter` over a `Map(LowCardinality(String), String)` column returned `Map(String, String)`, which could corrupt the metadata of a table created via `CREATE TABLE ... AS SELECT` and make `CHECK TABLE` fail. [#108057](https://github.com/ClickHouse/ClickHouse/pull/108057) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect results when using `hasToken` on text indexes with a tokenizer other than `splitByNonAlpha`. [#108066](https://github.com/ClickHouse/ClickHouse/pull/108066) ([Robert Schulze](https://github.com/rschu1ze)).
* Fixed a freeze of `SYSTEM RELOAD DICTIONARIES` (and `RELOAD DICTIONARY`) when many MySQL dictionaries defined in XML shared a single connection pool via `share_connection`. Such pools now honor `connection_pool_size` and `connection_wait_timeout` (default 5 seconds) from the configuration, matching dictionaries defined through named collections. [#108083](https://github.com/ClickHouse/ClickHouse/pull/108083) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow `EXISTS <dictionary>` for a user that has only the `SHOW DICTIONARIES` privilege on the dictionary (previously it required `SHOW TABLES`). [#108084](https://github.com/ClickHouse/ClickHouse/pull/108084) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `CREATE TABLE dst AS src SETTINGS ...` (and similar variants with `ORDER BY`/`PARTITION BY` but without an explicit `ENGINE`) silently dropping the source table's engine, storage clauses (such as table `TTL` and keys) and settings. The engine and the non-overridden storage clauses are now inherited from the source table, and the specified settings are merged on top of the source table's settings. [#108085](https://github.com/ClickHouse/ClickHouse/pull/108085) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `INSERT` into `MergeTree` tables failing with `filesystem error: in rename: Permission denied` on filesystems backed by Windows (WSL, CIFS/SMB, Docker Desktop bind mounts), caused by the part writer leaving file descriptors open across the part-directory rename. [#108089](https://github.com/ClickHouse/ClickHouse/pull/108089) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a crash (null pointer dereference) when querying a `Hive` table without a `WHERE` clause, e.g. `SELECT * FROM hive_table`. [#108094](https://github.com/ClickHouse/ClickHouse/pull/108094) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `LOGICAL_ERROR` ("Unexpected return type from if") when reading a column under `apply_mutations_on_fly = 1` after an `ALTER UPDATE col = ... WHERE <cond>` with a non-constant or false condition followed by `ALTER MODIFY COLUMN col <new type>`. [#108128](https://github.com/ClickHouse/ClickHouse/pull/108128) ([Groene AI](https://github.com/groeneai)).
* Fix `toStartOfInterval` and `dateTrunc` returning a rounded value instead of the start of the containing interval when the input has finer precision than the interval unit, e.g. `toStartOfInterval(toDateTime64('2023-10-09 10:11:12.000999', 6), INTERVAL 1 millisecond)` returned `10:11:12.001` instead of `10:11:12.000`. The overload with an explicit origin was affected too. Closes [#103535](https://github.com/ClickHouse/ClickHouse/issues/103535). [#108186](https://github.com/ClickHouse/ClickHouse/pull/108186) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Hide sensitive information in the `view_query` column of `system.query_views_log`. [#108214](https://github.com/ClickHouse/ClickHouse/pull/108214) ([Valerii Mordovskii](https://github.com/Fidelaggio)).
* Fixed a wedge on a `MergeTree` table attached with a legacy `hypothesis` skip index (a removed index type kept only for `ATTACH` compatibility). Previously a lightweight `DELETE`, `OPTIMIZE`, a plain `INSERT`, or a filtered `SELECT` on such a table failed with `ILLEGAL_INDEX` ("Index of type 'hypothesis' is no longer supported"), and the `DELETE` mutation retried forever. The dead index is now treated as inert: it is carried forward untouched during merge/mutation, skipped on insert and query planning, and can still be dropped with `ALTER TABLE ... DROP INDEX`. [#108217](https://github.com/ClickHouse/ClickHouse/pull/108217) ([Groene AI](https://github.com/groeneai)).
* Fix the setting `type_json_allow_duplicated_key_with_literal_and_nested_object` not working with typed paths in `JSON`. [#108218](https://github.com/ClickHouse/ClickHouse/pull/108218) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a `LOGICAL_ERROR` (`Different list of shards in child plans`) when running a query with `make_distributed_plan = 1` over a `MergeTree` table that has a normal/aggregate projection. [#108256](https://github.com/ClickHouse/ClickHouse/pull/108256) ([Groene AI](https://github.com/groeneai)).
* Fixed `replaceRegexpOne` and `replaceRegexpAll` so `.` matches newline characters by default, consistently with other regular expression functions. [#108265](https://github.com/ClickHouse/ClickHouse/pull/108265) ([linjiayu1025-collab](https://github.com/linjiayu1025-collab)).
* Fix a logical error when casting an `Array(Dynamic)` or `Array(Variant)` to `QBit` with `accurateCastOrNull`, e.g. `accurateCastOrNull(CAST(range(114), 'Array(Dynamic)'), 'QBit(Float32, 114)')`. [#108288](https://github.com/ClickHouse/ClickHouse/pull/108288) ([Groene AI](https://github.com/groeneai)).
* `index_granularity_bytes` is now honored for `AggregateFunction` state columns. Previously the granule byte cap was ignored for such columns (for example `uniqExact` states in `AggregatingMergeTree` tables and aggregating projections), producing granules far larger than the configured limit and increasing read amplification and query-time memory. [#108297](https://github.com/ClickHouse/ClickHouse/pull/108297) ([Groene AI](https://github.com/groeneai)).
* Fix lightweight `UPDATE`/`DELETE` conditions being evaluated twice, which could lead to incorrect behavior for non-deterministic conditions and extra work for deterministic ones. Closes [#86032](https://github.com/ClickHouse/ClickHouse/issues/86032). [#108323](https://github.com/ClickHouse/ClickHouse/pull/108323) ([ofeliacode](https://github.com/ofeliacode)).
* Fix an exception in a predefined HTTP handler when a header whose `headers_regexp` regular expression allows an empty value is absent from the request. [#108324](https://github.com/ClickHouse/ClickHouse/pull/108324) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix `arrayPartialSort` with a non-constant limit argument. [#108327](https://github.com/ClickHouse/ClickHouse/pull/108327) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fixed a cancelled or `KILL`ed `INSERT` continuing to run for a long time while building a skip index (for example an unbounded `set(0)` index on a high-cardinality column). The index build now stops promptly when the query is cancelled. [#108351](https://github.com/ClickHouse/ClickHouse/pull/108351) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed a `SELECT` from the `primes` table function not responding to cancellation: with a large `step` (or `limit`) the query could keep running for a long time after `KILL QUERY` or a timeout. It now stops promptly. [#108353](https://github.com/ClickHouse/ClickHouse/pull/108353) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed parsing of data-type names whose name contains the substring `INT` (for example a function-like name such as `quantileInterpolatedWeighted` used in a data-type position). Such names were mistaken for MySQL integer types and had their first `(...)` argument group silently consumed as a display-width modifier, which could break the query formatting round-trip. [#108354](https://github.com/ClickHouse/ClickHouse/pull/108354) ([Groene AI](https://github.com/groeneai)).
* Fixed an inconsistency where a malformed `ARRAY JOIN` followed by a comma and a parenthesized table list was misparsed as a cross join instead of being rejected. [#108365](https://github.com/ClickHouse/ClickHouse/pull/108365) ([Raúl Marín](https://github.com/Algunenano)).
* Hide secret arguments of functions such as `encrypt`, `decrypt`, and `HMAC` in `EXPLAIN actions`, `EXPLAIN header`, and `EXPLAIN PIPELINE` output when `format_display_secrets_in_show_and_select` is disabled (the default). [#108386](https://github.com/ClickHouse/ClickHouse/pull/108386) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `CREATE OR REPLACE` of a refreshable materialized view with a `TO` target: it was incorrectly rejected because the target table is already owned by the view being replaced. [#108392](https://github.com/ClickHouse/ClickHouse/pull/108392) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fixed a server crash (`Received signal 4`, illegal instruction) that could be triggered by a malformed or desynchronized native TCP protocol stream. The client-supplied initial address is now validated to be a numeric `host:port` before it is parsed, instead of letting a non-numeric port reach the trapped `getservbyname` libc function. [#108410](https://github.com/ClickHouse/ClickHouse/pull/108410) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash during shutdown when shutting down a database throws an exception (for example when a table's flush hits a ZooKeeper timeout). The rest of the shutdown sequence is no longer skipped, so system logs are flushed and their threads are joined before the server exits. [#108417](https://github.com/ClickHouse/ClickHouse/pull/108417) ([Groene AI](https://github.com/groeneai)).
* Fixed regular expression functions (`match`, `extract`, `extractAll`, `replaceRegexpOne`, `replaceRegexpAll`, etc.) silently returning wrong results when the pattern contained a NUL (`\0`) byte. The NUL is now treated as an ordinary literal byte, consistent with RE2. [#108427](https://github.com/ClickHouse/ClickHouse/pull/108427) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `clickhouse-local` returning an empty reply to HTTP `OPTIONS` requests when no `http_options_response` is configured, which made the web UI (`/play`) show the connection as broken even though queries worked. [#108428](https://github.com/ClickHouse/ClickHouse/pull/108428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `LOGICAL_ERROR` ("Invalid action query tree node ...") exception when a distributed query both deduplicated structurally-identical duplicate-`ALIAS` columns and referenced a table function with a `key = value` named-collection argument (for example `oss(s3_conn, filename = '...')`). [#108435](https://github.com/ClickHouse/ClickHouse/pull/108435) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash (`LOGICAL_ERROR: 'Unexpected exception in refresh scheduling'`) that could happen on startup when a coordinated refreshable materialized view in a `Replicated` database was attached on a Keeper that does not support the `MULTI_READ` feature flag (for example after a Keeper downgrade). The view is now stopped gracefully instead of aborting the server. [#108441](https://github.com/ClickHouse/ClickHouse/pull/108441) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error (e.g. `Column _part not found`) when selecting virtual columns from a `MergeTree` table under parallel replicas, including via `SELECT *` with `asterisk_include_virtual_columns = 1`. [#108451](https://github.com/ClickHouse/ClickHouse/pull/108451) ([Groene AI](https://github.com/groeneai)).
* `SYSTEM RESET DDL WORKER` now requires the new `SYSTEM RESET DDL WORKER` privilege. Previously any authenticated user (including `readonly` ones) could run it and repeatedly reset the DDL worker state, blocking `ON CLUSTER` DDL. [#108460](https://github.com/ClickHouse/ClickHouse/pull/108460) ([Groene AI](https://github.com/groeneai)).
* Restrict the model path of `catboostEvaluate` to the `user_files` directory, like the `file` table function and the dictionary sources. Previously the function accepted an arbitrary filesystem path with no containment check, which allowed probing the existence of and triggering reads of files outside `user_files`. Models must now be located inside `user_files`. [#108463](https://github.com/ClickHouse/ClickHouse/pull/108463) ([Groene AI](https://github.com/groeneai)).
* The `hasColumnInTable` function now requires the `SHOW COLUMNS` privilege on the target table, the same grant required by `DESCRIBE` and `SHOW CREATE TABLE`. Previously any user could call `hasColumnInTable` to probe column names and test table and database existence without any access check. [#108464](https://github.com/ClickHouse/ClickHouse/pull/108464) ([Groene AI](https://github.com/groeneai)).
* Fixed excessive memory allocation when deserializing crafted aggregate function states for `mannWhitneyUTest`, `rankCorr`, `largestTriangleThreeBuckets`, `quantileGK`, `sequenceMatch`/`sequenceCount` and `groupArrayIntersect`. A malformed state could declare a huge element count and make the server try to allocate tens of gigabytes from a few bytes of input; such states are now rejected with `TOO_LARGE_ARRAY_SIZE`. [#108465](https://github.com/ClickHouse/ClickHouse/pull/108465) ([Groene AI](https://github.com/groeneai)).
* Validate the redirect target of an S3 `301 Moved Permanently` response against `remote_url_allow_hosts` (`RemoteHostFilter`). Previously the AWS SDK 301 handling followed the attacker-supplied endpoint from the response (`Location` header or `<Endpoint>` element) without the host check, so a malicious or compromised S3-compatible server could redirect ClickHouse to an arbitrary host (SSRF). The 307 redirect path already performed this check; both paths are now consistent. [#108466](https://github.com/ClickHouse/ClickHouse/pull/108466) ([Groene AI](https://github.com/groeneai)).
* Fixed a credential leak where the legacy `storage_aws_access_key_id`, `storage_aws_secret_access_key`, `storage_catalog_credential`, and `storage_auth_header` settings of the `DataLakeCatalog` database engine were shown in plaintext in `system.databases.engine_full` and `SHOW CREATE DATABASE`. They are now redacted as `[HIDDEN]`. [#108470](https://github.com/ClickHouse/ClickHouse/pull/108470) ([Groene AI](https://github.com/groeneai)).
* Fixed `ssl_certificate` user identification so a single `*` wildcard matches exactly one name component (RFC 6125 6.4.3). Previously a wildcard in a `CN` or `DNS:` SAN subject (for example `*.corp.example.com`) also matched multi-label names such as `evil.deep.corp.example.com`, letting a holder of a certificate for a deeper subdomain authenticate as the wildcard user. `URI:` SAN matching is unchanged. [#108472](https://github.com/ClickHouse/ClickHouse/pull/108472) ([Groene AI](https://github.com/groeneai)).
* Fixed SQL injection in the MySQL wire protocol: the `SHOW TABLE STATUS LIKE` argument and the `SET <mysql_setting>` value sent over the MySQL interface (port 9004) are now parsed and re-quoted instead of being concatenated verbatim into the rewritten query. Also fixed `KILL QUERY <id>` over the MySQL interface silently ignoring multi-digit connection ids. [#108474](https://github.com/ClickHouse/ClickHouse/pull/108474) ([Groene AI](https://github.com/groeneai)).
* Sensitive values passed as HTTP query-string parameters (for example the `param_*` query-parameter binding such as `param_secret_key`/`param_aws_secret_access_key`, the `password` parameter, or S3-style `signature` parameters) are no longer written verbatim to `system.text_log` or OpenTelemetry spans. The `Request URI` log line now redacts the values of parameters whose names look sensitive, replacing them with `[HIDDEN]`. [#108475](https://github.com/ClickHouse/ClickHouse/pull/108475) ([Groene AI](https://github.com/groeneai)).
* Enforce the `http_forbid_headers` configuration during schema inference for the `url` table function and `URL` storage engine. Previously a forbidden header was still sent over the network while inferring the schema (for example with the `Regexp` format or `DESCRIBE`), and its response body could be reflected back in a parse error, leaking secrets. The header filter is now checked before any network access on the inference path, matching the existing behavior of `urlCluster`. [#108476](https://github.com/ClickHouse/ClickHouse/pull/108476) ([Groene AI](https://github.com/groeneai)).
* Fixed wrong results when using `SELECT ... SAMPLE ...` together with the query condition cache (setting `use_query_condition_cache`, enabled by default). [#108488](https://github.com/ClickHouse/ClickHouse/pull/108488) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash (stack overflow) caused by deeply nested expressions such as `[[[ ... ]]]` or `array(array( ... ))` when `max_parser_depth` is set to a large value. [#108493](https://github.com/ClickHouse/ClickHouse/pull/108493) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed the `RabbitMQ` table engine hanging indefinitely on `DROP TABLE` or server shutdown when the broker closes the AMQP connection due to missed heartbeats without sending a TCP RST. All blocking event loop calls now have a 30-second timeout so shutdown always completes. [#108497](https://github.com/ClickHouse/ClickHouse/pull/108497) ([Aly Ayman](https://github.com/alyelmorsy-dataengineer)).
* Secondary queries executed as part of internal queries will now be logged as internal queries. [#108506](https://github.com/ClickHouse/ClickHouse/pull/108506) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* The `ArrowFlight` table engine and the `arrowFlight` table function now honor the `<remote_url_allow_hosts>` allow-list. Previously, the connection host and port were not validated, so a query could reach hosts not present in the allow-list. [#108507](https://github.com/ClickHouse/ClickHouse/pull/108507) ([Groene AI](https://github.com/groeneai)).
* The MySQL wire protocol commands `COM_FIELD_LIST` (`mysql_list_fields`) and `COM_INIT_DB` (`USE database`) now enforce the same access control as their SQL equivalents (`SHOW COLUMNS`/`DESCRIBE` and `USE`). Previously, they could disclose column names of tables the user only had partial column grants on, and switch the current database without the `SHOW DATABASES` privilege. [#108508](https://github.com/ClickHouse/ClickHouse/pull/108508) ([Groene AI](https://github.com/groeneai)).
* Match `http_forbid_headers` case-insensitively. HTTP header names are case-insensitive, so forbidding `Authorization` now also blocks `authorization`, `AUTHORIZATION`, and other case variants. Configured `header_regexp` patterns are now matched case-insensitively without needing an explicit `(?i)` flag. [#108509](https://github.com/ClickHouse/ClickHouse/pull/108509) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash (segmentation fault) that could occur when a distributed query referenced a not-yet-materialized `MATERIALIZED` CTE as an external table and the remote source was created lazily. [#108547](https://github.com/ClickHouse/ClickHouse/pull/108547) ([Groene AI](https://github.com/groeneai)).
* Fixed wrong results when the query condition cache (`use_query_condition_cache = 1`) reused a skip-index-derived mark exclusion for a query that ran a different set of skip indexes, for example with `use_skip_indexes = 0`, `ignore_data_skipping_indices`, or a different `use_skip_indexes_for_disjunctions` mode. Skip-index-derived cache entries are now keyed by the effective set of skip indexes that ran. [#108548](https://github.com/ClickHouse/ClickHouse/pull/108548) ([Groene AI](https://github.com/groeneai)).
* Fixed several bugs in `changeYear`, `changeMonth`, `changeDay`, `changeHour`, `changeMinute` and `changeSecond` with `DateTime64` arguments: the result column was created with the hardcoded default scale 3 instead of the argument's scale, which led to a `LOGICAL_ERROR` (`writeSlice expects same column types`) when the result was passed to `arrayPushBack`/`arrayPushFront`/`arrayConcat`; nanosecond-precision (scale 9) inputs threw `DECIMAL_OVERFLOW`; and pre-epoch sub-second inputs returned the wrong calendar second. Also fixed `timeSlots` over `DateTime64` ignoring the scale of the optional `Size` argument in its declared return type and returning wrong timestamps for the largest scale in `Size`. [#108551](https://github.com/ClickHouse/ClickHouse/pull/108551) ([Groene AI](https://github.com/groeneai)). [#108681](https://github.com/ClickHouse/ClickHouse/pull/108681) ([Takumi Hara](https://github.com/takumihara)). [#108994](https://github.com/ClickHouse/ClickHouse/pull/108994) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error when a compound predicate is aliased in `GROUP BY` and referenced again, with `enable_identifier_resolve_cache` enabled (the default). [#108553](https://github.com/ClickHouse/ClickHouse/pull/108553) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error (`Equal values are not contiguous within the range assumed to be sorted`) when running `DISTINCT` over a `STREAM` read (`SELECT DISTINCT ... FROM table STREAM`). Read-in-order optimizations are no longer applied to `STREAM` reads, which produce rows in commit order rather than sorting-key order. [#108568](https://github.com/ClickHouse/ClickHouse/pull/108568) ([Groene AI](https://github.com/groeneai)).
* Fixed projections returning a column's type default (e.g. `0`) instead of its declared `DEFAULT` value (e.g. `-1`) in two cases: when reading a column that was added with `ALTER TABLE ... ADD COLUMN ... DEFAULT` after the projection was created (reads from the base table were already correct), and after the column's `TTL` expired on a wide part. [#108569](https://github.com/ClickHouse/ClickHouse/pull/108569) ([Shaohua Wang](https://github.com/tiandiwonder)). [#109013](https://github.com/ClickHouse/ClickHouse/pull/109013) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed a `ReadBuffer is canceled. Can't read from it.` error that could occur when an upload to S3 (for example a backup) is retried after a transient read error. [#108573](https://github.com/ClickHouse/ClickHouse/pull/108573) ([Groene AI](https://github.com/groeneai)).
* Fix `ATTACH PARTITION ... FROM` rejecting tables whose primary keys are equivalent but declared differently (one explicit `PRIMARY KEY`, the other implicit from `ORDER BY`). [#108590](https://github.com/ClickHouse/ClickHouse/pull/108590) ([Jordi Orihuela](https://github.com/jordiori)).
* Fixed direct read from the text index failing when multiple text indexes are partially materialized. Fixes [#108530](https://github.com/ClickHouse/ClickHouse/issues/108530). [#108607](https://github.com/ClickHouse/ClickHouse/pull/108607) ([Anton Popov](https://github.com/CurtizJ)).
* Fix a metadata disclosure where `DESCRIBE loop('db', 'table')` and `DESCRIBE loop(<inner table function>)` bypassed the `SHOW COLUMNS` / source access check, letting an unprivileged user read a table's column schema. [#108624](https://github.com/ClickHouse/ClickHouse/pull/108624) ([Groene AI](https://github.com/groeneai)).
* Fixed the `_etag` virtual column for the `S3Queue` and `AzureQueue` table engines: it was declared but never populated, so `SELECT _etag` always returned an empty string. It now returns the object ETag, like the `S3` engine and the `s3` table function. [#108625](https://github.com/ClickHouse/ClickHouse/pull/108625) ([Groene AI](https://github.com/groeneai)).
* Fixed reading `Arrow`, `ArrowStream` and Arrow-based `ORC` files whose timestamp column carries a fixed numeric UTC offset (e.g. `+05:30`, `-08:00`, `00:00`) or the non-IANA marker `fixed` as its timezone, which previously failed with `Cannot load time zone ...` (`BAD_ARGUMENTS`). [#108633](https://github.com/ClickHouse/ClickHouse/pull/108633) ([Groene AI](https://github.com/groeneai)).
* Fixed an exception (`LOGICAL_ERROR: Join is supported only for pipelines with one output port` or `NOT_IMPLEMENTED: MergeJoinAlgorithm is not implemented for strictness Semi`) when `join_algorithm = 'full_sorting_merge'` was used for a `SEMI`/`ANTI` join, including the joins produced by decorrelating an `EXISTS` correlated subquery. `full_sorting_merge` now declines strictness/kind combinations it cannot execute, so the planner falls back to another enabled algorithm or reports that the join cannot be executed. [#108658](https://github.com/ClickHouse/ClickHouse/pull/108658) ([Groene AI](https://github.com/groeneai)).
* Fixed a heap buffer overflow when building a text index with `positions = 1` over many distinct short tokens. [#108659](https://github.com/ClickHouse/ClickHouse/pull/108659) ([Groene AI](https://github.com/groeneai)).
* A query reading from or writing to S3 that is cancelled (e.g. by `KILL QUERY`) while an S3 request is in flight is now reported as cancelled instead of with a misleading network/S3 error. In particular, a cancelled backup or restore to S3 now reports `BACKUP_CANCELLED`/`RESTORE_CANCELLED` in `system.backups`. [#108673](https://github.com/ClickHouse/ClickHouse/pull/108673) ([Julia Kartseva](https://github.com/jkartseva)).
* Fixed a startup failure where a `DataLakeCatalog` database created by an older version (25.12 or earlier) with a malformed `auth_header` could not be attached after upgrading to 26.2 or later, preventing the server from starting. The `auth_header` is now validated only on `CREATE`, and on `ATTACH` the catalog is built lazily on first use instead of during startup, so a single misconfigured or unreachable catalog database no longer blocks server startup. [#108674](https://github.com/ClickHouse/ClickHouse/pull/108674) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error (`Sort order of blocks violated`) during a merge, and incorrect reads, when a non-nullable `LowCardinality` element of a `Nullable(Tuple(...))` column is used as a subcolumn (for example as a sort key). [#108679](https://github.com/ClickHouse/ClickHouse/pull/108679) ([Groene AI](https://github.com/groeneai)).
* Fix a possible crash (use-after-free) when `SYSTEM FLUSH DISTRIBUTED` runs concurrently with `DROP TABLE` of the same `Distributed` table. [#108684](https://github.com/ClickHouse/ClickHouse/pull/108684) ([Groene AI](https://github.com/groeneai)).
* Fix a crash in Base64 decoding of the Azure account key, reachable via `azureBlobStorage` (and related Azure table functions and storages) when the key is not valid Base64: a byte `>= 0x80` caused an out-of-bounds read, and any invalid byte caused undefined behaviour. Invalid keys are now rejected cleanly. [#108716](https://github.com/ClickHouse/ClickHouse/pull/108716) ([Groene AI](https://github.com/groeneai)).
* Fix `NUMBER_OF_COLUMNS_DOESNT_MATCH` error when a subquery on a `Distributed` table reads two or more `ALIAS` columns that expand to the same expression (for example `a1 String ALIAS toString(x), a2 String ALIAS toString(x)`) and the subquery feeds an outer query, e.g. `SELECT count() FROM (SELECT a1, a2 FROM dist GROUP BY a1, a2)`. [#108725](https://github.com/ClickHouse/ClickHouse/pull/108725) ([Groene AI](https://github.com/groeneai)).
* Fixed `CREATE OR REPLACE MATERIALIZED VIEW ... POPULATE` leaving the new view unsubscribed from its source table, which silently dropped every row inserted after the replace. [#108728](https://github.com/ClickHouse/ClickHouse/pull/108728) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix an exception (`Cannot find sharding key column`, and in debug and sanitizer builds a server abort) when a `Distributed` table's sharding key is an expression the analyzer const-folds, for example `if(1, toInt32(id), toInt32(id) + 1)`, with `optimize_skip_unused_shards = 1`. [#108737](https://github.com/ClickHouse/ClickHouse/pull/108737) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error (`Bad cast from type DB::ColumnNullable to DB::ColumnString`) and possible wrong results when using `group_by_use_nulls` with a `LowCardinality` constant grouping key in `GROUPING SETS`/`ROLLUP`/`CUBE`. [#108771](https://github.com/ClickHouse/ClickHouse/pull/108771) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed partition and primary key pruning being silently disabled when a `LowCardinality(FixedString)` (or `LowCardinality(Nullable(FixedString))`) key column is wrapped in a function in the key, for example `PARTITION BY sipHash64(k) % N` with `WHERE k = 'literal'`. Such queries scanned all partitions instead of pruning them. [#108777](https://github.com/ClickHouse/ClickHouse/pull/108777) ([Groene AI](https://github.com/groeneai)).
* Fixed a logical error (a server abort in debug and sanitizer builds) when an `INSERT ... SELECT` through an `Alias` table, or into a `TimeSeries` table, is cancelled without an exception, for example with `timeout_overflow_mode = 'break'`. [#108783](https://github.com/ClickHouse/ClickHouse/pull/108783) ([Groene AI](https://github.com/groeneai)). [#108796](https://github.com/ClickHouse/ClickHouse/pull/108796) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix a `Bad cast from type DB::ColumnSparse to DB::ColumnString` logical error (a server abort in debug and sanitizer builds) when `groupConcat` is applied to a `Tuple` whose `String` element is stored sparse. [#108790](https://github.com/ClickHouse/ClickHouse/pull/108790) ([Groene AI](https://github.com/groeneai)).
* Fix `TYPE_MISMATCH` in `mapFilter`, `mapSort`, `mapReverseSort`, `mapPartialSort` and `mapConcat` when a `Map` value contains a nested `Map` with `LowCardinality`, e.g. `mapFilter((k, v) -> 1, map('a'::LowCardinality(String), map('x'::LowCardinality(String), 'y')))`. [#108798](https://github.com/ClickHouse/ClickHouse/pull/108798) ([Groene AI](https://github.com/groeneai)).
* Fixed `insert_quorum = 'auto'` not rejecting inserts up front when fewer than a majority of replicas were alive. Such inserts now fail immediately with `TOO_FEW_LIVE_REPLICAS` instead of writing a local part and later timing out with `UNKNOWN_STATUS_OF_INSERT`. [#108800](https://github.com/ClickHouse/ClickHouse/pull/108800) ([Gagan Dhakrey](https://github.com/gagandhakrey)).
* Fixed a bug where the `WITH TOTALS` row of a `JOIN` could contain default values (such as `0`) instead of the constant values coming from a constant subquery on one side of the join. The wrong result appeared only for some join orderings or with the `query_plan_join_swap_table` setting. [#108807](https://github.com/ClickHouse/ClickHouse/pull/108807) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a segmentation fault (null-pointer dereference) that could occur when server shutdown ran concurrently with the shutdown of an `S3Queue`/`AzureQueue` table. [#108810](https://github.com/ClickHouse/ClickHouse/pull/108810) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed a startup abort (`Cannot allocate ThreadStack`, `EINVAL`) on glibc builds running on CPUs with a large signal-stack size (for example Intel Sapphire Rapids / Granite Rapids with an AMX-aware kernel), where the signal alt-stack size was not rounded up to a multiple of the page size. [#108813](https://github.com/ClickHouse/ClickHouse/pull/108813) ([Groene AI](https://github.com/groeneai)).
* Fix distributed queries occasionally failing with `UNEXPECTED_PACKET_FROM_SERVER` (`expected TablesStatusResponse, got ProfileInfo`) when a connection that a previous cancelled query left out of sync was reused from the pool. [#108854](https://github.com/ClickHouse/ClickHouse/pull/108854) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a logical error (an exception in release builds, a server abort in debug and sanitizer builds) that could happen for a function call with more than one `LowCardinality` argument over a distributed table, for example `concatAssumeInjective((SELECT toLowCardinality('p')), s)` used as a `GROUP BY` key with the `remote` table function. The messages were `Default functions implementation for LowCardinality is supported only with a single LowCardinality argument` or `Expected the argument ... to have N rows, but it has M`. [#108871](https://github.com/ClickHouse/ClickHouse/pull/108871) ([Groene AI](https://github.com/groeneai)).
* Fix `reinterpret(x, 'Decimal128(scale)')` (and `Decimal32`/`Decimal64`/`Decimal256`/`DateTime64` targets) producing a result column whose internal scale was the source scale instead of the requested target scale when the source and target had the same physical type. The values were correct, but the column object was structurally inconsistent with its declared type. [#108878](https://github.com/ClickHouse/ClickHouse/pull/108878) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` (`New empty part is about to materialize but the directory already exist`) that could abort the server in debug and sanitizer builds when a `DROP`/`DETACH`/`MOVE`/`REPLACE PARTITION` on a `MergeTree` table ran after a previous such operation was interrupted (for example a rolled-back transaction or a crash) and left a stale `tmp_empty_<part>` directory behind. The stale directory is now reclaimed instead of failing. [#108879](https://github.com/ClickHouse/ClickHouse/pull/108879) ([Groene AI](https://github.com/groeneai)).
* Fixed ClickHouse Keeper returning incorrect `dataLength = 0` in the `Stat` of `Create2` responses, and the ClickHouse ZooKeeper client not deserializing the `Stat` of `Create2` responses. [#108909](https://github.com/ClickHouse/ClickHouse/pull/108909) ([unintended](https://github.com/unintended)).
* Fixed `clickhouse-local` rejecting an empty option value written adjacent to `=` (for example `--format_csv_null_representation=''`); it now behaves the same as `--format_csv_null_representation ""` and `SET format_csv_null_representation = ''`. [#108910](https://github.com/ClickHouse/ClickHouse/pull/108910) ([Vismay](https://github.com/vismaytiwari)).
* Fixed a `LOGICAL_ERROR` (`Inconsistent AST formatting`) that aborted the server in debug and sanitizer builds when formatting a `Tuple` data type that mixes named and unnamed elements (for example `Tuple(a UInt8, UInt16)`). [#108915](https://github.com/ClickHouse/ClickHouse/pull/108915) ([Groene AI](https://github.com/groeneai)).
* Fix a segmentation fault when merging `uniqExact` aggregate states with `GROUPING SETS`, `ROLLUP` or `CUBE` and `max_threads > 1`. [#108928](https://github.com/ClickHouse/ClickHouse/pull/108928) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed possible wrong results or out-of-bounds reads when an `INSERT` is rolled back after a mid-batch error (for example in `Buffer` tables, asynchronous inserts, or the `Kafka`/`RabbitMQ`/`FileLog` engines) while lazy column replication (`enable_lazy_columns_replication`) is in effect. [#108935](https://github.com/ClickHouse/ClickHouse/pull/108935) ([Groene AI](https://github.com/groeneai)).
* `join_any_take_last_row` is now respected by all supported hash-based join paths, including joins that use automatic spilling to disk. [#108936](https://github.com/ClickHouse/ClickHouse/pull/108936) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fixed a bug in the analyzer where `FINAL` on one table of a `JOIN` (e.g. `FROM t1 FINAL JOIN t2`) was incorrectly applied to the other joined tables as well, which could make such queries slower. [#108979](https://github.com/ClickHouse/ClickHouse/pull/108979) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix a `LOGICAL_ERROR` ("Cannot find `__grouping_set` column in header of MergingAggregatedTransform with grouping sets", or "Chunk info was not set for chunk in MergingAggregatedTransform") that could occur, with the analyzer disabled, for a `UNION ALL`/`INTERSECT`/`EXCEPT` where one branch uses `GROUP BY GROUPING SETS` with parallel replicas and another branch uses `FINAL`. [#109003](https://github.com/ClickHouse/ClickHouse/pull/109003) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` in the automatic parallel replicas planner that could occur when `automatic_parallel_replicas_mode` is enabled together with `parallel_replicas_min_number_of_rows_per_replica` greater than 0. [#109011](https://github.com/ClickHouse/ClickHouse/pull/109011) ([Groene AI](https://github.com/groeneai)).
* Fixed an excessive memory allocation during schema inference of the `MsgPack` format: a corrupted input whose array/map/string/binary header declares a huge element count no longer drives a single multi-gigabyte allocation and is rejected as malformed input. This fixes an out-of-memory condition in release builds (and an `allocation-size-too-big` abort under sanitizers). [#109019](https://github.com/ClickHouse/ClickHouse/pull/109019) ([Groene AI](https://github.com/groeneai)).
* Fixed `use_client_time_zone` being ignored for `DateTime`/`DateTime64` string literals interpreted on the server (asynchronous `INSERT`, `SELECT` literals). The client now propagates its local time zone as `session_timezone` when `use_client_time_zone` is enabled, so server-side parsing matches the synchronous `INSERT` path. [#109051](https://github.com/ClickHouse/ClickHouse/pull/109051) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error when `query_plan_optimize_lazy_final` is enabled together with a `WHERE` filter partially pushed to `PREWHERE` (via `optimize_move_to_prewhere_if_final`). [#109073](https://github.com/ClickHouse/ClickHouse/pull/109073) ([Groene AI](https://github.com/groeneai)).
* Fixed an error when using a qualified asterisk like `b.*` in a query where `b` is a table (or subquery/CTE) alias that shares its name with a non-compound column of another table. Such queries no longer fail and correctly select all columns of `b`. [#109078](https://github.com/ClickHouse/ClickHouse/pull/109078) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix a `Block structure mismatch in JoinStep` logical error (a server abort in debug and sanitizer builds) when a correlated subquery is decorrelated into a join and the source relation carries a column name more than once, e.g. `WITH t AS (SELECT number, * FROM numbers(3)) SELECT *, (SELECT t.number WHERE t.number >= 0) FROM t` with `correlated_subqueries_default_join_kind = 'right'`. [#109114](https://github.com/ClickHouse/ClickHouse/pull/109114) ([Groene AI](https://github.com/groeneai)).
* Fixed a hang where a query reading through the filesystem cache could keep waiting on an in-progress download after being cancelled with `KILL QUERY`, and where dropping or `SYSTEM STOP VIEW`-ing a refreshable materialized view whose refresh was stuck in such a wait would block. [#109116](https://github.com/ClickHouse/ClickHouse/pull/109116) ([Murphy](https://github.com/murphy-4o)).
* Fixed the `parallel_view_processing` setting being ignored when inserting into a table with materialized views — since 25.10, views always ran in parallel regardless of the setting. [#109170](https://github.com/ClickHouse/ClickHouse/pull/109170) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed a parser inconsistency where an `INSERT` column list accepted a qualified column matcher written as `t.* LIKE '<pattern>'` / `t.* ILIKE '<pattern>'` but rejected its canonical `t.COLUMNS('<regexp>')` form, breaking the query format round-trip (and aborting the server in debug and sanitizer builds). [#109176](https://github.com/ClickHouse/ClickHouse/pull/109176) ([Groene AI](https://github.com/groeneai)).
* Fixed non-monotonic `ProfileEvents` increments: the `NetworkReceiveBytes` and `AIOWriteBytes` counters could be incremented by a negative amount (wrapping around to a huge value) on a socket timeout or an AIO failure, and `MemoryOvercommitWaitTimeMicroseconds` was measured with a non-monotonic clock. [#109180](https://github.com/ClickHouse/ClickHouse/pull/109180) ([Azat Khuzhin](https://github.com/azat)).
* Fix schema inference for the `Arrow`, `ArrowStream`, `Avro` formats and the legacy `ORC` and `Parquet` readers returning `Nullable(Tuple)` for nullable struct columns while the `Nullable(Tuple)` type is not allowed (`allow_experimental_nullable_tuple_type` is disabled). `DESCRIBE` returned a type that `CREATE TABLE` rejects, so creating a table or inserting data using the inferred schema failed with the error `Nullable Tuple type is not allowed`. [#109185](https://github.com/ClickHouse/ClickHouse/pull/109185) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed a wrong result of correlated `EXISTS` and scalar subqueries when the correlation appears only in the subquery projection together with a non-correlated `WHERE` clause (the subquery could evaluate to false / `NULL` for every row). Fixes [#105760](https://github.com/ClickHouse/ClickHouse/issues/105760). [#109186](https://github.com/ClickHouse/ClickHouse/pull/109186) ([Dmitry Novik](https://github.com/novikd)).
* Fixed `CREATE USER ... HOST LIKE 'a', 'b'` (and the equivalent `ALTER USER`) silently keeping only the first pattern. All specified `HOST LIKE` patterns are now stored in the user's host allow-list. [#109187](https://github.com/ClickHouse/ClickHouse/pull/109187) ([Groene AI](https://github.com/groeneai)).
* Fixed a text index defined on `mapValues(map)` or `mapKeys(map)` being silently not used when a table was queried through a `Distributed` engine table with the analyzer. The index was used for the local table and via the `cluster`/`remote` table functions, but a query through a `Distributed` engine table skipped it (and failed with `INDEX_NOT_USED` under `force_data_skipping_indices`). [#109188](https://github.com/ClickHouse/ClickHouse/pull/109188) ([Groene AI](https://github.com/groeneai)).
* Fixed a false `LOGICAL_ERROR` (`There was an error on <host>: Cannot obtain error message (probably it's a bug)`) that could abort the server in debug and sanitizer builds when running a DDL query on a `Replicated` database and its per-host `finished` status node in Keeper had already been cleaned up. [#109192](https://github.com/ClickHouse/ClickHouse/pull/109192) ([Groene AI](https://github.com/groeneai)).
* Fix `SAMPLE` ratios with an exponent whose magnitude overflows `Int32` (e.g. `SAMPLE 1e-3000000000`) being silently treated as `SAMPLE 1`. [#109197](https://github.com/ClickHouse/ClickHouse/pull/109197) ([Raúl Marín](https://github.com/Algunenano)).
* Fix the access check for `SYSTEM PREWARM PRIMARY INDEX CACHE ... ON CLUSTER`, which incorrectly required the `SYSTEM PREWARM MARK CACHE` privilege instead of `SYSTEM PREWARM PRIMARY INDEX CACHE`. [#109198](https://github.com/ClickHouse/ClickHouse/pull/109198) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed `ALTER` queries failing for `MergeTree` tables created with a custom `disk` setting (`SETTINGS disk = disk(...)`). Fixes [#63019](https://github.com/ClickHouse/ClickHouse/issues/63019). [#109199](https://github.com/ClickHouse/ClickHouse/pull/109199) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fixed a server crash when states of the aggregate functions `cramersV`, `cramersVBiasCorrected`, `contingency` or `theilsU` from a window context (`OVER ()`) and from a plain aggregation are combined through chained set operations (`EXCEPT`, `INTERSECT`) or nested `UNION ALL` and then read, for example via the `-Merge` combinator. [#109200](https://github.com/ClickHouse/ClickHouse/pull/109200) ([Groene AI](https://github.com/groeneai)).
* Fix a wrong result for `ANY JOIN` with a constant `ON` condition (e.g. `t1 ANY INNER JOIN t2 ON 1`): the query returned the full Cartesian product instead of the `ANY` join result. [#109207](https://github.com/ClickHouse/ClickHouse/pull/109207) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a server crash on asynchronous insert with deduplication when `optimize_on_insert` makes the inserted block empty (for example, rows summing to zero in `SummingMergeTree`). [#109229](https://github.com/ClickHouse/ClickHouse/pull/109229) ([Den Kalantaevskii](https://github.com/Diskein)).
* Fix `SYSTEM DROP REPLICA` and `SYSTEM DROP DATABASE REPLICA ... FROM ZKPATH` to reject empty or root-only ZooKeeper paths at parse time with `BAD_ARGUMENTS`, route auxiliary Keeper paths to the named Keeper, and canonicalize Keeper paths so the local self-protection checks cannot mis-target or bypass the intended replica. [#109230](https://github.com/ClickHouse/ClickHouse/pull/109230) ([Groene AI](https://github.com/groeneai)).
* Fix S3 settings priority so a URL-scoped `<s3>` endpoint block takes precedence over the top-level `<s3>` defaults. [#109251](https://github.com/ClickHouse/ClickHouse/pull/109251) ([Bharat Nallan](https://github.com/bharatnc)).
* Fixed a bug where column `DEFAULT` values were not applied for `INSERT INTO TABLE FUNCTION` (for example `remote` or `file`) with inline `VALUES` data when the server parses the inline data itself (`send_table_structure_on_insert_with_inline_data = 0`). An explicit `NULL` inserted into a non-`Nullable` column with a `DEFAULT` became `0` instead of the declared default. It now behaves like a plain table `INSERT` and the HTTP protocol. [#109258](https://github.com/ClickHouse/ClickHouse/pull/109258) ([Groene AI](https://github.com/groeneai)).
* Fix `CREATE TABLE ... AS SELECT` from `s3Cluster` (and other cluster table functions such as `fileCluster`/`urlCluster`) failing with `NOT_FOUND_COLUMN_IN_BLOCK` inside a `Replicated` database. [#109266](https://github.com/ClickHouse/ClickHouse/pull/109266) ([Groene AI](https://github.com/groeneai)).
* Fixed `SHOW TABLES` and `SELECT ... FROM system.tables` returning different results for data lake catalog databases: tables that ClickHouse cannot read are now consistently hidden from both. [#109273](https://github.com/ClickHouse/ClickHouse/pull/109273) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fixed a bug where merging a `MergeTree` table that has projections while the `enable_block_number_column` or `enable_block_offset_column` setting is enabled produced projection parts containing a spurious `_block_number`/`_block_offset` column. The merged projection part then no longer matched the projection definition and the insert-produced projection parts, so `CHECK TABLE` and `OPTIMIZE ... DRY RUN` reported it as corrupted (`CORRUPTED_DATA`). [#109284](https://github.com/ClickHouse/ClickHouse/pull/109284) ([Groene AI](https://github.com/groeneai)).
* Allow reading an Avro `array` of two-field `{key, value}` records into a ClickHouse `Map` column. This is the encoding Iceberg and Spark produce for a `MAP<K, V>` with a non-string key (Avro native maps only support string keys). Previously such a file could be read as `Array(Tuple(key, value))` but not as `Map(K, V)`, which failed with `Type Map(...) is not compatible with Avro array`. [#109289](https://github.com/ClickHouse/ClickHouse/pull/109289) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash on `CREATE HYPOTHETICAL INDEX ... TYPE set` (and `ngrambf_v1`/`tokenbf_v1`) when the required index argument is omitted. Such statements are now rejected with a clear error. [#109294](https://github.com/ClickHouse/ClickHouse/pull/109294) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` (`Current component is empty`) that could be raised by mutation operations such as `KILL MUTATION` on a `MergeTree` table that stores its metadata in Keeper, when the `enforce_keeper_component_tracking` server setting is enabled. [#109297](https://github.com/ClickHouse/ClickHouse/pull/109297) ([Groene AI](https://github.com/groeneai)).
* Fixed reading `ORC` timestamps beyond \~year 2262 into a `DateTime64` column with a scale coarser than 9. The native `ORC` reader used to convert every timestamp through a fixed `DateTime64(9)` intermediate, which overflows `Int64` at nanosecond scale and rejected such values with `VALUE_IS_OUT_OF_RANGE_OF_DATA_TYPE`, even when the requested `DateTime64` scale (for example `DateTime64(6)`, as produced by Iceberg) can represent the value. Timestamps are now read directly at the requested scale, and `date_time_overflow_behavior` is honored when even the target scale cannot hold the value. [#109302](https://github.com/ClickHouse/ClickHouse/pull/109302) ([Groene AI](https://github.com/groeneai)).
* `clickhouse-local` acting as a server (after `SYSTEM START LISTEN HTTP`) now serves HTTP connections using the `TabSeparated` default output format, matching `clickhouse-server`, instead of the interactive `PrettyCompact` default. This fixes connecting to `clickhouse-local` over HTTP with drivers such as `clickhouse-connect`. The interactive terminal session still renders results as `PrettyCompact`. [#109362](https://github.com/ClickHouse/ClickHouse/pull/109362) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a transient `Code: 499 ... InvalidPart` (`S3_ERROR`) failure on S3 multipart uploads. MinIO can briefly report a just-uploaded part as missing on `CompleteMultipartUpload`; this error is now retried like the already-handled `NoSuchKey`, bounded by `s3_max_unexpected_write_error_retries`. [#109364](https://github.com/ClickHouse/ClickHouse/pull/109364) ([Groene AI](https://github.com/groeneai)).
* Fix `UNKNOWN_IDENTIFIER` error on `ALTER TABLE ... DROP COLUMN` when another column has a `DEFAULT` or `MATERIALIZED` expression that defines and references an inline alias. [#109374](https://github.com/ClickHouse/ClickHouse/pull/109374) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a data race (and resulting rare crash) in the parallel merge of `uniqExact` aggregate states with two-level sets, which could occur with `GROUPING SETS`, `ROLLUP` and `CUBE`. [#109389](https://github.com/ClickHouse/ClickHouse/pull/109389) ([Groene AI](https://github.com/groeneai)).
* Fixed an error (`NOT_FOUND_COLUMN_IN_BLOCK`, or `std::bad_function_call` in older versions) when running `CREATE TABLE ... ON CLUSTER ... AS SELECT` reading a `Distributed` table on a cluster with two or more shards. [#109407](https://github.com/ClickHouse/ClickHouse/pull/109407) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed merges for tables with `TTL ... GROUP BY` (rollup): parts that were already fully aggregated could be rescheduled for merging again and again indefinitely, and tables with `MATERIALIZED` columns or enabled persistent virtual columns were handled incorrectly — such columns are now aggregated with `any`. Closes [#105647](https://github.com/ClickHouse/ClickHouse/issues/105647). [#109410](https://github.com/ClickHouse/ClickHouse/pull/109410) ([Mikhail Artemenko](https://github.com/Michicosun)). [#109532](https://github.com/ClickHouse/ClickHouse/pull/109532) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fixed `IN` with a bare array column on the right argument silently returning a wrong (always-false) result or throwing an exception, so that `x IN arr` behaves like `has(arr, x)`. [#109416](https://github.com/ClickHouse/ClickHouse/pull/109416) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `UNKNOWN_IDENTIFIER` errors on `ALTER TABLE` operations (`RENAME`/`ADD`/`MODIFY COLUMN`, and `MATERIALIZE INDEX` on a table with freshly inserted parts) for `MergeTree` tables with an implicit min-max index over the persistent virtual columns `_block_number`/`_block_offset` (enabled by `add_minmax_index_for_block_number_column`/`add_minmax_index_for_block_offset_column`). [#109428](https://github.com/ClickHouse/ClickHouse/pull/109428) ([Groene AI](https://github.com/groeneai)). [#110236](https://github.com/ClickHouse/ClickHouse/pull/110236) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` in `arrayFold` over a non-const `Array(LowCardinality(T))` argument (for example `arrayFold((acc, x) -> acc + x, materialize([1, 2, 3]::Array(LowCardinality(Int64))), toInt64(0))`), which failed with `Arguments of 'plus' have incorrect data types` (a server abort in debug and sanitizer builds). [#109462](https://github.com/ClickHouse/ClickHouse/pull/109462) ([Groene AI](https://github.com/groeneai)).
* Fixed `CHECK TABLE` on a `ReplicatedMergeTree` table reporting a healthy part as broken when a transient, retryable ZooKeeper error (e.g. connection loss) occurred during the check; such errors are now surfaced as a retryable query error instead. [#109465](https://github.com/ClickHouse/ClickHouse/pull/109465) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix segfaults in `groupArrayLastMerge` and the `largestTriangleThreeBuckets` aggregate function: deserialization of aggregate function states is now validated, so a broken state does not lead to an out-of-bounds memory access. [#109485](https://github.com/ClickHouse/ClickHouse/pull/109485) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)). [#109492](https://github.com/ClickHouse/ClickHouse/pull/109492) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed the global `max_rows_in_join` / `max_bytes_in_join` limit not being enforced for the `parallel_hash` join algorithm, where a query with `join_overflow_mode = 'throw'` could silently succeed instead of raising `SET_SIZE_LIMIT_EXCEEDED`. [#109488](https://github.com/ClickHouse/ClickHouse/pull/109488) ([Hechem Selmi](https://github.com/m-selmi)).
* Fixed reading Paimon tables partitioned by a `BIGINT` column whose value does not fit into `Int32`. Such partition values were truncated (for example `9223372036854775807` became `-1`), which produced a wrong partition path and failed with a filesystem error. [#109510](https://github.com/ClickHouse/ClickHouse/pull/109510) ([Groene AI](https://github.com/groeneai)).
* Fix a crash when reading Iceberg tables with equality delete files. If a column is nullable in the equality delete file but non-nullable in the table schema (or vice versa), the values read from the delete file were inserted into a column of a different type through an unchecked cast (a column type confusion), corrupting the column and crashing the server. [#109551](https://github.com/ClickHouse/ClickHouse/pull/109551) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed the MySQL `connect_timeout`, read and write timeouts not taking effect: a connection attempt to an unresponsive MySQL server could hang for more than two minutes even with `connect_timeout = 1`, because the sampling query profiler's periodic signals kept resetting the MySQL client's internal poll deadline. [#109592](https://github.com/ClickHouse/ClickHouse/pull/109592) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed a `LOGICAL_ERROR` (`creation_csn is not set while removal_csn is set to 1`) that could be thrown when a non-transactional `TRUNCATE` ran concurrently with an uncommitted transaction that had inserted into the same table. Such a `TRUNCATE` no longer removes parts created by not-yet-committed transactions. [#109598](https://github.com/ClickHouse/ClickHouse/pull/109598) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix `TYPE_MISMATCH` errors when reading `Parquet` struct columns whose physical nullability differs from the requested ClickHouse type: a non-nullable `Parquet` group can now be read as `Nullable(Tuple(...))`, and the native `Parquet` reader can read a physically nullable struct (a `Parquet` `OPTIONAL` group) as `Nullable(Tuple(...))`. [#109615](https://github.com/ClickHouse/ClickHouse/pull/109615) ([Groene AI](https://github.com/groeneai)). [#109898](https://github.com/ClickHouse/ClickHouse/pull/109898) ([Groene AI](https://github.com/groeneai)).
* Fixed silent data loss when an `INSERT ... VALUES` in a multi-query stream is followed by a trailing SQL comment (for example `VALUES (1) -- comment`) under the server-side inline insert parsing path (`send_table_structure_on_insert_with_inline_data = 0`). The trailing comment was scanned as row data past the terminating `;`, causing the following queries in the stream to be silently skipped. [#109643](https://github.com/ClickHouse/ClickHouse/pull/109643) ([Groene AI](https://github.com/groeneai)).
* Fix a segfault when a query arrives in a narrow window during server shutdown after an error at startup. [#109675](https://github.com/ClickHouse/ClickHouse/pull/109675) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed stale skip indices (`text`, `bloom_filter`, etc.) and projections after materializing lightweight updates with `ALTER TABLE ... APPLY PATCHES`. Previously the index and projection files that depend on a patch-updated column were left unchanged, so queries using them could return wrong results (e.g. `hasToken` missing an updated row, or a projection returning stale aggregates once the spent patch part was removed). [#109709](https://github.com/ClickHouse/ClickHouse/pull/109709) ([Groene AI](https://github.com/groeneai)).
* Fix `system.tables` silently skipping databases for users with per-database grants when the query reads only the `name`/`database` columns. Introduced in 26.2. [#109723](https://github.com/ClickHouse/ClickHouse/pull/109723) ([Samay Sharma](https://github.com/samay-sharma)).
* Fix a `LOGICAL_ERROR` when writing a `LowCardinality(Time)` column to the `Arrow` format with `output_format_arrow_low_cardinality_as_dictionary = 1`. [#109730](https://github.com/ClickHouse/ClickHouse/pull/109730) ([Groene AI](https://github.com/groeneai)).
* Fix `ObjectStorageQueue`/`AzureQueue` (and the `azureBlobStorage` table function) silently skipping objects when the object storage returns an empty listing page together with a continuation token. Azure Blob Storage does this (e.g. when a listing crosses an internal partition boundary), and the async list iterator was treating the empty page as the end of the listing and dropping the token. It now follows the continuation token. [#109761](https://github.com/ClickHouse/ClickHouse/pull/109761) ([Gal Ben Moshe](https://github.com/GalBenMoshe)).
* Fixed partition pruning returning no rows for Iceberg tables partitioned by a timestamp (`DateTime64`) column. [#109764](https://github.com/ClickHouse/ClickHouse/pull/109764) ([Den Kalantaevskii](https://github.com/Diskein)).
* Fix an `ILLEGAL_COLUMN` exception in the `conv` function for `FixedString` arguments; they are now correctly cast to `String`. Closes [#109670](https://github.com/ClickHouse/ClickHouse/issues/109670). [#109771](https://github.com/ClickHouse/ClickHouse/pull/109771) ([hp](https://github.com/hp77-creator)).
* The `getClientHTTPHeader` function now treats header names as case-insensitive, according to [RFC 9110](https://www.rfc-editor.org/info/rfc9110/#section-5.1); in particular, the `authorization` header is now filtered out regardless of case. Closes [#103957](https://github.com/ClickHouse/ClickHouse/issues/103957). [#109791](https://github.com/ClickHouse/ClickHouse/pull/109791) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fix `max_execution_time` (with `timeout_overflow_mode = 'throw'`) sometimes never cancelling a query: when the internal timeout watcher was already waiting for a query with a later deadline, a query with an earlier deadline registered afterwards could be missed entirely, letting it run long past its time limit. [#109792](https://github.com/ClickHouse/ClickHouse/pull/109792) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed the file name of gzip-compressed Iceberg metadata files. ClickHouse wrote them as `v{N}.gzip.metadata.json` (the HTTP `Content-Encoding` token), while the Iceberg spec expects the `gz` extension `v{N}.gz.metadata.json`. As a result Spark and other Hadoop-catalog readers could not find the metadata written by ClickHouse. ClickHouse now writes `v{N}.gz.metadata.json` and still reads the legacy `gzip` name for backward compatibility. [#109812](https://github.com/ClickHouse/ClickHouse/pull/109812) ([Groene AI](https://github.com/groeneai)).
* Fixed `NOT_IMPLEMENTED` error ("Method getDataAt is not supported for Nullable(String)") that could be thrown by a join with `enable_join_runtime_filters = 1` (on by default since 26.2) when the build-side join key was `LowCardinality(Nullable(...))` with `NULL` values and the runtime filter fell back to its bloom filter. [#109824](https://github.com/ClickHouse/ClickHouse/pull/109824) ([Groene AI](https://github.com/groeneai)).
* External database engines (e.g. `PostgreSQL`) no longer push down range comparisons (`>=`, `>`, `<=`, `<`) on `UUID` columns. ClickHouse and external databases order UUIDs differently, so pushing these down silently dropped rows from the result; such predicates are now evaluated by ClickHouse instead. [#109833](https://github.com/ClickHouse/ClickHouse/pull/109833) ([Vismay](https://github.com/vismaytiwari)).
* Fixed a server crash when a lambda expression was passed where a higher-order function expects a concrete value (for example the accumulator of `arrayFold`, as in `arrayFold(lambda, arr, another_lambda)`). Such queries are now rejected with `ILLEGAL_TYPE_OF_ARGUMENT` instead of crashing when `enable_analyzer = 0`. [#109840](https://github.com/ClickHouse/ClickHouse/pull/109840) ([Groene AI](https://github.com/groeneai)).
* Fixed the `icebergLocal` table function and `IcebergLocal` engine declaring `azure` instead of `local` as their object storage type, which made them fail the disk type check (`Disk type doesn't match`) when used with a local disk via `SETTINGS disk = '...'`. [#109872](https://github.com/ClickHouse/ClickHouse/pull/109872) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fix reading Iceberg tables partitioned by the same source column more than once (for example `PARTITIONED BY (hours(ts), ts)`). Such tables previously failed with `Cannot add column ...: column with this name already exists (ILLEGAL_COLUMN)`. [#109895](https://github.com/ClickHouse/ClickHouse/pull/109895) ([Groene AI](https://github.com/groeneai)).
* Fix wrong query results caused by the primary key index incorrectly pruning granules for tables with a reversed (`DESC`) key column when parts have no final mark (non-adaptive granularity, `index_granularity_bytes = 0`). [#109901](https://github.com/ClickHouse/ClickHouse/pull/109901) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed `generateRandomStructure` occasionally producing an invalid structure string with two data types concatenated (for example `Decimal32(7)IPv4`) when type nesting exceeded the internal depth limit, which made the result unparseable. [#109928](https://github.com/ClickHouse/ClickHouse/pull/109928) ([Groene AI](https://github.com/groeneai)).
* Fixed `NOT_IMPLEMENTED` error (`Method getDataAt is not supported for Nullable(String) in case if value is NULL`) when a `text` index is built on `Array(LowCardinality(Nullable(String)))` (including `Nested` fields stored that way) and an indexed array contains a `NULL` element. `NULL` array elements are now skipped during index construction, matching `Array(Nullable(String))`. [#110055](https://github.com/ClickHouse/ClickHouse/pull/110055) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results when a `minmax` skip index is built on a `LowCardinality(Nullable(...))` column: `WHERE`/`PREWHERE`/`HAVING ... IS NULL` predicates pushed to storage previously pruned every granule and returned 0 rows even though the column contained `NULL` values. [#110061](https://github.com/ClickHouse/ClickHouse/pull/110061) ([Groene AI](https://github.com/groeneai)).
* Fix `distinct_overflow_mode = 'break'`: `DISTINCT` now returns the partial result accumulated up to the limit and stops reading the source, as documented. Previously the chunk that crossed `max_rows_in_distinct` / `max_bytes_in_distinct` was discarded (truncated or empty results) and the query kept reading and inserting into the hash set to the end of the input, which could end in `MEMORY_LIMIT_EXCEEDED`. [#110075](https://github.com/ClickHouse/ClickHouse/pull/110075) ([Sergey Kuznetsov](https://github.com/skuznetsov-clickhouse)).
* Fixed a logical error `ChunkInfoRowNumbers does not exist` on `OPTIMIZE TABLE` of an Iceberg table containing a data file in a non-Parquet format (e.g. `ORC`) newer than all position delete files. [#110107](https://github.com/ClickHouse/ClickHouse/pull/110107) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `max_bytes_in_distinct` and `max_bytes_in_set`: string keys are stored in an arena that was not counted by the limit checks, so `DISTINCT` / `IN` over string keys could hold memory exceeding the byte limit by the whole key payload (unbounded in the key length). The limits now account for the arena, matching their documentation; queries with string keys close to a byte limit may now trip it earlier (correctly). [#110120](https://github.com/ClickHouse/ClickHouse/pull/110120) ([Sergey Kuznetsov](https://github.com/skuznetsov-clickhouse)).
* Fix a `LOGICAL_ERROR` (`Bad cast from type ColumnLowCardinality to ColumnString`) when `identity` (or a scalar subquery result) wraps a value containing a nested `LowCardinality` and the query uses `WITH TOTALS`/`WITH ROLLUP`. [#110138](https://github.com/ClickHouse/ClickHouse/pull/110138) ([Groene AI](https://github.com/groeneai)).
* Fixed reading `Npy` files with zero-sized inner dimensions: the number of materialized rows and the optimized and non-optimized `count` results now agree. [#110146](https://github.com/ClickHouse/ClickHouse/pull/110146) ([Yanjun Qiu](https://github.com/qiuyanjun888)).
* Fixed a quadratic-time blowup (and unresponsiveness to `max_execution_time`) in aggregation in order when grouping by multiple keys whose sort order is only a prefix of the grouping key. [#110159](https://github.com/ClickHouse/ClickHouse/pull/110159) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a logical error (`Unexpected number of columns in result sample block`) when a filter containing a correlated subquery (for example `exists((SELECT ...))`) is optimized with `convert_query_to_cnf` or `optimize_and_compare_chain`. [#110187](https://github.com/ClickHouse/ClickHouse/pull/110187) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an exception (`UNION mode UNION_DEFAULT must be normalized`) when a `DELETE` or `ALTER UPDATE` mutation used a set operation (`UNION`/`UNION ALL`/`UNION DISTINCT`/`EXCEPT`/`INTERSECT`) inside a subquery in its `WHERE` condition or in an `UPDATE` assignment. [#110196](https://github.com/ClickHouse/ClickHouse/pull/110196) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `ReadBuffer is canceled. Can't read from it.` logical error (server abort in debug/sanitizer builds) that could occur while reading a zip archive (e.g. during `RESTORE` from a zip backup) after a prior read from the same archive failed mid-stream. [#110197](https://github.com/ClickHouse/ClickHouse/pull/110197) ([Groene AI](https://github.com/groeneai)).
* Fixed slow server shutdown and unresponsive `KILL MUTATION` when a mutation with `x IN (subquery)` was building the subquery set during primary-key analysis; the set build is now cancelled promptly. [#110198](https://github.com/ClickHouse/ClickHouse/pull/110198) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Keeper now rejects the coordination settings `max_requests_batch_size` and `max_requests_append_size` being set to `0` instead of getting stuck in an infinite append-entries loop in a multi-node setup. [#110200](https://github.com/ClickHouse/ClickHouse/pull/110200) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `NOT_FOUND_COLUMN_IN_BLOCK` error when using `GROUP BY ALL` over a tuple expression together with `ORDER BY`. [#110206](https://github.com/ClickHouse/ClickHouse/pull/110206) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `NOT_FOUND_COLUMN_IN_BLOCK` error on `INSERT` into a table that has a `CHECK` constraint referencing a subcolumn (such as `x.null` of a `Nullable` column or `arr.size0` of an `Array`). [#110208](https://github.com/ClickHouse/ClickHouse/pull/110208) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix reading Iceberg tables whose default sort order references a column that needs quoting (e.g. `@timestamp`). Such tables were unreadable because the synthesized storage `ORDER BY` was built from the raw column name and failed to parse with `SYNTAX_ERROR`. [#110233](https://github.com/ClickHouse/ClickHouse/pull/110233) ([Groene AI](https://github.com/groeneai)).
* Fixed `system.tables` for a `DataLakeCatalog` (Iceberg/Glue) database aborting the whole query, or silently dropping tables, when a single table's metadata is unresolvable. Such a table now stays listed by name with default/NULL values for the columns that need the opened storage object (`engine`, `total_rows`, etc.), regardless of `database_datalake_require_metadata_access`. Direct access to the broken table still reports the error. [#110242](https://github.com/ClickHouse/ClickHouse/pull/110242) ([Groene AI](https://github.com/groeneai)).
* Fixed a possible crash (heap-buffer-overflow) when a `quantileTDigest`-family aggregate-function state column was used as a `GROUP BY` key and serialized concurrently by several threads. [#110263](https://github.com/ClickHouse/ClickHouse/pull/110263) ([Groene AI](https://github.com/groeneai)).
* Fixed `INSERT` into a Microsoft Fabric / OneLake `DataLakeCatalog` table failing with `IncorrectEndpointError` (HTTP 400) by routing ADLS Gen2 (DFS) writes to the `.dfs` endpoint host instead of the `.blob` host. Note: with `remote_url_allow_hosts`, both the `.blob` (read) and `.dfs` (write) Fabric hosts must be allow-listed for `INSERT`. [#110290](https://github.com/ClickHouse/ClickHouse/pull/110290) ([Mohammad Lareb Zafar](https://github.com/zlareb1)).
* Fixed a server abort when parsing certain PRQL queries (`SET dialect = 'prql'`). A panic inside the `prqlc` compiler was aborting the process instead of being reported as a query error. [#110316](https://github.com/ClickHouse/ClickHouse/pull/110316) ([Groene AI](https://github.com/groeneai)).
* Fix silently wrong query results when a projection part written before the projection's column set changed (for example, after upgrading across versions that materialize an `ALIAS` column's source differently, or after `ALTER TABLE ... MODIFY COLUMN` re-points an `ALIAS` column used by a projection) was read through the projection or merged: the missing column was filled with default values instead of the real data. Such parts are now read from the base table, and merges rebuild the projection from the base data. [#110328](https://github.com/ClickHouse/ClickHouse/pull/110328) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed `ORDER BY ... WITH FILL` not respecting `max_execution_time` and being slow to cancel when generating a large fill range (especially with `INTERPOLATE`). [#110332](https://github.com/ClickHouse/ClickHouse/pull/110332) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a logical error (a server abort in debug/sanitizer builds) when a multi-command `ALTER` such as `UPDATE ..., DELETE ...` was issued on an Iceberg table. Such mutations are now rejected with a clear `NOT_IMPLEMENTED` error. [#110347](https://github.com/ClickHouse/ClickHouse/pull/110347) ([Groene AI](https://github.com/groeneai)).
* Fixed a parser bug where `COMMENT` was incorrectly consumed as an implicit alias when a `SELECT` query ended directly after a bare table identifier (e.g. `... FROM t COMMENT 'x'`), causing a misleading syntax error instead of the comment being applied to the view/table. [#110372](https://github.com/ClickHouse/ClickHouse/pull/110372) ([Aditya Kumar](https://github.com/adityaksolves)).
* Fixed a server crash (native stack overflow) when a deeply nested `Array`/`Tuple`/`Map`/`Object` literal is copied or destroyed, for example a query with a very deeply nested literal at a raised `max_parser_depth`. [#110393](https://github.com/ClickHouse/ClickHouse/pull/110393) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed two cases where vector search could return fewer rows than expected: `vector_search_index_fetch_multiplier` values below 1.0 could truncate the computed fetch count to zero and produce an empty result (such values are now rejected), and the vector search optimization is now skipped for `LIMIT ... WITH TIES` queries, because the optimization bounds the search to exactly N candidates and dropped rows tied with the N-th row. [#110452](https://github.com/ClickHouse/ClickHouse/pull/110452) ([Tamish Mhatre](https://github.com/tamish560)). [#110453](https://github.com/ClickHouse/ClickHouse/pull/110453) ([Tamish Mhatre](https://github.com/tamish560)).
* Fix the logical error `Expected CommonSubplanReferenceStep to reference CommonSubplanStep`, the error `Subplan cannot be used to build pipeline`, and the logical error `Trying to extract chunk from ChunkBuffer before all inputs are finished` for `IN (subquery)` where the subquery contains a correlated subquery and the set is built during index analysis. [#110491](https://github.com/ClickHouse/ClickHouse/pull/110491) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix substitution of query parameters inside the definitions of a named `WINDOW` clause. Previously, parameters there were silently kept unsubstituted, and an unset `Identifier` parameter could lead to the exception `Logical error: '!part.empty()'` during `EXPLAIN SYNTAX`. [#110506](https://github.com/ClickHouse/ClickHouse/pull/110506) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed server startup failure for `MergeTree` tables on object storage disks when a leftover `txn_version.txt.tmp` file has broken disk-level metadata. [#110519](https://github.com/ClickHouse/ClickHouse/pull/110519) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a logical error in the filesystem cache (`Expected file ... not to exist`) that could occur when a background cache download failed with a non-filesystem error (for example while running `OPTIMIZE` on an Iceberg table), leaving an empty orphan cache file behind. [#110549](https://github.com/ClickHouse/ClickHouse/pull/110549) ([Groene AI](https://github.com/groeneai)).
* Fixed reading a corrupted `Native`-format stream whose `Dynamic` type count or `JSON`/`Object` path count is close to `SIZE_MAX`: such malformed input is now rejected with a clear `INCORRECT_DATA` error instead of an uncaught `std::length_error`. [#110590](https://github.com/ClickHouse/ClickHouse/pull/110590) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a server crash in the `MaterializedPostgreSQL` database engine that could happen when a table was detached (or its structure changed) while it was still queued for synchronization. [#110596](https://github.com/ClickHouse/ClickHouse/pull/110596) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `SET param_<name>` in the client (and `--param_<name>` flags) misbehaving when the parameter name matches a builtin setting name such as `limit`, `offset`, `max_threads`, or `log_comment`. Depending on the colliding setting, the query failed with `CANNOT_PARSE_QUOTED_STRING`, the value was silently normalized (e.g. `max_threads=0` became `auto(N)`), or a setting alias name was lost. Such a parameter also broke every subsequent `SET param_*` in the same session. [#110597](https://github.com/ClickHouse/ClickHouse/pull/110597) ([Raúl Marín](https://github.com/Algunenano)).
* Fix reading subcolumns of a column that has a `DEFAULT` expression and is not materialized in a part (e.g. after `ALTER TABLE ADD COLUMN` or during `ALTER TABLE MATERIALIZE COLUMN`): the subcolumn was filled with type default values instead of the evaluated `DEFAULT` expression, and the transposed vector distance functions (`cosineDistanceTransposed` and others) on such `QBit` columns failed with the `SIZES_OF_ARRAYS_DONT_MATCH` error. This closes [#110634](https://github.com/ClickHouse/ClickHouse/issues/110634). [#110636](https://github.com/ClickHouse/ClickHouse/pull/110636) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `LOGICAL_ERROR` `Invalid partition key size: 0` that could fail an `INSERT` into a partitioned `MergeTree` table with `non_replicated_deduplication_window` enabled, when an async insert batch was only partially deduplicated (some `insert_deduplication_token` values were duplicates and some were new). [#110651](https://github.com/ClickHouse/ClickHouse/pull/110651) ([Groene AI](https://github.com/groeneai)).
* A background asynchronous insert flush now stops promptly when killed with `KILL QUERY`; previously a flush of a large buffered payload kept parsing to the end and ignored the cancellation. [#110652](https://github.com/ClickHouse/ClickHouse/pull/110652) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed wrong results from `GROUP BY` with `optimize_aggregation_in_order` and `DISTINCT` with `optimize_distinct_in_order` placed over a `partial_merge` JOIN. The read-in-order optimization was propagated through the partial-merge join, which re-sorts its left input by the join key and therefore does not preserve the left stream's original order, so rows were grouped incorrectly. [#110671](https://github.com/ClickHouse/ClickHouse/pull/110671) ([Groene AI](https://github.com/groeneai)).
* Fixed a signed integer overflow in `toStartOfInterval` with an extreme `MONTH`, `WEEK`, or `DAY` interval count on `Date`/`Date32`/`DateTime64` values. [#110688](https://github.com/ClickHouse/ClickHouse/pull/110688) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error for queries with a subquery in `FROM` when parallel replicas run in `custom_key_sampling` / `custom_key_range` mode. Such queries (e.g. `SELECT * FROM (SELECT id, k, v FROM t WHERE id < 20) ORDER BY k`) previously failed with `Not found column __table2.id in block ...`. [#110690](https://github.com/ClickHouse/ClickHouse/pull/110690) ([Groene AI](https://github.com/groeneai)).
* Fixed `readWKT` rejecting WKT strings with leading whitespace (e.g. `readWKT(' POINT(1 2)')`), which are accepted by the typed `readWKTPoint`/`readWKTPolygon`/... readers and by the WKT grammar. [#110706](https://github.com/ClickHouse/ClickHouse/pull/110706) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error (`Column ... already added for reading`, a server abort in debug/sanitizer builds) when the same text-index predicate is used in both `PREWHERE` and `WHERE` of a query over a `Merge` table on top of a `Distributed` table. [#110710](https://github.com/ClickHouse/ClickHouse/pull/110710) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error for the transposed distance functions over `QBit` columns (such as `cosineDistanceTransposed`) called with a scalar-subquery or constant reference vector when parallel replicas are enabled. This closes [#110719](https://github.com/ClickHouse/ClickHouse/issues/110719). [#110729](https://github.com/ClickHouse/ClickHouse/pull/110729) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a rare `LOGICAL_ERROR` (`Unexpected number of parts to remove from parts_queue`; a server abort in debug/sanitizer builds) on `ReplicatedMergeTree` when two partition operations (for example two `MOVE PARTITION`/`REPLACE PARTITION` queries, or one racing a background `DROP_RANGE`) cancelled the background part check over overlapping ranges at the same time. [#110738](https://github.com/ClickHouse/ClickHouse/pull/110738) ([Groene AI](https://github.com/groeneai)).
* Fixed a `Hash is not set for serialization` logical error that could occur when a column with a `Quantized(...)` codec was wrapped inside another serialization, for example in a `Merge` table over sources whose same-named column has different types (merged into a `Variant`). [#110776](https://github.com/ClickHouse/ClickHouse/pull/110776) ([Groene AI](https://github.com/groeneai)).
* Fix a server hang when multiplying a `median`/`quantile` aggregate function state by a huge integer constant (e.g. `medianState(x) * 18446744073709551615`). The query became unresponsive to cancellation and could run indefinitely. [#110779](https://github.com/ClickHouse/ClickHouse/pull/110779) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash (integer division by zero) when a quota with a zero-length interval (for example `CREATE QUOTA q FOR INTERVAL 0 SECOND MAX queries = 1000`) was consumed. A non-positive quota interval duration is now rejected at quota creation. [#110846](https://github.com/ClickHouse/ClickHouse/pull/110846) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fixed `throwIf(notLike(col, pattern))` (and other `throwIf` over a function) throwing unconditionally when `col` is `LowCardinality`. The default `LowCardinality` implementation ran `throwIf` on the whole dictionary, which always holds the reserved default value even when no row references it, so a non-zero value in that unused slot made `throwIf` throw for data that does not satisfy the condition. [#110864](https://github.com/ClickHouse/ClickHouse/pull/110864) ([Groene AI](https://github.com/groeneai)).
* Propagate a query's active roles (`SET ROLE` or the `role` parameter) to remote nodes on parallel-replica and `Distributed` reads over a cluster secured with an interserver secret; previously the remote nodes fell back to the user's default roles, evaluating row policies inconsistently with the initiator. [#110867](https://github.com/ClickHouse/ClickHouse/pull/110867) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fixed Iceberg tables producing duplicate field IDs after `ALTER TABLE ... ADD COLUMN` when the initial schema contains nested fields (`Tuple`/`Array`/`Map`). `last-column-id` now records the maximum assigned field ID including nested children, so a subsequently added column no longer reuses a nested field ID and reads no longer fail with `ICEBERG_SPECIFICATION_VIOLATION` (`Duplicate field id`). [#110884](https://github.com/ClickHouse/ClickHouse/pull/110884) ([Groene AI](https://github.com/groeneai)).
* Fixed a crash in FIPS builds when using an Ed25519 SSH key (`CREATE USER ... IDENTIFIED WITH ssh_key ... TYPE 'ssh-ed25519'`, or such a key in `users.xml`). Ed25519 is not FIPS-approved; such keys are now rejected with a clear `LIBSSH_ERROR` error. [#110891](https://github.com/ClickHouse/ClickHouse/pull/110891) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix the reduced-precision results of the transposed distance functions over `QBit` columns (`cosineDistanceTransposed`, `L2DistanceTransposed`, `dotProductTransposed`). Values truncated to `precision` bit planes were reconstructed with the dropped bits zero-filled, which biased every reconstructed value towards zero and was degenerate at low precision: for `QBit(BFloat16)` at precision 1 only the sign bit survives, so every value reconstructed to `±0.0` and the distance was the same constant for every row, carrying no ranking information. Truncated values are now reconstructed to a bounded midpoint of the remaining precision cell (raw `Int8` codes to their cell centre; exact zeros and infinities are preserved), so a smaller `precision` trades accuracy for speed without wildly biased results. Full-precision results are unchanged. This closes [#110898](https://github.com/ClickHouse/ClickHouse/issues/110898). [#110911](https://github.com/ClickHouse/ClickHouse/pull/110911) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a server crash (use-after-free) during graceful shutdown after Iceberg tables were queried from sessions that also used temporary tables. [#110914](https://github.com/ClickHouse/ClickHouse/pull/110914) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed a `LOGICAL_ERROR: Cannot sum Bools` (a server abort in debug/sanitizer builds) when merging `sumMap`/`sumMapWithOverflow`/`sumMapFiltered` aggregate states with `Bool` values that were serialized in the old (version 0) state format. The same fix also corrects two silent wrong-result cases with version-0 `Bool` states: map keys of type `Bool` were not deduplicated across states, and zero-value compaction dropped the wrong entries. [#110922](https://github.com/ClickHouse/ClickHouse/pull/110922) ([Groene AI](https://github.com/groeneai)).
* Fixed a crash when an aggregate function with the `-Tuple` combinator was used with `RESPECT NULLS` and produced an intermediate state (`-State`, distributed aggregation, `WITH ROLLUP`/`WITH CUBE`). The combined function was named after the wrong state variant, so its serialized `AggregateFunction` type re-resolved to an incompatible in-memory layout on a round-trip. [#110930](https://github.com/ClickHouse/ClickHouse/pull/110930) ([Groene AI](https://github.com/groeneai)).
* Fix `PREWHERE` (and row-level policies) on an Iceberg column that was renamed by schema evolution silently returning `0` rows for old data files. Such queries now return the correct rows, matching `WHERE`. [#110941](https://github.com/ClickHouse/ClickHouse/pull/110941) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`LazyMaterializingTransform: Number of rows in lazy chunk N does not match number of offsets M`) that could happen for vector search queries with `vector_search_with_rescoring = 1` combined with lazy materialization when several distances tie. [#111003](https://github.com/ClickHouse/ClickHouse/pull/111003) ([Groene AI](https://github.com/groeneai)).
* Fixed reading `Arrow`/`ArrowStream` data with empty nested `Array`/`Map` columns produced by Apache Arrow Java \< 19.0.0 (bundled with Apache Spark), which were previously rejected with an `INCORRECT_DATA` error about the offsets buffer being too small. [#111101](https://github.com/ClickHouse/ClickHouse/pull/111101) ([Raúl Marín](https://github.com/Algunenano)).
* Fix stale reads on `plain_rewritable` disks with the page cache enabled. [#111105](https://github.com/ClickHouse/ClickHouse/pull/111105) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix `CANNOT_CONVERT_TYPE` error for constants of `Variant` type (including `Geometry`) in distributed queries and queries with parallel replicas. [#111136](https://github.com/ClickHouse/ClickHouse/pull/111136) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix a bug where reading large files from HDFS could fail or read incorrectly when a single read request exceeded the `hdfsPread` 32-bit size limit (`INT_MAX`). [#98470](https://github.com/ClickHouse/ClickHouse/pull/98470) ([Arup Chauhan](https://github.com/arup-chauhan)).
* Fix incorrect use of the text index for equality comparisons with an empty needle. [#108340](https://github.com/ClickHouse/ClickHouse/pull/108340) ([Robert Schulze](https://github.com/rschu1ze)).
* Fixed a hang in `SYSTEM SYNC MERGES` with the `Manual` merge selector when a scheduled merge could not be placed into a full background pool. [#108770](https://github.com/ClickHouse/ClickHouse/pull/108770) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `ATTACH TABLE ... AS REPLICATED` discarding committed data and resurrecting pre-mutation rows when a stale `txn_version.txt.tmp` file was left on a data part. [#108772](https://github.com/ClickHouse/ClickHouse/pull/108772) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a possible race condition in `ALTER TABLE ... MOVE PARTITION TO TABLE` with non-replicated `MergeTree` tables that could produce intersecting data parts, because the commit of moved parts and block number allocation were not under the same lock. [#108922](https://github.com/ClickHouse/ClickHouse/pull/108922) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix reading `Iceberg` tables written by Databricks UniForm, which writes a degenerate placeholder schema (with an empty field list) into manifest files. [#108945](https://github.com/ClickHouse/ClickHouse/pull/108945) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix a use-after-free when reading a non-partitioned `Hive` table with multiple threads. [#109164](https://github.com/ClickHouse/ClickHouse/pull/109164) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the console log level not being reverted after server startup when `logger.startup_console_log_level` is set: the level was captured from the wrong configuration key, so the console stayed at the elevated startup level for the lifetime of the server. Closes [#103472](https://github.com/ClickHouse/ClickHouse/issues/103472). [#109858](https://github.com/ClickHouse/ClickHouse/pull/109858) ([Garrett Thomas](https://github.com/garrettthomaskth)).
* Fix snapshot-isolation anomalies in `plain_rewritable` disk metadata transactions. Fixes [#92055](https://github.com/ClickHouse/ClickHouse/issues/92055). [#110948](https://github.com/ClickHouse/ClickHouse/pull/110948) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix an abort (`front() called on an empty vector`) in `clickhouse-client --login` when the host was not passed as an explicit `--host` argument, for example when it came from `--connection`, the configuration file, or the `CLICKHOUSE_HOST` environment variable. Closes [#103603](https://github.com/ClickHouse/ClickHouse/issues/103603). [#110279](https://github.com/ClickHouse/ClickHouse/pull/110279) ([Christoph Wurm](https://github.com/cwurm)).
* Fix a logical error (`!part.empty()`) when a lambda argument is a backtick-quoted identifier whose name contains a dot (for example `__table1.`). Such a query previously produced a handled exception in release builds and aborted the server in debug and sanitizer builds while formatting an error message. [#108735](https://github.com/ClickHouse/ClickHouse/pull/108735) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`No set is registered for key`) in `ALTER TABLE ... DROP COLUMN`, `ALTER TABLE ... DELETE`/`UPDATE` mutations, and lightweight `DELETE FROM`, on tables that have an `ALIAS` column whose expression uses an `IN` operator (including through another `ALIAS` column). [#111039](https://github.com/ClickHouse/ClickHouse/pull/111039) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fixed silent data loss with async inserts and deduplication (`async_insert=1`, `async_insert_deduplicate=1`). When several async-insert entries with distinct `insert_deduplication_token` values were coalesced into one flush that wrote to disjoint partitions, each token was registered in the deduplication log of every partition the flush touched, not only the partition its own rows landed in. A later insert reusing one of those tokens in a partition it never wrote to was then silently deduplicated away. Tokens are now registered only against the partition their rows actually landed in. Closes [#111031](https://github.com/ClickHouse/ClickHouse/issues/111031). [#111049](https://github.com/ClickHouse/ClickHouse/pull/111049) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` exception (`ScatterExchangeStep should have one source shard, got 8`) and duplicated rows when querying a `Merge` table over `Distributed` tables or views with the experimental setting `make_distributed_plan = 1`. Closes [#107946](https://github.com/ClickHouse/ClickHouse/issues/107946). [#108401](https://github.com/ClickHouse/ClickHouse/pull/108401) ([Groene AI](https://github.com/groeneai)).
* Serialize a `Nullable(Tuple(...))` column as a single `CSV` field instead of flattening it into separate columns. Previously a non-null value was written as several `CSV` fields while `NULL` was a single `\N`, giving a row-dependent column count that broke `CSVWithNames`/`CSVWithNamesAndTypes` headers and round-trips. [#108959](https://github.com/ClickHouse/ClickHouse/pull/108959) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error (`KeyCondition uses PREWHERE output`) in the `Parquet` v3 reader when a format-level key condition references a column that is not read from the `Parquet` file. [#109267](https://github.com/ClickHouse/ClickHouse/pull/109267) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results for table-function reads with `FINAL` or `SAMPLE` under `serialize_query_plan = 1`. Also fix the aggregation hash-table statistics cache key for table functions so different table functions no longer share the same preallocation entry. [#109847](https://github.com/ClickHouse/ClickHouse/pull/109847) ([Azat Khuzhin](https://github.com/azat)).
* Fixed cleanup of a `BACKUP ... TO Memory(...)` that fails before finalization: the failed backup was left registered, so its name could not be reused. [#109947](https://github.com/ClickHouse/ClickHouse/pull/109947) ([Julia Kartseva](https://github.com/jkartseva)).
* Fix extreme interval arithmetic for `WITH FILL STEP` and the `add*` / `subtract*` date/time interval functions: out-of-range deltas no longer rely on signed overflow, and `WITH FILL` with a huge `YEAR` step no longer stalls by running the calendar backward. [#110158](https://github.com/ClickHouse/ClickHouse/pull/110158) ([Groene AI](https://github.com/groeneai)).
* Fix `411 Length Required` errors from Azure services: the Poco-based Azure HTTP transport now sets `Content-Length` from the request body for SDK clients that do not set it themselves, such as Azure Key Vault. [#110299](https://github.com/ClickHouse/ClickHouse/pull/110299) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* The lazy `FINAL` optimization (`query_plan_optimize_lazy_final`, disabled by default) is no longer applied when the query reads in sorting-key order, because its replacement plan does not preserve that order and could return incorrectly ordered results. It is also no longer applied when a `LIMIT` smaller than the number of rows to read applies directly to the reading step, where the mandatory set-building pass defeats early termination. [#110576](https://github.com/ClickHouse/ClickHouse/pull/110576) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed `readWKT` and `readWKTPoint` returning uninitialized (scalar) or stale prior-row (vectorized) coordinates for `POINT EMPTY`. `POINT EMPTY` is now rejected with `CANNOT_PARSE_TEXT`, since ClickHouse `Point` is a fixed `Tuple(Float64, Float64)` with no empty representation. [#110692](https://github.com/ClickHouse/ClickHouse/pull/110692) ([Groene AI](https://github.com/groeneai)).
* Fix wrong timezone handling when materializing right-side columns in hash joins. Closes [#111033](https://github.com/ClickHouse/ClickHouse/issues/111033). [#111074](https://github.com/ClickHouse/ClickHouse/pull/111074) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed wrong `count()` results and dropped rows when a `String` (or narrower `FixedString`) key or minmax skip index is filtered by a comparison with a wider `FixedString` constant, e.g. `toFixedString('abc', 257) = string_col`. Primary-key and minmax pruning built the range from the NUL-padded constant and wrongly skipped matching granules. [#111106](https://github.com/ClickHouse/ClickHouse/pull/111106) ([Groene AI](https://github.com/groeneai)).
* Fixed asynchronous `Native`-format inserts so one buffered entry that becomes incompatible after `ALTER ... MODIFY COLUMN` no longer causes the whole batch to fail. Closes [#111064](https://github.com/ClickHouse/ClickHouse/issues/111064). [#111108](https://github.com/ClickHouse/ClickHouse/pull/111108) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fix `CREATE OR REPLACE` of a dictionary with an object of another kind: it failed with `CANNOT_DETACH_DICTIONARY_AS_TABLE` after the replace was already committed, leaving an orphan `_tmp_replace_*` table. [#111142](https://github.com/ClickHouse/ClickHouse/pull/111142) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fixed `INCOMPATIBLE_TYPE_OF_JOIN` for an `ANY` join on a `Join` engine table when a `WHERE` filter on a right-side column allowed the query planner to rewrite the join to `SEMI` or `ANTI`. A `Join` engine table has a fixed declared strictness that cannot be changed, so the conversion is now declined for such tables. [#111362](https://github.com/ClickHouse/ClickHouse/pull/111362) ([Groene AI](https://github.com/groeneai)).
* Fix the `format` table function returning no columns when the input data parses to zero rows (for example an empty JSON document or a GeoJSON `FeatureCollection` with no features). It now returns an empty result with the correct columns instead of throwing `NOT_FOUND_COLUMN_IN_BLOCK`. Closes [#111390](https://github.com/ClickHouse/ClickHouse/issues/111390). [#111428](https://github.com/ClickHouse/ClickHouse/pull/111428) ([Groene AI](https://github.com/groeneai)).

<h4 id="267-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Sanitizer builds now capture the sanitizer report into the global buffer `sanitizer_report`, so that the core dump analyzer can read it from the core dump. [#109333](https://github.com/ClickHouse/ClickHouse/pull/109333) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Build `musl` from source instead of using vendored binaries. [#97452](https://github.com/ClickHouse/ClickHouse/pull/97452) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use SIMD `memcmp`/`memcpy`/`memmove`/`memset`/`bcmp`/`memmem` implementations from LLVM-libc. [#107566](https://github.com/ClickHouse/ClickHouse/pull/107566) ([Konstantin Bogdanov](https://github.com/thevar1able)). Fix silent `memmove` corruption in `-O0` debug builds (`-DDEBUG_O_LEVEL=0`) on machines with AVX-512. [#110904](https://github.com/ClickHouse/ClickHouse/pull/110904) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Remove usages of the `curl` library across the codebase and bundled third-party libraries. [#108296](https://github.com/ClickHouse/ClickHouse/pull/108296) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Updated `mariadb-connector-c` to 3.4.9. [#108328](https://github.com/ClickHouse/ClickHouse/pull/108328) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Update `libssh` to 0.12.0. [#108329](https://github.com/ClickHouse/ClickHouse/pull/108329) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix a hang on transaction `COMMIT` on macOS. [#108375](https://github.com/ClickHouse/ClickHouse/pull/108375) ([Raúl Marín](https://github.com/Algunenano)).
* Added a `COMPRESS_DEBUG_SECTIONS` CMake option that compresses DWARF debug sections in object files (`-gz`), auto-enabled where the compiler supports it, to shrink Debug build directories; final binaries are left uncompressed, so runtime stack-trace symbolization is unaffected. [#109306](https://github.com/ClickHouse/ClickHouse/pull/109306) ([Murphy](https://github.com/murphy-4o)). The bundled LLVM toolchain is now built with zlib, so its clang supports `-gz=zlib`, and the missing `clang++-21` symlink was added. [#109596](https://github.com/ClickHouse/ClickHouse/pull/109596) ([Murphy](https://github.com/murphy-4o)).
* Debug builds now compile the vendored Rust crates with reduced debug info (`debug = 1`, cargo's `limited` level) and no incremental cache (`REDUCE_RUST_DEBUG_INFO`, on by default), shrinking Rust build artifacts (\~12 → \~7 GB from scratch) and preventing unbounded cargo cache growth across rebuilds. Set `-DREDUCE_RUST_DEBUG_INFO=OFF` to restore full DWARF and incremental compilation. [#109471](https://github.com/ClickHouse/ClickHouse/pull/109471) ([Murphy](https://github.com/murphy-4o)).
* Support the streaming distributed query exchange and `STREAM` reads on macOS. [#109769](https://github.com/ClickHouse/ClickHouse/pull/109769) ([Raúl Marín](https://github.com/Algunenano)).
* Bump `libarchive` from 3.8.7 to 3.8.8. [#109874](https://github.com/ClickHouse/ClickHouse/pull/109874) ([Robert Schulze](https://github.com/rschu1ze)).
* Bump `c-ares` from 1.34.6 to 1.34.8. [#109905](https://github.com/ClickHouse/ClickHouse/pull/109905) ([Robert Schulze](https://github.com/rschu1ze)).
* Update `krb5` to fix CVE-2026-40355 and CVE-2026-40356. [#109910](https://github.com/ClickHouse/ClickHouse/pull/109910) ([Robert Schulze](https://github.com/rschu1ze)).
* Removed the `libpng` third-party dependency. `FORMAT PNG` now uses a small built-in PNG encoder (backed by the bundled zlib) instead. [#110051](https://github.com/ClickHouse/ClickHouse/pull/110051) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Track raw C allocations (not going through `operator new`) in the memory tracker on macOS by wrapping the jemalloc malloc zone, so memory limits are enforced for them. [#110370](https://github.com/ClickHouse/ClickHouse/pull/110370) ([Raúl Marín](https://github.com/Algunenano)).
* The `-distroless` Docker images for `clickhouse-server` and `clickhouse-keeper` are now built from the shell-free production stage; previously they were built from the debug stage and included `/busybox/sh`. Closes [#105677](https://github.com/ClickHouse/ClickHouse/issues/105677). [#105678](https://github.com/ClickHouse/ClickHouse/pull/105678) ([ashishch432](https://github.com/ashishch432)).
* Update `abseil-cpp` to LTS `20260526.0`. [#108991](https://github.com/ClickHouse/ClickHouse/pull/108991) ([Konstantin Bogdanov](https://github.com/thevar1able)).

<h3 id="266">
  ClickHouse release 26.6, 2026-06-25. [Presentation](https://presentations.clickhouse.com/2026-release-26.6/), [Video](https://www.youtube.com/watch?v=-NmqMH9y4EY)
</h3>

<h4 id="266-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* The change removes `allow_experimental_query_deduplication` feature. The feature was experimental for a long time, has no tests and not going to be supported (initial tests were unstable and has been removed in [#49579](https://github.com/ClickHouse/ClickHouse/pull/49579)). [#99398](https://github.com/ClickHouse/ClickHouse/pull/99398) ([Igor Nikonov](https://github.com/devcrafter)).
* The XRay-based `SYSTEM INSTRUMENT` feature now uses `arguments` instead of `parameters`: the `system.instrumentation.parameters` column was renamed to `arguments`, and the `SYSTEM INSTRUMENT ADD ... HANDLER PARAMETERS ...` syntax was renamed to `SYSTEM INSTRUMENT ADD ... HANDLER ARGUMENTS ...`. Queries or automation that use the old column or syntax must be updated to use the new names; the old names are no longer supported. [#103854](https://github.com/ClickHouse/ClickHouse/pull/103854) ([Pablo Marcos](https://github.com/pamarcos)).
* The setting `show_data_lake_catalogs_in_system_tables` has been renamed to `show_remote_databases_in_system_tables` and broadened: when its value is 0 (the default), `MySQL` and `PostgreSQL` databases are also hidden from `system.tables`, `system.columns`, and `system.completions`, in addition to data lake catalogs. The old setting name is kept as an alias. [#104416](https://github.com/ClickHouse/ClickHouse/pull/104416) ([Pablo Marcos](https://github.com/pamarcos)).
* The default x86 build now targets x86-64-v3 (AVX2) instead of x86-64-v2 (SSE4.2). This requires a CPU with AVX2 support (Intel Haswell or later, AMD Excavator or later). If your CPU does not support AVX2, use the `amd64compat` build which targets plain x86-64. [#105019](https://github.com/ClickHouse/ClickHouse/pull/105019) ([Raúl Marín](https://github.com/Algunenano)).
* Reject nested `Dynamic`/`Variant` in `min`/`max` aggregates and `minmax` indexes. Previously only top-level `Dynamic`/`Variant` were checked. Closes [#104747](https://github.com/ClickHouse/ClickHouse/issues/104747). [#105468](https://github.com/ClickHouse/ClickHouse/pull/105468) ([Pavel Kruglov](https://github.com/Avogar)).
* `icebergHash` and `icebergBucket` now reject `Int128`, `UInt128`, `Int256`, `UInt256`, and `Decimal256` arguments with an explicit error. Previously they silently truncated wider values and produced colliding hashes. The Iceberg spec only defines hashing for 32/64-bit integers and decimals with precision up to 38; cast to `Int64` or `Decimal128` to keep the previous behaviour for values that fit. [#105866](https://github.com/ClickHouse/ClickHouse/pull/105866) ([Raúl Marín](https://github.com/Algunenano)).
* Added granular control over query echoing in the CLI. The `--echo` option now accepts an optional boolean value and works in both interactive and batch mode. New options `--echo-formatted` and `--echo-query-id` control whether echoed queries are formatted and whether the `query_id` is printed, respectively. The `--hilite`/`--highlight` option now also controls highlighting of echoed queries. As a side effect, `--echo` is now a boolean-value option, so a positional query directly after a bare `--echo` is treated as its value; use `--echo --query "..."` or `--echo=false` instead. [#106191](https://github.com/ClickHouse/ClickHouse/pull/106191) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Removed the experimental KQL (Kusto) functions `array_sort_asc` and `array_sort_desc`, and their SQL backends `kql_array_sort_asc` and `kql_array_sort_desc`. These functions were experimental, implemented with low quality, and the source of correctness and parser bugs. Queries using these names now return `UNKNOWN_FUNCTION`. [#108101](https://github.com/ClickHouse/ClickHouse/pull/108101) ([Groene AI](https://github.com/groeneai)).
* `ALTER TABLE ... REPLACE PARTITION ... FROM ...` no longer silently drops the destination partition's data when the source table has no parts in the requested partition. Previously such a request removed the destination partition and wrote nothing in its place — a data-loss footgun. It is now rejected with `BAD_ARGUMENTS` by default. To restore the previous silent-clear behavior, set the new setting `allow_replace_partition_from_empty_source = 1`, or set `compatibility` to `26.5` or lower; to explicitly drop destination data, use `ALTER TABLE ... DROP PARTITION`. [#104939](https://github.com/ClickHouse/ClickHouse/pull/104939) ([Groene AI](https://github.com/groeneai)).
* The default of the server setting `insert_deduplication_version` changes from `compatible_double_hashes` to `new_unified_hash`. Insert deduplication now works on the whole inserted block (per insert) rather than per part/partition: a retry of the same insert is still deduplicated, but two different inserts that produce an identical part are no longer cross-deduplicated, and reordered inserts of the same rows are no longer deduplicated. Set `insert_deduplication_version = compatible_double_hashes` to restore the previous behavior. Instances upgrading directly from a release that defaulted to `old_separate_hashes` should first run with `compatible_double_hashes` until the longest relevant deduplication window has elapsed before relying on `new_unified_hash`. [#107886](https://github.com/ClickHouse/ClickHouse/pull/107886) ([Sema Checherinda](https://github.com/CheSema)).

<h4 id="266-new-feature">
  New Feature
</h4>

* Added support for continuous queries over `MergeTree` tables, implemented via a series of snapshot reads. This is a first step toward general support for streaming queries. [#105114](https://github.com/ClickHouse/ClickHouse/pull/105114) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Added hypothetical (what-if) skip indexes. Use `CREATE HYPOTHETICAL INDEX ... ON t (expr) TYPE ...` to define a session-scoped virtual skip index, then `EXPLAIN WHATIF SELECT ...` to estimate its skip ratio and cost without materializing it. Defined indexes are visible in the new `system.hypothetical_indexes` table. [#104608](https://github.com/ClickHouse/ClickHouse/pull/104608) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Add an embedded `/schema` web UI to `clickhouse-server` that visualizes the dependency graph between tables, materialized views, refreshable materialized views, dictionaries, distributed tables and views. [#105276](https://github.com/ClickHouse/ClickHouse/pull/105276) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Added the `PNG` output format support, allowing query output results to be directly rendered as PNG images. [#74691](https://github.com/ClickHouse/ClickHouse/pull/74691) ([Maksim Dergousov](https://github.com/m7kss1)).
* Added detection of the AI coding agent (Claude Code, Cursor, Codex, Gemini CLI, Goose, etc.) that invoked `clickhouse-client` or `clickhouse-local`, based on environment variables. The detected agent is reported in the new `client_agent` column of `system.query_log`, `system.query_thread_log` and `system.processes`. [#106619](https://github.com/ClickHouse/ClickHouse/pull/106619) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a new system table `system.documentation` that collects the embedded reference documentation of the uniform components of the system (functions, table engines, data types, settings, formats, and others) into a single table, with the documentation rendered as Markdown. [#107463](https://github.com/ClickHouse/ClickHouse/pull/107463) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add the `GeoJSON` input format for reading [GeoJSON](https://geojson.org/) `FeatureCollection` documents, producing one row per feature with `id` (`String`), `geometry` (`Geometry`), and `properties` (`Nullable(JSON)`) columns. `Point`, `LineString`, `MultiLineString`, `Polygon`, and `MultiPolygon` geometries are read into ClickHouse's native `Geometry` type. `GeometryCollection` and `MultiPoint`, which the `Geometry` type cannot represent, raise an exception by default, or can be stored as `NULL` via the `input_format_geojson_unsupported_geometry_handling` setting. Contributes to [#91533](https://github.com/ClickHouse/ClickHouse/issues/91533). [#98124](https://github.com/ClickHouse/ClickHouse/pull/98124) ([Mark Needham](https://github.com/mneedham)).
* Added functions for serving Mapbox Vector Tiles directly from SQL: `MVTEncodeGeom` projects a geometry into the pixel space of a slippy-map tile and clips it, `MVTEncode` aggregates the projected geometries of a group into the binary bytes of a single-layer tile, and `MVTBoundingBox` / `MVTBoundingBoxMercator` return the bounding box of a tile for restricting rows to it. Point, line and polygon geometry is supported. Also available under the PostGIS aliases `ST_AsMVTGeom` and `ST_AsMVT`. [#106107](https://github.com/ClickHouse/ClickHouse/pull/106107) ([Saarthak Gupta](https://github.com/saarthak2002)).
* `clickhouse-local` now supports `SYSTEM START LISTEN` and `SYSTEM STOP LISTEN` queries, allowing it to be transformed into a server accepting TCP and HTTP connections. [#101143](https://github.com/ClickHouse/ClickHouse/pull/101143) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added an interactive `help` command to `clickhouse-client` and `clickhouse-local`. Typing `help <name>` (also `/help`, `man`, `/man`) shows the documentation of a function, table engine, data type, format, setting, or other component, rendered from Markdown in the terminal with syntax-highlighted SQL. When the word is ambiguous all matches are shown, and when it is not found, similar names are suggested. [#108042](https://github.com/ClickHouse/ClickHouse/pull/108042) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support writing into Azure Data Lake Storage Gen2. [#105406](https://github.com/ClickHouse/ClickHouse/pull/105406) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Adding `RowBinaryWithNamesAndTypesAndDefaults` format to get better support for schema evolution. [#105736](https://github.com/ClickHouse/ClickHouse/pull/105736) ([Mark Zitnik](https://github.com/mzitnik)).
* Implement `ADD ENUM VALUES` in `ALTER TABLE` queries to simplify appending new values to an existing `Enum` type without the need to specify all current `Enum` values again. [#93830](https://github.com/ClickHouse/ClickHouse/pull/93830) ([Ilya Golshtein](https://github.com/ilejn)).
* Refreshable materialized view now supports `REFRESH DEPENDS ON` to trigger refreshes on another RMV's refreshes instead of time-based schedule. (`REFRESH EVERY ... DEPENDS ON` already existed, but couldn't be used reliably for this use case.) See `CREATE MATERIALIZED VIEW` documentation. [#104440](https://github.com/ClickHouse/ClickHouse/pull/104440) ([Michael Kolupaev](https://github.com/al13n321)).
* Add support for selecting columns by name pattern with `* LIKE '<pattern>'` and `* ILIKE '<pattern>'`, including qualified forms such as `table.* LIKE '<pattern>'` and `table.* ILIKE '<pattern>'`. `LIKE` matches column names case-sensitively, `ILIKE` case-insensitively. [#104569](https://github.com/ClickHouse/ClickHouse/pull/104569) ([Yue Ni](https://github.com/niyue)).
* Added `ESCAPE` syntax that defines a custom escape character in a `LIKE` pattern, allowing you to treat `%` and `_` as literal characters instead of wildcards. [#99774](https://github.com/ClickHouse/ClickHouse/pull/99774) ([Ilya Yatsishin](https://github.com/qoega)).
* Add `materialize_projections_on_insert` and `materialize_projections_on_merge` `MergeTree` table settings. When `materialize_projections_on_insert = 0`, `INSERT`s skip building projection parts, which improves insert throughput for tables with many projections. When `materialize_projections_on_merge = 1`, a merge rebuilds a projection that is missing from all of its source parts, so projections can be built during merges instead of on insert. Merges still combine only parts that share the same set of projections. [#100993](https://github.com/ClickHouse/ClickHouse/pull/100993) ([Christoph Wurm](https://github.com/cwurm)).
* Add a new immutable `MergeTree` setting `allow_tuple_element_aggregation`, disabled by default. When enabled, `SummingMergeTree`, `AggregatingMergeTree` and `CoalescingMergeTree` recursively flatten `Tuple` columns and aggregate each leaf element independently during merges, exactly as if it were a top-level column — `SummingMergeTree` sums it, `AggregatingMergeTree` merges its aggregate-function state, and `CoalescingMergeTree` keeps its last non-NULL value. The setting must be specified at table creation time and is silently ignored by engines that do not support it. [#98039](https://github.com/ClickHouse/ClickHouse/pull/98039) ([johnjing](https://github.com/JingYanchao)).
* New functions `quantizeBFloat16ToInt8` and `dequantizeInt8ToBFloat16`: a scalar codec that compresses embedding components to 8-bit using a 256-level Gaussian Lloyd-Max quantizer, from which Int4/Int2/binary codes can be extracted by bit-truncation. [#108102](https://github.com/ClickHouse/ClickHouse/pull/108102) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add functions `arrayTopK` and `arrayBottomK`: - `arrayTopK(k, array)` returns the K largest elements in descending order - `arrayBottomK(k, array)` returns the K smallest elements in ascending order. [#104563](https://github.com/ClickHouse/ClickHouse/pull/104563) ([Vitaly Baranov](https://github.com/vitlibar)).
* Added a new system table `system.iceberg_files` exposing per-file metadata for `Iceberg` tables, with one row per data or delete file in each table's current snapshot. This closes [#98777](https://github.com/ClickHouse/ClickHouse/issues/98777). [#104415](https://github.com/ClickHouse/ClickHouse/pull/104415) ([Asya Shneerson](https://github.com/asya-ch)).
* Added `system.constraints` table that provides information about all `CHECK` and `ASSUME` constraints across all tables, including constraint name, type, and expression. [#105337](https://github.com/ClickHouse/ClickHouse/pull/105337) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Added a new `system.dictionary_layouts` table that lists the available dictionary layouts together with embedded documentation (`description`, `syntax`, `examples`, `introduced_in`, `related`). [#106182](https://github.com/ClickHouse/ClickHouse/pull/106182) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a new `system.dictionary_sources` table that lists the available dictionary sources together with embedded documentation (`description`, `syntax`, `examples`, `introduced_in`, `related`). [#106184](https://github.com/ClickHouse/ClickHouse/pull/106184) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a new `system.data_skipping_index_types` table that lists the available data skipping index types together with embedded documentation (`description`, `syntax`, `examples`, `introduced_in`, `related`). [#106186](https://github.com/ClickHouse/ClickHouse/pull/106186) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a new `system.disk_types` table that lists the available disk types together with embedded documentation (`description`, `syntax`, `examples`, `introduced_in`, `related`). [#106187](https://github.com/ClickHouse/ClickHouse/pull/106187) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Implemented `SYSTEM RESTART DISK <name>`: it now reloads a disk's in-memory metadata and re-scans the data parts of readonly-replica tables located on it. This lets a readonly replica of a table on shared `plain_rewritable` storage observe data written by another server on demand, without waiting for `refresh_parts_interval` or restarting the server. [#106645](https://github.com/ClickHouse/ClickHouse/pull/106645) ([Jordi Villar](https://github.com/jrdi)).
* PostgreSQL-style `expr OP SOME(array)` / `expr OP ALL(array)` (non-subquery right-hand side) is now supported and rewritten to `has` / `NOT has` for `=`/`<>`, or to `arrayExists` / `arrayAll` lambdas for other comparison operators. `ANY` is not accepted for the array form because `any` is also an aggregate function; use `SOME` instead. The subquery form of `ANY`/`SOME`/`ALL` continues to be lowered to `IN` / `NOT IN`. [#105129](https://github.com/ClickHouse/ClickHouse/pull/105129) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added two new `load_balancing` strategies, `hostname_longest_common_prefix` and `hostname_longest_common_suffix`, which prefer the replica whose hostname shares the longest common prefix (respectively, suffix) with the initiator's hostname. They are useful when the data center is encoded as a prefix or suffix of hostnames whose numeric segments have variable length, where the existing `nearest_hostname` and `hostname_levenshtein_distance` strategies pick the wrong replica. [#107360](https://github.com/ClickHouse/ClickHouse/pull/107360) ([Denny \[DBA at Innervate\]](https://github.com/den-crane)).
* Added TLS client certificate information (subjects, serial number, issuer, and validity period) to the `system.session_log` table to improve observability of certificate-based authentication. [#107679](https://github.com/ClickHouse/ClickHouse/pull/107679) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add an optional `external_id` credential for `S3` role-based access. [#106941](https://github.com/ClickHouse/ClickHouse/pull/106941) ([Elian Gidoni](https://github.com/eliangidoni)).
* Added a new `S3Queue` setting `after_processing_move_preserve_path`. When enabled together with `after_processing='move'` and `after_processing_move_prefix`, processed objects are moved while preserving their full source path under the destination prefix instead of being flattened to just the file name. [#105354](https://github.com/ClickHouse/ClickHouse/pull/105354) ([Asya Shneerson](https://github.com/asya-ch)).
* Add `message_queue_disable_insertion` server setting to disable insertion from message queue engines (`Kafka`, `RabbitMQ`, `NATS`) into attached materialized views. Useful for read-only replica scenarios. [#104911](https://github.com/ClickHouse/ClickHouse/pull/104911) ([JIaQi Tang](https://github.com/JiaQiTang98)).
* Added `LOCALTIME` and `LOCALTIMESTAMP` (SQL-standard / PostgreSQL syntax). `LOCALTIMESTAMP` is an alias for `now()` (returns `DateTime`); `LOCALTIME` returns the current time of day as a `Time` value. [#106139](https://github.com/ClickHouse/ClickHouse/pull/106139) ([Thomas Cabral](https://github.com/thomas-cabral)).
* Added `date_part('unit', expr)` as syntactic sugar for `EXTRACT(unit FROM expr)`. Standard interval kinds and the PostgreSQL extras (`epoch`, `dow`, `doy`, `isodow`, `isoyear`, `century`, `decade`, `millennium`) are all supported. [#105127](https://github.com/ClickHouse/ClickHouse/pull/105127) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* PostgreSQL-compatible `EXTRACT(TIMEZONE_HOUR FROM dt)` and `EXTRACT(TIMEZONE_MINUTE FROM dt)` for the hour and minute parts of a timezone offset, and `EXTRACT(<unit> FROM INTERVAL n <unit>)` / `date_part('<unit>', INTERVAL n <unit>)` for extracting the value out of an interval. [#106227](https://github.com/ClickHouse/ClickHouse/pull/106227) ([Vinayak Joshi](https://github.com/vinayakj592)).
* Added `min_by` and `max_by` aggregate aliases for `argMin` and `argMax`. [#105712](https://github.com/ClickHouse/ClickHouse/pull/105712) ([Joey Yu](https://github.com/itsjoeoui)). These aliases are stupid, real engineers use the original ClickHouse names.
* Added `REGEXP_SUBSTR` as a case-insensitive alias of `regexpExtract` for Oracle/MySQL/Snowflake compatibility. [#105122](https://github.com/ClickHouse/ClickHouse/pull/105122) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `SESSION_USER` as a case-insensitive alias of `currentUser()` for PostgreSQL / SQL-standard compatibility. [#106081](https://github.com/ClickHouse/ClickHouse/pull/106081) ([Takumi Hara](https://github.com/takumihara)).
* Support a trailing `NULL` / `NOT NULL` modifier in `ALTER TABLE ... ADD/MODIFY COLUMN`, mirroring `CREATE TABLE`. [#106150](https://github.com/ClickHouse/ClickHouse/pull/106150) ([Takumi Hara](https://github.com/takumihara)).
* You can now use `h3PolygonToCellsWithContainment` function from h3 to use their new algorithm which supports center-based, fully-contained, and overlapping containment modes. [#104455](https://github.com/ClickHouse/ClickHouse/pull/104455) ([Youssef Kadry](https://github.com/yousefQadry)).
* Adds `IPV4_PREFIX_BITS and IPV6_PREFIX_BITS` flags when Keying done by `IP_ADDRESS` or `FORWARDED_IP_ADDRESS`. [#89270](https://github.com/ClickHouse/ClickHouse/pull/89270) ([Aditya Chopra](https://github.com/adityachopra29)).
* `formatReadableTimeDelta` now accepts an `INTERVAL` expression of type other than `Month` and `Year` as input. [#64315](https://github.com/ClickHouse/ClickHouse/pull/64315) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)).
* User can now specify an optional precision argument to the `formatReadableSize`, `formatReadableDecimalSize` and `formatReadableQuantity` functions, controlling the number of digits after the decimal point. Default is 2, preserving the prior behavior. [#104648](https://github.com/ClickHouse/ClickHouse/pull/104648) ([Antonio Filipovic](https://github.com/antoniofilipovic)).
* Add `output_format_float_precision` setting to control the number of decimal digits in floating-point text output. [#99721](https://github.com/ClickHouse/ClickHouse/pull/99721) ([phulv94](https://github.com/phulv94)).
* Added a setting `output_format_always_write_decimal_point_in_float_and_decimal` to always print a decimal point for floating-point and `Decimal` numbers in text formats, even when the value is a whole number. For example, output `1.` instead of `1`. Disabled by default. [#62614](https://github.com/ClickHouse/ClickHouse/pull/62614) ([Ilya Yatsishin](https://github.com/qoega)).
* Add support for new HTTP handler configuration elements `<url_prefix>` and `<full_url_prefix>` (match all paths under a base path, useful e.g. for Prometheus handlers), as well as `<url_regexp>`, `<full_url_regexp>`, and `<headers_regexp>`. The old `<url>regex:...</url>` form is now obsolete. [#107492](https://github.com/ClickHouse/ClickHouse/pull/107492) ([Vitaly Baranov](https://github.com/vitlibar)).
* Support `basic` statistics, a compact per-column statistic that stores numeric min/max, average string length, and NULL counts where applicable. [#106048](https://github.com/ClickHouse/ClickHouse/pull/106048) ([Han Fei](https://github.com/hanfei1991)).
* Support TTL nodes in ClickHouse Keeper, opt-in via the `create_ttl` feature flag. [#100397](https://github.com/ClickHouse/ClickHouse/pull/100397) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Introduce a memory reservation feature for workloads. See the [workload scheduling](https://clickhouse.com/docs/operations/workload-scheduling) documentation. [#82414](https://github.com/ClickHouse/ClickHouse/pull/82414) ([Sergei Trifonov](https://github.com/serxa)).

<h4 id="266-experimental-feature">
  Experimental Feature
</h4>

* Multi-stage distributed query execution: the planner splits the query plan into stages connected by scatter / broadcast / gather / shuffle exchanges and dispatches the plan fragments to worker nodes. The data between stages is streamed via TCP or passed via temporary files in shared object storage, the path supports distributed shuffle and broadcast hash joins, shuffle aggregation, and distributed sort. The feature is experimental and is disabled by default. [#106020](https://github.com/ClickHouse/ClickHouse/pull/106020) ([Alexander Gololobov](https://github.com/davenger)). The experimental distributed query plan engine (`make_distributed_plan`) can now use a different task-dispatch and streaming-exchange port per worker, configured per replica in `<remote_servers>` with `stateless_worker_port` and `streaming_exchange_port`. When unset, the previous server-level ports (`stateless_worker_client.port` and `distributed_query.streaming_exchange_port`) are used. This makes it possible to run several workers on one host. [#107885](https://github.com/ClickHouse/ClickHouse/pull/107885) ([Alexander Gololobov](https://github.com/davenger)).
* Added the experimental `dphyp` join reordering algorithm for inner joins as an option for the `query_plan_optimize_join_order_algorithm` setting, and the `query_plan_optimize_join_order_max_searched_plans` setting, which bounds the join-order search and falls back to the next algorithm in the chain when the bound is exceeded; set it to `0` to keep the previous unbounded search behavior. [#98798](https://github.com/ClickHouse/ClickHouse/pull/98798) ([Alexander Gololobov](https://github.com/davenger)).
* Add `aiEmbed` function for using LLM APIs to generate embeddings from within ClickHouse. [#102922](https://github.com/ClickHouse/ClickHouse/pull/102922) ([George Larionov](https://github.com/george-larionov)).
* Added an experimental Linux OOM canary: a sacrificial child process that the Linux OOM killer targets before the main server process. When enabled with `oom_canary_enable`, it sheds memory pressure by purging allocator caches, cancelling queries, cancelling merges, and recording an event in `system.crash_log`. The OOM response requires cgroup v2 `memory.events` OOM-kill evidence. [#101942](https://github.com/ClickHouse/ClickHouse/pull/101942) ([Peng](https://github.com/fastio)).
* The web terminal interface at `/webterminal` is now a production feature and is enabled by default. It is controlled by the new `enable_webterminal` server setting; the former `allow_experimental_webterminal` setting is deprecated but still honored for backward compatibility. To disable the endpoint, set `enable_webterminal` to `false`. [#106255](https://github.com/ClickHouse/ClickHouse/pull/106255) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* PromQL HTTP endpoints now support specifying the database and table via URL query parameters (`database=`, `table=`, or `table=db.table`). The previous implicit `default.prometheus` table fallback is removed: if neither the handler config nor the URL specifies a table, the handler now returns `The time series table name is not set`. To keep the old behavior, configure `<table>default.prometheus</table>` or pass `table=...` in the URL. [#107553](https://github.com/ClickHouse/ClickHouse/pull/107553) ([Vitaly Baranov](https://github.com/vitlibar)).
* Added support for the PromQL `histogram_quantile` function in `prometheusQuery` and `prometheusQueryRange` table functions. This enables computing quantiles over classic Prometheus histogram buckets identified by the `le` label. [#103477](https://github.com/ClickHouse/ClickHouse/pull/103477) ([Joe Smith](https://github.com/Yasumoto)).
* Added lazy posting list apply mode for the text index. When enabled via `SET allow_experimental_text_index_lazy_apply = 1` and `SET text_index_posting_list_apply_mode = 'lazy'`, posting lists are decoded on demand at packed-block granularity using a cursor-based approach instead of being fully materialized into Roaring Bitmaps, reducing memory usage and CPU time for selective text index queries. [#100035](https://github.com/ClickHouse/ClickHouse/pull/100035) ([Peng](https://github.com/fastio)).
* Added support for the [AssemblyScript](https://www.assemblyscript.org) ABI for WebAssembly UDFs. You can try the AssemblyScript ABI without installing the toolchain locally by using the browser-based [playground](https://pastila.nl/?0009878e/b9768c4e2144d0c2f3dd512e7a1aaf69.html), which compiles AssemblyScript code and loads the resulting WebAssembly module into local ClickHouse. [#104606](https://github.com/ClickHouse/ClickHouse/pull/104606) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Allow for attaching Prometheus handlers on the main HTTP port with an optional prefix. [#104975](https://github.com/ClickHouse/ClickHouse/pull/104975) ([James Cunningham](https://github.com/JTCunning)).
* Added an experimental `MergeTree` setting `packed_skip_index_max_bytes` that bundles small skip-index substreams into a single `skp_idx.packed` archive per part, reducing inode pressure when many skip indices are defined on a table. The decision is per substream at write time: substreams whose serialized size stays under the threshold go into the archive, anything larger keeps the standalone `skp_idx_<name>.idx2` / `.mrk2` layout. A single part can mix layouts. Full-text indices are not supported and are always per-file. Default is 0 (packing disabled). [#105321](https://github.com/ClickHouse/ClickHouse/pull/105321) ([Raúl Marín](https://github.com/Algunenano)).
* Support `Buffers` serialization for WebAssembly UDFs using `ABI BUFFERED_V1`, and add `webassembly_udf_enable_fuel` as a persisted WASM UDF function setting. [#105574](https://github.com/ClickHouse/ClickHouse/pull/105574) ([Antonio Andelic](https://github.com/antonio2368)).
* Add an experimental `use_reader_executor` setting (default off) that routes reads through a new pipeline-based `ReaderExecutor` instead of the legacy chain of read buffers. [#106570](https://github.com/ClickHouse/ClickHouse/pull/106570) ([Sema Checherinda](https://github.com/CheSema)). Added observability metrics for the experimental `use_reader_executor` read path, including a modeled read-cost KPI (`ReaderExecutorModeledCostMsPerRequestedMiB`). [#106968](https://github.com/ClickHouse/ClickHouse/pull/106968) ([Sema Checherinda](https://github.com/CheSema)). Introduced the `ChainedBuffers` buffer behind the experimental `use_reader_executor` read path, with a `ReaderExecutorChainedBufferBytes` metric. [#107210](https://github.com/ClickHouse/ClickHouse/pull/107210) ([Sema Checherinda](https://github.com/CheSema)).
* Descending sort order in `MergeTree` sorting keys (e.g. `ORDER BY (time DESC, key)`) is now always supported and no longer requires the experimental setting `allow_experimental_reverse_key`, which became obsolete. [#106440](https://github.com/ClickHouse/ClickHouse/pull/106440) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* `Nullable(Tuple(...))` is now Beta. Disabled by default, set `enable_nullable_tuple_type = 1` to use it. [#107754](https://github.com/ClickHouse/ClickHouse/pull/107754) ([Nihal Z. Miaji](https://github.com/nihalzp)).

<h4 id="266-performance-improvement">
  Performance Improvement
</h4>

* Various changes to Keeper that make it around 2x faster overall (better batching, pipelining messages to leader, pipelining log appends). [#101757](https://github.com/ClickHouse/ClickHouse/pull/101757) ([Michael Kolupaev](https://github.com/al13n321)).
* Reduce per-query overhead for simple `SELECT` queries (parsing, analysis and planning). For example, `SELECT count() FROM hits` from a single connection is roughly 50% faster. [#104513](https://github.com/ClickHouse/ClickHouse/pull/104513) ([Raúl Marín](https://github.com/Algunenano)).
* Optimize primary key index analysis for long and high-cardinality primary keys. For a long primary key, the run time of index analysis now mainly depends on the complexity of the query's filter (the key columns it actually uses), not on the length of the primary key — so extending the sorting key has negligible extra overhead on index analysis for queries that filter on only a few of its columns. For a high-cardinality primary key, where ClickHouse keeps only a selective prefix of the key columns in memory and does not load the trailing ones, index analysis now works on just that in-memory prefix instead of the whole key. The optimization is enabled by default and can be turned off with the new setting `use_lightweight_primary_key_index_analysis`. Closes [#65103](https://github.com/ClickHouse/ClickHouse/issues/65103). [#91836](https://github.com/ClickHouse/ClickHouse/pull/91836) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* The default x86 build now targets x86-64-v3 (AVX2) instead of x86-64-v2 (SSE4.2). This requires a CPU with AVX2 support (Intel Haswell or later, AMD Excavator or later). If your CPU does not support AVX2, use the `amd64compat` build which targets plain x86-64. [#105019](https://github.com/ClickHouse/ClickHouse/pull/105019) ([Raúl Marín](https://github.com/Algunenano)).
* Use `ipnsort` and `driftsort` (stable sorting) — C++ ports of the Rust standard library's sort implementations — for the general-purpose comparison sorts. Speeds up `ORDER BY` on non-numeric columns and stable sorts, and removes a worst case on reverse-sorted input. [#106650](https://github.com/ClickHouse/ClickHouse/pull/106650) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* New `GROUP BY` optimization for high cardinality evenly distributed keys that scatters rows across threads by hashing the grouping key, so each thread aggregates a disjoint subset of keys without a merge phase. Set `enable_sharding_aggregator = 1` to enable it. [#104233](https://github.com/ClickHouse/ClickHouse/pull/104233) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Enable hash table prefetching for string key `GROUP BY` queries, improving high-cardinality string aggregation performance by \~8%. [#101007](https://github.com/ClickHouse/ClickHouse/pull/101007) ([Le Zhang](https://github.com/damahua)).
* Reduced peak memory usage when merging partial two-level aggregation results with large aggregate states (e.g. `groupArray`), by freeing each bucket's source states incrementally during the merge instead of keeping them all alive until the merge completes. [#102330](https://github.com/ClickHouse/ClickHouse/pull/102330) ([Yuri Fedoseev](https://github.com/yurifedoseev)).
* Memory representation of `Enum` `DataType` was optimized. Memory footprint of tables that have `Enum` type in it can improve up to 10x times for `Enum` component. Operation time to retrieve name by value(number) is similar or faster. Search by name is slightly slower, but this access direction is less common. [#95668](https://github.com/ClickHouse/ClickHouse/pull/95668) ([Ilya Yatsishin](https://github.com/qoega)).
* Add identifier resolution caching to prevent duplicate identifier resolution during query analysis. [#88043](https://github.com/ClickHouse/ClickHouse/pull/88043) ([Max Justus Spransy](https://github.com/maxjustus)).
* Improve performance of query analysis for queries over tables with many columns: avoid computing column node hashes (which include the whole source table expression) when not needed. Analyzing nested `SELECT *` subqueries over a table with \~1200 columns is now about 50 times faster. [#106957](https://github.com/ClickHouse/ClickHouse/pull/106957) ([Dmitry Novik](https://github.com/novikd)).
* Sped up query analysis for queries with many or deeply nested function calls by removing a redundant query-tree hash from the function resolution cache. [#107516](https://github.com/ClickHouse/ClickHouse/pull/107516) ([Dmitry Novik](https://github.com/novikd)).
* Fixed long login and query-startup stalls with replicated access storage when many access entities (row policies, roles, quotas, settings profiles) change at once. Each per-entity cache now recomputes once per notification batch instead of once per changed entity, removing quadratic work that could hold the access lock for minutes. [#107672](https://github.com/ClickHouse/ClickHouse/pull/107672) ([Azat Khuzhin](https://github.com/azat)).
* Share the hash join's `FixedHashMap` as the join runtime filter on the probe side. When the build-side hash table is (or can be converted to) a `FixedHashMap`, it is published as the runtime filter and replaces the `Set`/`BloomFilter` that `BuildRuntimeFilterStep` would otherwise install. Controlled by the new setting `join_runtime_filter_from_fixed_hash_table` (default `true`). [#105640](https://github.com/ClickHouse/ClickHouse/pull/105640) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Lazy application of selector and replication indexes in case of `JOIN` followed by a selective `LIMIT` or `TopN` or another `JOIN`. To control the number of payload columns for enabling lazy selector indexes use the setting `query_plan_min_columns_for_join_lazy_indexing` (0 means the optimization is disabled). To control the `LIMIT` for which the optimization is applied use the setting `query_plan_max_limit_for_join_lazy_indexing`. [#106566](https://github.com/ClickHouse/ClickHouse/pull/106566) ([Hechem Selmi](https://github.com/m-selmi)).
* DP (dynamic programming) JOIN reordering is now allowed with parallel replicas. [#105889](https://github.com/ClickHouse/ClickHouse/pull/105889) ([Nikita Taranov](https://github.com/nickitat)).
* Improved query plan when JOIN uses runtime filters (default-on `enable_join_runtime_filters`): the join-reorder cost model now sees through `WindowTransform` (and other row-preserving plan steps) on the right subtree and uses the underlying row count and per-column NDV instead of falling back to no statistics. [#107229](https://github.com/ClickHouse/ClickHouse/pull/107229) ([UnamedRus](https://github.com/UnamedRus)).
* De-virtualize the emission of non-joined rows in RIGHT and FULL join by batching them. [#105679](https://github.com/ClickHouse/ClickHouse/pull/105679) ([Hechem Selmi](https://github.com/m-selmi)).
* Support packed `keys32` and `keys64` methods in `HashJoin`. [#107202](https://github.com/ClickHouse/ClickHouse/pull/107202) ([Nikita Taranov](https://github.com/nickitat)).
* Support packed `keys32` and `keys64` methods in `Set`. [#107564](https://github.com/ClickHouse/ClickHouse/pull/107564) ([Nikita Taranov](https://github.com/nickitat)).
* More optimal handling of nullable columns in aggregation. [#106015](https://github.com/ClickHouse/ClickHouse/pull/106015) ([Nikita Taranov](https://github.com/nickitat)).
* Improve performance of `LIMIT BY` queries. [#103349](https://github.com/ClickHouse/ClickHouse/pull/103349) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Speed up `ORDER BY ... LIMIT BY` queries by running `LIMIT BY` inside each parallel sorted stream during `Sort` when `LIMIT BY`'s columns are a prefix of the `ORDER BY`. This reduces the number of rows flowing through the final sort merge and any downstream pipeline steps. This optimization is controlled by the new setting `query_plan_push_limit_by_into_sort` (enabled by default). [#104000](https://github.com/ClickHouse/ClickHouse/pull/104000) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Speed up `SELECT ... LIMIT N BY <cols>` queries when `<cols>` are a prefix of the table's sorting key, or become one after `WHERE col = const` fixes leading columns. With this enabled the `MergeTree` reads data in primary-key order and `LIMIT BY` first filters in streaming mode with O(1) memory per sorted stream which filters out most of the data, then finally running normal `LIMIT BY` on reduced data to get the final result. Controlled by the new setting `optimize_limit_by_in_order` (enabled by default). [#105135](https://github.com/ClickHouse/ClickHouse/pull/105135) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Speed up `LIMIT BY` queries on partitioned `MergeTree` tables by running `LIMIT BY` inside each partition's stream in parallel, instead of merging all streams into one before applying the limit. This applies when the partition expression is a deterministic function of the `LIMIT BY` columns, so no `LIMIT BY` group can span two partitions. Controlled by the new setting `allow_limit_by_partitions_independently` (enabled by default). [#105126](https://github.com/ClickHouse/ClickHouse/pull/105126) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Speed up `LIMIT BY` queries by removing redundant key expressions: a key that is a deterministic function of the other keys is dropped (e.g. `LIMIT 5 BY x, f(x)` becomes `LIMIT 5 BY x`), and an injective function of a key is replaced by its argument (e.g. `LIMIT 5 BY toString(x)` becomes `LIMIT 5 BY x`). This evaluates fewer and cheaper expressions per row. Controlled by the new settings `optimize_limit_by_function_keys` and `optimize_injective_functions_in_limit_by`, both enabled by default. [#106818](https://github.com/ClickHouse/ClickHouse/pull/106818) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Speed up sharded aggregation, `grace_hash` join bucketing, and parallel window partitioning by replacing per-chunk column hashing with a kernel that uses hardware CRC32C. [#106538](https://github.com/ClickHouse/ClickHouse/pull/106538) ([Harikrishnan Prabakaran](https://github.com/harikrishnan94)).
* Optimize `L1Distance`, `L2Distance`, `L2SquaredDistance`, `LinfDistance`, and `cosineDistance` for array arguments with multi-target auto-vectorization on x86-64-v4/v3. For non-const array arguments, all of these except `LpDistance`, which uses `std::pow` with a runtime exponent, can now use compiler-vectorized kernels. The existing AVX-512 and Sapphire Rapids `BFloat16` const-argument fast paths for `L2Distance` and `cosineDistance` are preserved. [#101310](https://github.com/ClickHouse/ClickHouse/pull/101310) ([Peng](https://github.com/fastio)).
* Improved performance of the `{Norm}Distance` and `dotProduct` functions. [#106007](https://github.com/ClickHouse/ClickHouse/pull/106007) ([Nikita Taranov](https://github.com/nickitat)).
* Improved performance of the `arrayNorm` function. [#106211](https://github.com/ClickHouse/ClickHouse/pull/106211) ([Nikita Taranov](https://github.com/nickitat)).
* The performance of `dotProduct` improved in some cases. [#106210](https://github.com/ClickHouse/ClickHouse/pull/106210) ([Nikita Taranov](https://github.com/nickitat)).
* Improved performance of the AVX-512 const-left paths for `L2Distance` and `cosineDistance` on `Array(Float32)`, `Array(Float64)`, and `Array(BFloat16)` when the array length is exactly divisible by the vectorized processing width. [#104625](https://github.com/ClickHouse/ClickHouse/pull/104625) ([Sergey Kuznetsov](https://github.com/skuznetsov)).
* Enabled AVX-512 codegen for amd and better codegen for `arrayDistance`. [#106505](https://github.com/ClickHouse/ClickHouse/pull/106505) ([Nikita Taranov](https://github.com/nickitat)).
* Improved performance of the `L2DistanceTransposed` and `cosineDistanceTransposed` functions for the `QBit` data type. [#106701](https://github.com/ClickHouse/ClickHouse/pull/106701) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Improve performance of the `encrypt`, `decrypt`, `tryDecrypt`, `aes_encrypt_mysql`, and `aes_decrypt_mysql` functions by up to an order of magnitude, recovering the performance lost in the BoringSSL to OpenSSL 3.x migration (24.4). [#107339](https://github.com/ClickHouse/ClickHouse/pull/107339) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Improve performance of the `encrypt`, `decrypt`, and `halfMD5` functions by avoiding implicit per-row OpenSSL provider lookups in OpenSSL 3.x. [#99105](https://github.com/ClickHouse/ClickHouse/pull/99105) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Add SIMD implementation of `SHA1` that hashes multiple inputs in parallel using AVX-512, improving throughput. [#105459](https://github.com/ClickHouse/ClickHouse/pull/105459) ([Joanna Hulboj](https://github.com/jh0x)).
* Added an AArch64 ASIMD/NEON backend for the multi-buffer `MD5` implementation. [#105563](https://github.com/ClickHouse/ClickHouse/pull/105563) ([Venkata  Vineel ](https://github.com/vyalamar)).
* Squash source blocks before calculating projection during `MATERIALIZE PROJECTION` to reduce the number of temporary projection parts and merge overhead. \~3.4x speedup on a 50M-row table. [#100047](https://github.com/ClickHouse/ClickHouse/pull/100047) ([Amos Bird](https://github.com/amosbird)).
* Reduced `INSERT` latency for `MergeTree` tables with skip indices on `ORDER BY` columns by avoiding redundant column permutations during part writing (\~17% on traces-shaped workloads). [#101101](https://github.com/ClickHouse/ClickHouse/pull/101101) ([Amos Bird](https://github.com/amosbird)).
* Enabled Arrow's SIMD code paths (NEON on ARM, SSE4.2/AVX2/AVX512 on x86) and used them to speed up decoding of `BYTE_STREAM_SPLIT`-encoded Parquet `FLOAT`/`DOUBLE` columns. [#106376](https://github.com/ClickHouse/ClickHouse/pull/106376) ([Raúl Marín](https://github.com/Algunenano)).
* Improved insertion performance for `LowCardinality` columns with `bloom_filter` indexes. [#106410](https://github.com/ClickHouse/ClickHouse/pull/106410) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Parallelize blob copies in `DiskObjectStorageTransaction::copyFile` using a per-disk thread pool. [#105089](https://github.com/ClickHouse/ClickHouse/pull/105089) ([Asya Shneerson](https://github.com/asya-ch)).
* Avoid reading file contents when using the `One` input format with file-like table functions such as `file` and `s3`. [#105157](https://github.com/ClickHouse/ClickHouse/pull/105157) ([Yue Ni](https://github.com/niyue)).
* Speed up `clickhouse` startup on macOS by about 3x by not exporting dynamic symbols, which the dynamic linker would otherwise process on every launch. [#107768](https://github.com/ClickHouse/ClickHouse/pull/107768) ([Raúl Marín](https://github.com/Algunenano)).
* Speed up filesystem cache loading on startup by avoiding a redundant directory open per cache key. [#107414](https://github.com/ClickHouse/ClickHouse/pull/107414) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Speed up filesystem cache loading on startup by letting directory-listing threads help load cache metadata once listing is finished, instead of leaving half the threads idle. [#107416](https://github.com/ClickHouse/ClickHouse/pull/107416) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduced `clickhouse` process startup overhead by updating the bundled WasmEdge library, which no longer generates a random hash secret in a global initializer at every startup. [#107869](https://github.com/ClickHouse/ClickHouse/pull/107869) ([Raúl Marín](https://github.com/Algunenano)).
* The `MergeTree` primary key and skip indexes can now prune granules for filters where `ifNull` or `coalesce` wraps a condition, such as `ifNull(key = 0, 0)` or `coalesce(key = 0, 0)`. Such predicates — often emitted by query generators to turn a possibly-`NULL` comparison into a definite boolean — were previously opaque to index analysis and could not skip granules. This extends the existing `allow_key_condition_coalesce_rewrite` setting (enabled by default). Closes [#106264](https://github.com/ClickHouse/ClickHouse/issues/106264). [#106272](https://github.com/ClickHouse/ClickHouse/pull/106272) ([Andy Zhao](https://github.com/andyzzhao)).
* Skip index evaluation on `DateTime64` types should consume lesser CPU in 26.6. [#107707](https://github.com/ClickHouse/ClickHouse/pull/107707) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Improved performance of text index analysis in multi-token searches by optimizing handling of rare tokens. [#98226](https://github.com/ClickHouse/ClickHouse/pull/98226) ([Anton Popov](https://github.com/CurtizJ)).
* Use a cache for the posting-list compressed segments of the text index. [#106299](https://github.com/ClickHouse/ClickHouse/pull/106299) ([Anton Popov](https://github.com/CurtizJ)).
* Improved the performance of generic exclusion search for queries that select large consecutive ranges of the table. [#93813](https://github.com/ClickHouse/ClickHouse/pull/93813) ([Michael Jarrett](https://github.com/EmeraldShift)).
* `S3` clients with the same endpoint and bucket share a cache, avoiding duplicate region discovery. Closes [#92482](https://github.com/ClickHouse/ClickHouse/issues/92482). [#96802](https://github.com/ClickHouse/ClickHouse/pull/96802) ([Andrey Zvonov](https://github.com/zvonand)).
* If a query contains a `has(<constant array>, <expr>)`, the analyzer will transform the node to use a faster `in` implementation if it is feasible to do so. [#97341](https://github.com/ClickHouse/ClickHouse/pull/97341) ([Shankar Iyer](https://github.com/shankar-iyer)).
* When a new job is scheduled in `ThreadPool`, wake the most recently idle worker thread (LIFO) instead of an arbitrary one. This reduces memory fragmentation from per-thread allocator caches. The order in which jobs are processed is not changed. [#100177](https://github.com/ClickHouse/ClickHouse/pull/100177) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improved performance of approximate runtime filters and bloom filter indexes. [#100201](https://github.com/ClickHouse/ClickHouse/pull/100201) ([Christoph Viebig](https://github.com/cv4g)).
* Allow `ASOF JOIN` to use the `parallel_hash` join algorithm, parallelizing the build across distinct equality-key values. Previously `ASOF` was unconditionally opted out of `parallel_hash`. [#105375](https://github.com/ClickHouse/ClickHouse/pull/105375) ([Greg Maher](https://github.com/gregakinman)).
* Avoid reading unbounded inputs for `INTERSECT` and `EXCEPT` queries when an empty input makes the result known to be empty. [#105393](https://github.com/ClickHouse/ClickHouse/pull/105393) ([Yue Ni](https://github.com/niyue)).
* Add `constinit` for various `MemoryTracker` blockers. [#105490](https://github.com/ClickHouse/ClickHouse/pull/105490) ([Azat Khuzhin](https://github.com/azat)).
* Improve performance of `bitmapContains` for non-`UInt64` `groupBitmap` states by avoiding repeated `rb_max` calls during range checks. [#105960](https://github.com/ClickHouse/ClickHouse/pull/105960) ([Yue Ni](https://github.com/niyue)).
* Faster discontinuous queries for `LowCardinality` columns backed by a single dictionary. [#103662](https://github.com/ClickHouse/ClickHouse/pull/103662) ([Ivan Babrou](https://github.com/bobrik)).
* Added a fast path for the `HashJoin` probe when the block has a single row. [#106008](https://github.com/ClickHouse/ClickHouse/pull/106008) ([Nikita Taranov](https://github.com/nickitat)).
* Predicates from queries like `SELECT ... FROM view(SELECT ... FROM remote(...)) WHERE ... ` are now pushed into the query sent to the remote shard. The optimization `allow_push_predicate_ast_for_distributed_subqueries` lacked a case for table functions. [#105986](https://github.com/ClickHouse/ClickHouse/pull/105986) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Turn on `enable_join_transitive_predicates` by default. [#103724](https://github.com/ClickHouse/ClickHouse/pull/103724) ([Alexander Gololobov](https://github.com/davenger)).
* Added support for functions `multiSearchAny`, `multiSearchAnyUTF8`, and `multiMatchAny` in text indexes. Also improved text index analysis for the function `match`: now patterns with alternative groups can skip more granules. [#106279](https://github.com/ClickHouse/ClickHouse/pull/106279) ([Anton Popov](https://github.com/CurtizJ)).
* Allow filters introduced after the initial PREWHERE selection (predicate pushdown, runtime filters, or explicit PREWHERE plus a WHERE set by the planner) to be merged into the existing PREWHERE on a second optimizer pass instead of staying as a separate Filter step above the `MergeTree` read. [#105445](https://github.com/ClickHouse/ClickHouse/pull/105445) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* The `QueryConditionCache` now records individually filtered-out granules even within read batches that partially pass PREWHERE, reducing the number of marks re-read by subsequent queries with the same condition. [#105335](https://github.com/ClickHouse/ClickHouse/pull/105335) ([Han Fei](https://github.com/hanfei1991)).
* Added Keeper setting `nuraft_use_bg_thread_for_snapshot_io`, enabled by default, to make `NuRaft` read snapshot objects from a background thread instead of Raft worker threads. [#106285](https://github.com/ClickHouse/ClickHouse/pull/106285) ([Antonio Andelic](https://github.com/antonio2368)).
* Reduce peak memory usage when applying received snapshots in ClickHouse Keeper with `KeeperMemoryStorage`. [#105851](https://github.com/ClickHouse/ClickHouse/pull/105851) ([Antonio Andelic](https://github.com/antonio2368)).
* Route LLVM/JIT allocations to a dedicated jemalloc arena. Reduces RSS fragmentation caused by interleaving long-lived JIT bookkeeping with short-lived query allocations. Adds new asynchronous metrics `jemalloc.jit_arena.active_bytes`, `jemalloc.jit_arena.dirty_bytes`, `CompiledExpressionCacheBytesMax`, and `CompiledExpressionCacheCountMax` for observability. `SYSTEM DROP COMPILED EXPRESSION CACHE` now also drops the underlying CHJIT instances and purges the JIT arena. [#104113](https://github.com/ClickHouse/ClickHouse/pull/104113) ([Raúl Marín](https://github.com/Algunenano)).
* Fix excessive memory reservation when reading sparse dictionary-encoded `Nullable(String)` columns from `Parquet` with the native V3 reader. [#102805](https://github.com/ClickHouse/ClickHouse/pull/102805) ([Francisco](https://github.com/Milias)).
* Fixed `CREATE TABLE ... CLONE AS (and REPLACE / ATTACH PARTITION ... FROM)` on encrypted disks copying data instead of hardlinking it. [#106731](https://github.com/ClickHouse/ClickHouse/pull/106731) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Improve cardinality estimation in the query plan optimizer: a column produced by a deterministic single-argument function (e.g. `toYear(date)`) now inherits its argument's number of distinct values as an upper bound instead of being left without statistics, leading to more accurate join reordering. [#107757](https://github.com/ClickHouse/ClickHouse/pull/107757) ([Alexander Gololobov](https://github.com/davenger)).
* Reduced CPU overhead of asynchronous logging under high log rates by notifying the log consumer only on the empty-to-non-empty queue transition instead of on every message. [#107352](https://github.com/ClickHouse/ClickHouse/pull/107352) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Remove duplicate calculations during query execution in more scenarios. [#106113](https://github.com/ClickHouse/ClickHouse/pull/106113) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Parallelize the processing of a recursive CTE's result: a `GROUP BY` or other operation over a large `WITH RECURSIVE` result is no longer limited to a single thread. [#107694](https://github.com/ClickHouse/ClickHouse/pull/107694) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improved the performance of case-insensitive substring search (`positionCaseInsensitiveUTF8`, `ILIKE`, `multiSearchAnyCaseInsensitiveUTF8`, and related functions) by adding a NEON SIMD path on ARM and a wider AVX2 kernel on x86. [#107882](https://github.com/ClickHouse/ClickHouse/pull/107882) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a \~16% throughput regression of the `FPC` floating-point codec on ARM that was introduced when its predictor tables started using `VectorWithMemoryTracking`. [#108182](https://github.com/ClickHouse/ClickHouse/pull/108182) ([Groene AI](https://github.com/groeneai)).

<h4 id="266-improvement">
  Improvement
</h4>

* The background `MemoryWorker` now periodically updates the server's hard memory limit based on the current memory usage and the amount of memory the kernel reports as available, so ClickHouse leaves room for other processes running on the same host. The formula is `(resident memory + system MemAvailable) * max_server_memory_usage_to_ram_ratio`. The same `max_server_memory_usage_to_ram_ratio` server setting controls both the startup cap and the dynamic adjustment; set it to `0` to disable both. To keep only the static startup/reload cap (the behavior of previous versions), set the new server setting `memory_worker_dynamic_hard_limit` to `0`. [#104964](https://github.com/ClickHouse/ClickHouse/pull/104964) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support C# PostgreSQL client in `PostgreSQL` protocol. This closes [#18611](https://github.com/ClickHouse/ClickHouse/issues/18611). [#80785](https://github.com/ClickHouse/ClickHouse/pull/80785) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Mutations now use the analyzer. [#98884](https://github.com/ClickHouse/ClickHouse/pull/98884) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Added granular control over query echoing in the CLI. The `--echo` option now accepts an optional boolean value and works in both interactive and batch mode. New options `--echo-formatted` and `--echo-query-id` control whether echoed queries are formatted and whether the `query_id` is printed, respectively. The `--hilite`/`--highlight` option now also controls highlighting of echoed queries. As a side effect, `--echo` is now a boolean-value option, so a positional query directly after a bare `--echo` is treated as its value; use `--echo --query "..."` or `--echo=false` instead. [#106191](https://github.com/ClickHouse/ClickHouse/pull/106191) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support schema evolution together with concurrent consistency checks for data lake catalogs. [#106102](https://github.com/ClickHouse/ClickHouse/pull/106102) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Allow cache disk for datalake table engines. [#102017](https://github.com/ClickHouse/ClickHouse/pull/102017) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Fix `DataLakeCatalog` databases with `catalog_type = 'onelake'` reading table data by using the OneLake Blob endpoint (`.blob.fabric.microsoft.com`) by default. Set `onelake_use_blob_endpoint = false` to keep the previous DFS endpoint (`.dfs.fabric.microsoft.com`) behavior. [#106843](https://github.com/ClickHouse/ClickHouse/pull/106843) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Update default of `S3(Azure)Queue` setting `persistent_processing_node_ttl_seconds` from `1 hour` to `6 hours` (which stands for cleanup time due to service unclean restart etc). The previous default was fine for processing nodes ttl, but it is also used for bucket lock ttl, which can be hold for longer time, therefore 1 hour was not enough. [#106838](https://github.com/ClickHouse/ClickHouse/pull/106838) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Decreased the default size of the `Iceberg` metadata cache from 1 GB to 128 MB. [#106492](https://github.com/ClickHouse/ClickHouse/pull/106492) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Propagate the `S3Queue` streaming task `query_id` to dependent table inserts. [#106494](https://github.com/ClickHouse/ClickHouse/pull/106494) ([Christoph Wurm](https://github.com/cwurm)).
* Populate `used_storages` in `system.query_log` with the storage engine name when querying tables via `DataLakeCatalog`. [#100706](https://github.com/ClickHouse/ClickHouse/pull/100706) ([Melvyn Peignon](https://github.com/melvynator)).
* You can check which 'operation' and what 'summary' Iceberg's snapshots have. Useful for testing and debugging. [#106246](https://github.com/ClickHouse/ClickHouse/pull/106246) ([Den Kalantaevskii](https://github.com/Diskein)).
* Complete the final `S3` multipart upload request asynchronously via the task tracker, so it can overlap with the last part upload instead of running serially in finalize. [#105487](https://github.com/ClickHouse/ClickHouse/pull/105487) ([Asya Shneerson](https://github.com/asya-ch)).
* Added four new `MergeTree` table settings to control default parameters of text indexes: `text_index_dictionary_block_size`, `text_index_dictionary_block_frontcoding_compression`, `text_index_posting_list_block_size`, and `text_index_posting_list_codec`. These settings allow tuning text index behavior at the table level without specifying parameters in every index definition. Explicit per-index arguments still take precedence. [#100626](https://github.com/ClickHouse/ClickHouse/pull/100626) ([Anton Popov](https://github.com/CurtizJ)).
* Allow projections to override additional `MergeTree` settings (compression, part format, serialization) beyond just `index_granularity`, with an allow-list of allowed settings and validation. [#101170](https://github.com/ClickHouse/ClickHouse/pull/101170) ([Amos Bird](https://github.com/amosbird)).
* Add `current_projection`, `current_projection_progress`, `projections_completed`, and `projections_remaining` columns to `system.merges` to expose projection merge progress. [#102611](https://github.com/ClickHouse/ClickHouse/pull/102611) ([Amos Bird](https://github.com/amosbird)).
* Fixed `PREWHERE` with `IN` subquery on primary key columns not using primary key index for granule pruning, causing full table scans instead of reading only relevant granules. [#102570](https://github.com/ClickHouse/ClickHouse/pull/102570) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Function `h3PolygonToCells` now enforces the maximum array size across all polygons of a `MultiPolygon`, validates the underlying H3 library return codes, and rejects `MultiLineString` arguments instead of silently returning an empty result. [#106399](https://github.com/ClickHouse/ClickHouse/pull/106399) ([Raúl Marín](https://github.com/Algunenano)).
* Add a new keeper-only `system.keeper_snapshots` table with information about local ClickHouse Keeper snapshots. [#105571](https://github.com/ClickHouse/ClickHouse/pull/105571) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add a new keeper-only `system.keeper_changelogs` table with information about local ClickHouse Keeper changelog (Raft log) files. [#105617](https://github.com/ClickHouse/ClickHouse/pull/105617) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add a keeper-only `system.keeper_cluster` table. Contains one row per Raft cluster member as seen by the current Keeper. [#105646](https://github.com/ClickHouse/ClickHouse/pull/105646) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add more Keeper profile (server-side + client-side) events for watches. Closes [#97703](https://github.com/ClickHouse/ClickHouse/issues/97703). [#105336](https://github.com/ClickHouse/ClickHouse/pull/105336) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Added Keeper `coordination_settings` for `NuRaft` uncommitted log entry admission limiting and append-entries backward-probe throttling. [#106108](https://github.com/ClickHouse/ClickHouse/pull/106108) ([Antonio Andelic](https://github.com/antonio2368)).
* Add `enable_compression` setting for the `mysql` table function, the `MySQL` table engine, the `MySQL` database engine, dictionary `SOURCE(MYSQL)`, and named collections. When enabled, ClickHouse negotiates MySQL protocol-level compression for all data transferred over the connection. [#103229](https://github.com/ClickHouse/ClickHouse/pull/103229) ([Bernard Lim](https://github.com/bernardlim)).
* Reduced cancellation latency for queries running over the PostgreSQL wire protocol: `KILL QUERY` now interrupts output serialization within a single chunk instead of waiting for the entire chunk to be sent to the client. [#106535](https://github.com/ClickHouse/ClickHouse/pull/106535) ([Roman Vasin](https://github.com/rvasin)).
* Reduced cancellation latency for queries running over the MySQL wire protocol: `KILL QUERY` now interrupts output serialization within a single chunk instead of waiting for the entire chunk to be sent to the client. [#107228](https://github.com/ClickHouse/ClickHouse/pull/107228) ([Roman Vasin](https://github.com/rvasin)).
* Fixed reading of the `auth_response` length in the MySQL handshake, where a length byte `>= 128` was interpreted as a multi-gigabyte value because it was read as a signed `char`. [#107384](https://github.com/ClickHouse/ClickHouse/pull/107384) ([uwezkhan](https://github.com/uwezkhan)).
* `MaterializedPostgreSQL` now maps PostgreSQL `numeric(p, 0)` columns with precision greater than 76 (e.g. `numeric(78, 0)` used for 256-bit integers) to ClickHouse `Int256` instead of failing with "Precision too big". Values that do not fit into `Int256` are rejected with a clear error. [#107431](https://github.com/ClickHouse/ClickHouse/pull/107431) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Send an exception to the client when TCP connection setup fails. [#107317](https://github.com/ClickHouse/ClickHouse/pull/107317) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Users can now insert `Avro` `Fixed` fields for 8-bit/16-bit/32-bit/64-bit integer variants. [#98139](https://github.com/ClickHouse/ClickHouse/pull/98139) ([Patrick Pichler](https://github.com/patrickpichler)).
* The `AvroConfluent` format now retries the Confluent Schema Registry HTTP client on transient failures (transport timeouts, connection refused, DNS errors, HTTP `5xx`/`408`/`429`) with exponential backoff, instead of aborting the INSERT on the first network glitch. New settings `format_avro_schema_registry_max_retries` (default `5`) and `format_avro_schema_registry_retry_initial_backoff_ms` (default `100`) control the policy. Schema-validation errors (HTTP `409`, malformed Avro JSON) remain fatal. [#106661](https://github.com/ClickHouse/ClickHouse/pull/106661) ([Groene AI](https://github.com/groeneai)).
* Record privileges in `system.query_log.used_privileges` for all granted access checks, including those that go through the non-throwing `isGranted` path (`checkAccessWithFilter`). Previously only privileges checked via throwing entry points (`checkAccess` / `checkGrantOption`) were recorded, which made `READ ON FILE` / `READ ON S3` / `READ ON AZURE` / `READ ON URL` invisible in the audit log for `DESCRIBE`, `CREATE TABLE AS`, and similar queries that use `file` / `s3` / `azure` / `url` table functions. Access enforcement is unchanged. [#104693](https://github.com/ClickHouse/ClickHouse/pull/104693) ([Alexey Bakharew](https://github.com/alexbakharew)).
* Added asynchronous metrics `TotalUncompressedBytesOfMergeTreeTables` and `TotalUncompressedBytesOfMergeTreeTablesSystem`, reporting the total uncompressed size of data stored in MergeTree-family tables. [#106364](https://github.com/ClickHouse/ClickHouse/pull/106364) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Adds the `GlobalMemoryLimitExceeded` profile event so operators can monitor when the server-wide memory limit is hit. [#106466](https://github.com/ClickHouse/ClickHouse/pull/106466) ([Sacheendra Talluri](https://github.com/sacheendra)).
* Populate the `ExecutableUserDefinedFunction*` `ProfileEvents` counters for `executable_pool` UDFs. Per-call invocation count, wall and pool-wait time, child-process CPU and peak memory, and stdin/stdout bytes are now visible in `system.query_log.ProfileEvents`. [#105010](https://github.com/ClickHouse/ClickHouse/pull/105010) ([Xu Jia](https://github.com/XuJia0210)) [#105618](https://github.com/ClickHouse/ClickHouse/pull/105618) ([Ilya Andreev](https://github.com/andreev-io)).
* Added asynchronous metrics `ExecutableUserDefinedFunctionMemoryResidentBytes` and `ExecutableUserDefinedFunctionProcesses`, reporting the resident memory (`VmRSS`) and number of live processes of `executable` and `executable_pool` user-defined functions, including descendant processes and idle pool workers. [#107300](https://github.com/ClickHouse/ClickHouse/pull/107300) ([Hanzi Jiang](https://github.com/HanziJiang)).
* Added three Linux-only async metrics — `MemoryThreadStacksCount`, `MemoryThreadStacksVirtual`, and `MemoryThreadStacksResident` — that report pthread stack memory separately from the rest of anonymous memory. Enabled via `asynchronous_metrics_enable_heavy_metrics`. Requires Linux 5.17+ (`prctl(PR_SET_VMA_ANON_NAME)`) and readable `/proc/self/smaps`; otherwise the metrics are absent and the limitation is reported in `system.warnings`. [#106230](https://github.com/ClickHouse/ClickHouse/pull/106230) ([Raúl Marín](https://github.com/Algunenano)).
* Expose the `MemoryThreadStacks*` asynchronous metrics (resident/virtual size and count of thread stacks) on macOS. [#107752](https://github.com/ClickHouse/ClickHouse/pull/107752) ([Raúl Marín](https://github.com/Algunenano)).
* Table engines now carry embedded documentation, introspectable via the new `description`, `syntax`, `examples`, `introduced_in`, and `related` columns of the `system.table_engines` table. [#106177](https://github.com/ClickHouse/ClickHouse/pull/106177) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Database engines now carry embedded documentation, introspectable via the new `description`, `syntax`, `examples`, `introduced_in`, and `related` columns of the `system.database_engines` table. [#106178](https://github.com/ClickHouse/ClickHouse/pull/106178) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Data types now carry embedded documentation, introspectable via the new `description`, `syntax`, `examples`, `introduced_in`, and `related` columns of the `system.data_type_families` table. [#106180](https://github.com/ClickHouse/ClickHouse/pull/106180) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Input/output formats now carry embedded documentation, introspectable via the new `description`, `examples`, `introduced_in`, and `related` columns of the `system.formats` table. [#106181](https://github.com/ClickHouse/ClickHouse/pull/106181) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Aggregate function combinators now carry embedded documentation, introspectable via the new `description`, `syntax`, `examples`, `introduced_in`, and `related` columns of the `system.aggregate_function_combinators` table. [#106185](https://github.com/ClickHouse/ClickHouse/pull/106185) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added the `--chime` command-line option to `clickhouse-client`, `clickhouse-local`, and the embedded client. When a query finishes (on success or on error) after running for at least N seconds, the client writes the ASCII `BEL` control character (`\x07`) to stderr. Terminals decide whether to make a sound or a visual flash based on the user's preferences. Enabled by default with a 5-second threshold; pass `--chime N` for a custom threshold or `--chime 0` to disable. Closes [#92718](https://github.com/ClickHouse/ClickHouse/issues/92718). [#104545](https://github.com/ClickHouse/ClickHouse/pull/104545) ([Groene AI](https://github.com/groeneai)).
* In `clickhouse-client`, when the terminal does not support bracketed paste, embedded newlines from a pasted multi-line query are now folded into the same edit buffer instead of switching to the continuation prompt for every line. The pasted query stays under a single prompt and the arrow keys navigate across its lines. This is a best-effort improvement that relies on the typical TTY-buffered paste behavior. [#104299](https://github.com/ClickHouse/ClickHouse/pull/104299) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Now also works with syntax highlighting disabled (`--highlight 0`). [#106665](https://github.com/ClickHouse/ClickHouse/pull/106665) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add MySQL-style runtime pager control for `clickhouse-client`/`clickhouse-local`. [#105706](https://github.com/ClickHouse/ClickHouse/pull/105706) ([Azat Khuzhin](https://github.com/azat)).
* `clickhouse-client` now respects non-UTF-8 terminals: when the terminal character encoding is not UTF-8 (e.g. with `LANG=C`), the `Pretty` formats fall back to ASCII grid borders instead of printing Unicode box-drawing characters that would corrupt the terminal. [#106213](https://github.com/ClickHouse/ClickHouse/pull/106213) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Sanitize server-supplied display strings in `clickhouse-client`'s `Hello` packet handling (server name, time zone, display name, password-rule patterns and messages) so a hostile server cannot inject bytes that the client renders verbatim, and cap their size to defend against unbounded allocation. [#105243](https://github.com/ClickHouse/ClickHouse/pull/105243) ([Raúl Marín](https://github.com/Algunenano)).
* The Web UI now displays the result as an image when a query uses an image output format such as `FORMAT PNG`, instead of showing the raw bytes as a table. [#107638](https://github.com/ClickHouse/ClickHouse/pull/107638) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add setting `output_format_pretty_use_nbsp_for_padding` to render table-layout padding in table-style `Pretty` formats as `U+00A0` NO-BREAK SPACE when `output_format_pretty_grid_charset` is `UTF-8`. This helps copied `Pretty` output keep table alignment in tools that collapse regular spaces. The setting is disabled by default, and `ASCII` charset output keeps regular spaces. [#103559](https://github.com/ClickHouse/ClickHouse/pull/103559) ([Ashrith Bandla](https://github.com/ashrithb)).
* The universal install script now also installs `clickhousectl` into `~/.local/bin` on Linux and macOS, with a `chctl` symlink. Set `CLICKHOUSE_ONLY=1` to skip. [#105399](https://github.com/ClickHouse/ClickHouse/pull/105399) ([Alasdair Brown](https://github.com/sdairs)).
* Fixed a spurious `Syntax error: Unterminated quoted string` that could occur intermittently when installing ClickHouse via `curl https://clickhouse.com/ | sh` while a `clickhouse` binary already existed in the current directory. [#106417](https://github.com/ClickHouse/ClickHouse/pull/106417) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the left panel height on the `play.html` page when the web terminal is open, so the terminal toggle button at the bottom stays visible. [#105087](https://github.com/ClickHouse/ClickHouse/pull/105087) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Avoid selecting the only query in the Web UI after running it. [#105711](https://github.com/ClickHouse/ClickHouse/pull/105711) ([Joey Yu](https://github.com/itsjoeoui)).
* The Web SQL UI now expands the query editor when a query is at most 30% taller than the current editor height. [#105713](https://github.com/ClickHouse/ClickHouse/pull/105713) ([Joey Yu](https://github.com/itsjoeoui)).
* In the Web UI, lay out the bottom menu icons (Web Terminal and GitHub) horizontally when the left panel is expanded, giving the list of databases and tables more vertical space. [#106427](https://github.com/ClickHouse/ClickHouse/pull/106427) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In the Web UI (`play.html`), pressing `Escape` now deactivates the currently selected result-table cell. [#107777](https://github.com/ClickHouse/ClickHouse/pull/107777) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improvements to the database panel in the Web SQL UI (Play): a tooltip on the database icon, a button to hide the panel, full-width clickable database/table names, and a fix for the panel width shifting when the scrollbar appears. [#108013](https://github.com/ClickHouse/ClickHouse/pull/108013) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add a server setting (`min_allocation_size_to_throw_on_memory_limit`) to allow any allocation to throw `MEMORY_LIMIT_EXCEEDED`, this should help with preventing OOMs. [#105265](https://github.com/ClickHouse/ClickHouse/pull/105265) ([Azat Khuzhin](https://github.com/azat)).
* Allow `NONE` authentication for SSH (prevents asking password for `no_password` users). [#105476](https://github.com/ClickHouse/ClickHouse/pull/105476) ([Azat Khuzhin](https://github.com/azat)).
* Reset the supplementary group list in `clickhouse su` before dropping privileges, matching the behavior of `/bin/su` and `sudo`. Previously the dropped process inherited the invoker's supplementary groups. [#105247](https://github.com/ClickHouse/ClickHouse/pull/105247) ([Raúl Marín](https://github.com/Algunenano)).
* Add `BFloat16` support for numeric predicate (`isFinite`, `isNaN`) functions. [#105391](https://github.com/ClickHouse/ClickHouse/pull/105391) ([Mohamed Hussain S](https://github.com/mohhddhassan)).
* Reduce memory usage of polygon dictionaries (`polygon_index_cell`, `polygon_index_each`) and make `system.dictionaries.bytes_allocated` correctly reflect the lookup index they build. [#105431](https://github.com/ClickHouse/ClickHouse/pull/105431) ([Raúl Marín](https://github.com/Algunenano)).
* Fixes Kafka table engine consumers that kept using a short poll interval after partition assignment, so they return to the configured `kafka_poll_timeout_ms` and avoid excessive empty polls, smaller inserted parts, and extra merge overhead after rebalances. [#100431](https://github.com/ClickHouse/ClickHouse/pull/100431) ([sugaf1204](https://github.com/sugaf1204)).
* Identify columns by position (instead of by name) when removing unused columns in the query plan. This enables unused-column removal when duplicated column names are present. [#100586](https://github.com/ClickHouse/ClickHouse/pull/100586) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* ClickHouse throws a proper exception for attempts to use `table_readonly` for replicated engines, with better exception handling for DDL queries (and `DatabaseReplicated`) related to this setting. [#100950](https://github.com/ClickHouse/ClickHouse/pull/100950) ([alesapin](https://github.com/alesapin)). `OPTIMIZE TABLE ... ON CLUSTER` and other DDL no longer hang when the target table has `table_readonly = 1`. The setting now throws a new dedicated error code `TABLE_IS_PERMANENTLY_READ_ONLY`, which `DDLWorker` treats as non-retriable (distinct from the transient `TABLE_IS_READ_ONLY` that arises during temporary `ReplicatedMergeTree` ZooKeeper disconnects). The `table_readonly` setting is also now explicitly rejected for `ReplicatedMergeTree`, both at creation and via `ALTER MODIFY SETTING`. Follow-up to [#97652](https://github.com/ClickHouse/ClickHouse/issues/97652). [#105109](https://github.com/ClickHouse/ClickHouse/pull/105109) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed refreshable materialized view refreshes that could fail with `UNKNOWN_TABLE` after the target table had been replaced (for example via `EXCHANGE TABLES` or drop-and-recreate): the refresh now resolves the target table by name instead of relying on a stale UUID. [#102724](https://github.com/ClickHouse/ClickHouse/pull/102724) ([Seva Potapov](https://github.com/seva-potapov)).
* Added a setting `wait_for_part_commit_in_dependent_materialized_views` (default `false`). When a materialized view's `SELECT` reads back from its own source table (for example via an `INNER JOIN` to the source), the cascade could miss the row currently being inserted, because the inserted part is committed only after the dependent views run. Enabling this setting commits the part before the dependent views are triggered, so they observe the in-flight row, at the cost of less insert parallelism. [#105943](https://github.com/ClickHouse/ClickHouse/pull/105943) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Do not swallow fatal errors (e.g. `MEMORY_LIMIT_EXCEEDED`) in `tryDeserialize`. [#106808](https://github.com/ClickHouse/ClickHouse/pull/106808) ([Azat Khuzhin](https://github.com/azat)).
* Check `CREATE TEMPORARY TABLE` grant lazily in `InverseDictionaryLookupPass`. [#107098](https://github.com/ClickHouse/ClickHouse/pull/107098) ([Azat Khuzhin](https://github.com/azat)).
* Fix an `ILLEGAL_TYPE_OF_ARGUMENT` error for distributed queries with `serialize_query_plan = 1` that contain a lambda with a constant argument (e.g. `arrayMap(t -> t.2, ...)`). Constant columns of `ActionsDAG` `INPUT` nodes are now preserved during query plan serialization. [#107124](https://github.com/ClickHouse/ClickHouse/pull/107124) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Deserialization of the states of the `contingency`, `cramersV`, `cramersVBiasCorrected`, and `theilsU` aggregate functions now validates that the stored counts form a consistent contingency table and throws a `CORRUPTED_DATA` exception otherwise. Closes [#106899](https://github.com/ClickHouse/ClickHouse/issues/106899). [#107185](https://github.com/ClickHouse/ClickHouse/pull/107185) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Preserve original error codes for exceptions wrapped in `arrow::Status`. [#107267](https://github.com/ClickHouse/ClickHouse/pull/107267) ([Azat Khuzhin](https://github.com/azat)).
* Support `keyed_by_normalized_query_hash` for quotas defined in the static server configuration (`users.xml`), matching the existing `CREATE QUOTA ... KEYED BY normalized_query_hash` DDL syntax. [#107654](https://github.com/ClickHouse/ClickHouse/pull/107654) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The compatibility setting no longer applies obsolete settings, so it does not mark them as changed or produce obsolete-setting warnings. [#107737](https://github.com/ClickHouse/ClickHouse/pull/107737) ([Maxim Orlovsky](https://github.com/UberDever)).
* Async inserts no longer log the full list of `query_id`s at `trace`/`debug` level, which since 26.2 could blow up `text_log` on services with heavy async insert traffic. Detailed lines are now at `test` level. [#107852](https://github.com/ClickHouse/ClickHouse/pull/107852) ([Sema Checherinda](https://github.com/CheSema)).
* Filesystem cache improvement: stop invalidated priority entries from pinning `KeyMetadata`. Follow up to [#106387](https://github.com/ClickHouse/ClickHouse/pull/106387). [#107903](https://github.com/ClickHouse/ClickHouse/pull/107903) ([Kseniia Sumarokova](https://github.com/kssenii)).
* `FileCache` metrics improvement. [#106116](https://github.com/ClickHouse/ClickHouse/pull/106116) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Do not print the "Stack trace (when copying this message, always include the lines below):" preamble in exception messages when the stack trace is actually empty. [#106524](https://github.com/ClickHouse/ClickHouse/pull/106524) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a potential overflow in `roundUpToMultiple` when computing filesystem cache boundary alignment for very large offsets. [#92579](https://github.com/ClickHouse/ClickHouse/pull/92579) ([Bharat Nallan](https://github.com/bharatnc)).
* `EXPLAIN SYNTAX` now formats operators as function calls consistently in explain output (for example `plus(1, 2)` instead of `1 + 2`). [#94681](https://github.com/ClickHouse/ClickHouse/pull/94681) ([Mohamed Abdelhalim ](https://github.com/1abdelhalim)).
* Improved table name hints in error messages: no longer suggests the exact same name, and includes the database name in the suggestion (e.g., "Maybe you meant `other_db.my_table`?"). [#95116](https://github.com/ClickHouse/ClickHouse/pull/95116) ([Mathuranath Metivier](https://github.com/matt-metivier)).
* Improved error message for unresolved identifiers in queries without a `FROM` clause to suggest adding one. [#101769](https://github.com/ClickHouse/ClickHouse/pull/101769) ([Yash ](https://github.com/Onyx2406)).
* Add `EXPLAIN PIPELINE` option to compact repeated processor chains. [#104662](https://github.com/ClickHouse/ClickHouse/pull/104662) ([Yue Ni](https://github.com/niyue)).
* Fix a heap-buffer-overflow read in syntax-error message construction (`UTF8::computeWidthImpl` via `parseQuery.cpp`) that occurred when the parser had backtracked past the first semicolon / end-of-stream token; release builds were splicing bytes from neighboring heap memory into the displayed error, ASan builds aborted. [#105086](https://github.com/ClickHouse/ClickHouse/pull/105086) ([Groene AI](https://github.com/groeneai)).
* Make hive partition strategy a default under compatibility setting `file_like_engine_default_partition_strategy`. [#86746](https://github.com/ClickHouse/ClickHouse/pull/86746) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Use a larger (8 MiB) thread stack on macOS to match the Linux default, fixing rare server crashes from stack overflow during JIT compilation. [#107033](https://github.com/ClickHouse/ClickHouse/pull/107033) ([Raúl Marín](https://github.com/Algunenano)).
* The temporary storage size limit of `clickhouse-local` is no longer hard-coded to 1 GiB. The default is raised to 1 TiB and can be configured with the `max_temporary_data_on_disk_size` server setting. [#106689](https://github.com/ClickHouse/ClickHouse/pull/106689) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `read-checksums` command to `clickhouse-disks`. It reads the `checksums.txt` file of a `MergeTreeDataPart` and prints it as a human-readable, tab-separated table. [#106901](https://github.com/ClickHouse/ClickHouse/pull/106901) ([Asya Shneerson](https://github.com/asya-ch)).
* Added a `read-bitmap` command to `clickhouse-disks`. [#107834](https://github.com/ClickHouse/ClickHouse/pull/107834) ([murphy-4o](https://github.com/murphy-4o)).
* Chdig: enable TLS for secure connections (previous leads to either "unknown setting `skip_verify`" or "connection reset by peer"). [#105864](https://github.com/ClickHouse/ClickHouse/pull/105864) ([Azat Khuzhin](https://github.com/azat)).
* [`chdig` v26.5.1](https://github.com/azat/chdig/releases/tag/v26.5.1). [#105918](https://github.com/ClickHouse/ClickHouse/pull/105918) ([Azat Khuzhin](https://github.com/azat)).
* [`chdig` v26.6.1](https://github.com/azat/chdig/releases/v26.6.1) - `{asynchronous_,}metric_log`, query patterns, heatmaps, logs/traces stored on disk (previously it can use >40GiB for 1 hour of traces). [#107678](https://github.com/ClickHouse/ClickHouse/pull/107678) ([Azat Khuzhin](https://github.com/azat)).
* The server config (`programs/server/config.xml`) now sets `keep_alive_timeout` to 30 (formerly 10), aligning with the actual documented and implemented default. [#107779](https://github.com/ClickHouse/ClickHouse/pull/107779) ([Dan Checkoway](https://github.com/dcheckoway)).
* The default for the server setting `disk_connections_rcvbuf` changed from `0` (kernel TCP autotuning) to `204800` (200 KB), capping the per-socket TCP receive buffer for object-storage (`S3`/`Azure`/`GCS`) disk connections. [#107859](https://github.com/ClickHouse/ClickHouse/pull/107859) ([Sema Checherinda](https://github.com/CheSema)).
* The `PREWHERE` optimizer now groups conjuncts that reference the same column set before estimating selectivity, so that conditions like `a > 2500 AND a < 2502` are evaluated together as a combined range rather than as two independent predicates, producing a more accurate selectivity estimate. [#106337](https://github.com/ClickHouse/ClickHouse/pull/106337) ([Han Fei](https://github.com/hanfei1991)).
* Add silk fiber aware secure and plain socket implementations. [#107680](https://github.com/ClickHouse/ClickHouse/pull/107680) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed a garbled error message (swapped arguments) and a typo in the `nested` function. [#108031](https://github.com/ClickHouse/ClickHouse/pull/108031) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a `sed` command to `clickhouse-disks` that applies a sed expression to a given path, in-place. [#107131](https://github.com/ClickHouse/ClickHouse/pull/107131) ([Asya Shneerson](https://github.com/asya-ch)).
* Added the create-time `materialized_postgresql_use_extended_date_and_time_types` setting for the `MaterializedPostgreSQL` database engine. By default (enabled), PostgreSQL `date`/`timestamp` columns are inferred as `Date32`/`DateTime64`; setting it to `0` at `CREATE DATABASE` time infers the narrower `Date`/`DateTime` types. [#107428](https://github.com/ClickHouse/ClickHouse/pull/107428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="266-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Make possible to drop detached parts with the `tryN` suffix. [#58957](https://github.com/ClickHouse/ClickHouse/pull/58957) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix a `MULTIPLE_EXPRESSIONS_FOR_ALIAS` exception for queries with duplicate projection aliases (for example `SELECT *, day + 365 AS day`) inside nested subqueries when running with parallel replicas. [#80310](https://github.com/ClickHouse/ClickHouse/pull/80310) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a bug with `splitMultipartQuery` throwing an "Empty query" error for queries that end with comment after semicolon. [#85491](https://github.com/ClickHouse/ClickHouse/pull/85491) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix an exception with `ARRAY JOIN`s: `Function writeSlice expects same column types for GenericArraySlice and GenericArraySink` which happens when `LowCardinality` numeric types are used (issue [#57243](https://github.com/ClickHouse/ClickHouse/issues/57243)). [#91784](https://github.com/ClickHouse/ClickHouse/pull/91784) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` exception when using `LIMIT BY` with constant columns alongside `DISTINCT` and `ORDER BY` with the new analyzer. [#93195](https://github.com/ClickHouse/ClickHouse/pull/93195) ([Ashrith Bandla](https://github.com/ashrithb)).
* Fix `NOT NULL` columns being silently created as `Nullable` when `data_type_default_nullable = 1` and the table is created in a `Replicated` database or via `ON CLUSTER`. [#97572](https://github.com/ClickHouse/ClickHouse/pull/97572) ([xiaohuanlin](https://github.com/xiaohuanlin)).
* Fixed HiveCatalog connection stability by adding automatic retry mechanism and reconnection logic for handling TTransportException errors when communicating with Hive Metastore. [#98471](https://github.com/ClickHouse/ClickHouse/pull/98471) ([Dmitriy Borisenko](https://github.com/otselnik)).
* Fixed `nested` function (used internally by `ARRAY JOIN`) stripping `LowCardinality` from column types, causing `Array(LowCardinality(String))` to become `Array(String)` in output. Closes [#95582](https://github.com/ClickHouse/ClickHouse/issues/95582). [#98974](https://github.com/ClickHouse/ClickHouse/pull/98974) ([Yash ](https://github.com/Onyx2406)).
* Fix "Distributed task iterator is not initialized" exception when using `url`, `s3`, or similar table functions in queries with parallel replicas enabled. [#100146](https://github.com/ClickHouse/ClickHouse/pull/100146) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception when reading Iceberg tables whose format version was upgraded by an external tool (e.g. Spark). [#100407](https://github.com/ClickHouse/ClickHouse/pull/100407) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Functions `like`, `ilike`, `notLike`, `notILike`, and `match` now support constant haystack with non-constant needle (e.g. `'foo' LIKE pattern_column`), which previously threw `ILLEGAL_COLUMN`. [#100479](https://github.com/ClickHouse/ClickHouse/pull/100479) ([Yash ](https://github.com/Onyx2406)).
* Fixed wrong row count returned by a `MaterializedView` query with `query_plan_enable_optimizations = 0` when the view maps an integer column to a `Bool` column. [#100692](https://github.com/ClickHouse/ClickHouse/pull/100692) ([Maksim Moisiuk](https://github.com/Maximus5)).
* Fix an exception (`LOGICAL_ERROR: 'PREWHERE passed to format that doesn't support it'`) when reading Iceberg tables containing ORC data files with PREWHERE optimization enabled. [#101206](https://github.com/ClickHouse/ClickHouse/pull/101206) ([Groene AI](https://github.com/groeneai)).
* Fix race in RestCatalog. [#101216](https://github.com/ClickHouse/ClickHouse/pull/101216) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` error when selecting from a VIEW over a table with a normal projection. [#101218](https://github.com/ClickHouse/ClickHouse/pull/101218) ([Amos Bird](https://github.com/amosbird)).
* Fix stale metadata in FileLog when a file is deleted and recreated. [#101408](https://github.com/ClickHouse/ClickHouse/pull/101408) ([Azat Khuzhin](https://github.com/azat)).
* Fix join reordering silently dropping unmatched rows of a `RIGHT`/`LEFT JOIN` when it is comma-joined (cross) with another table, e.g. `t1 RIGHT JOIN t2 ON t1.c = t2.c, t3`. The query previously returned the inner-join result instead of the outer-join one. [#101684](https://github.com/ClickHouse/ClickHouse/pull/101684) ([Groene AI](https://github.com/groeneai)).
* Fixed `FORMAT` clause being consumed by `INSERT` instead of applying to `EXPLAIN` output in `EXPLAIN INSERT INTO ... SELECT ... FORMAT ...`. [#101772](https://github.com/ClickHouse/ClickHouse/pull/101772) ([Yash ](https://github.com/Onyx2406)).
* Fixed incorrect compression codec selection for `MergeTree` parts when the table-level `default_compression_codec` setting was explicitly configured. Parts written on insert, during merges, and for projections used the server-wide default codec instead of the table-level setting (the empty part produced by a fully-deleting mutation is now covered as well). [#101784](https://github.com/ClickHouse/ClickHouse/pull/101784) ([Yash ](https://github.com/Onyx2406)).
* Reject negative `Float64` values (e.g. `-100.5`) in workload settings like `max_bytes_per_second`, `max_cpus`, etc. Previously only negative integers were validated, allowing negative floats to silently create broken scheduler nodes. Closes [#101825](https://github.com/ClickHouse/ClickHouse/issues/101825). [#101842](https://github.com/ClickHouse/ClickHouse/pull/101842) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` ("Port is not connected", code 49) that could occur when executing queries involving a VIEW with aggregation inside a JOIN. [#102574](https://github.com/ClickHouse/ClickHouse/pull/102574) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix inconsistent part metadata after mutations of columns with non-default serializations. [#102817](https://github.com/ClickHouse/ClickHouse/pull/102817) ([Eduard Karacharov](https://github.com/korowa)).
* Fix updating metadata before executing mutation resolves [#96806](https://github.com/ClickHouse/ClickHouse/issues/96806). [#102882](https://github.com/ClickHouse/ClickHouse/pull/102882) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fix SELECT queries being significantly slower when concurrent INSERTs are running. Previously an INSERT pipeline reserved CPU slots up to `max_threads` at query start even when most slots were never used, starving concurrent SELECTs. CPU slot allocation is now demand-driven: the pipeline only requests slots as it actually pushes parallelizable work. Applies both to concurrency control and to the preemptive CPU scheduler for workloads. New server setting `concurrent_threads_lazy_allocation` (default `true`) acts as a rollback lever. [#102928](https://github.com/ClickHouse/ClickHouse/pull/102928) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix `NULL` propagation when reading subcolumns extracted from `Nullable(Tuple(...))` columns. For example, for `tup Nullable(Tuple(s Nullable(String)))`, `SELECT tup.s` now correctly returns `NULL` in rows where the outer tuple is `NULL` instead of garbage values. This covers all element types that can represent `NULL`: `Nullable`, `Dynamic`, `Variant` and `LowCardinality(Nullable(...))`. Closes [#105356](https://github.com/ClickHouse/ClickHouse/issues/105356). [#102942](https://github.com/ClickHouse/ClickHouse/pull/102942) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Throw `INCORRECT_DATA` instead of `LOGICAL_ERROR` when client-supplied data in the Native format is truncated or malformed. [#102975](https://github.com/ClickHouse/ClickHouse/pull/102975) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Added cancellation check to ObjectStorage read operation. Closes [#98165](https://github.com/ClickHouse/ClickHouse/issues/98165). [#103016](https://github.com/ClickHouse/ClickHouse/pull/103016) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Respect `input_format_binary_max_type_complexity` in decoding aggregate function parameters. Closes [#102903](https://github.com/ClickHouse/ClickHouse/issues/102903). [#103026](https://github.com/ClickHouse/ClickHouse/pull/103026) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix nullable inference for geo columns in Arrow-based Parquet reader. Closes [#101845](https://github.com/ClickHouse/ClickHouse/issues/101845). [#103032](https://github.com/ClickHouse/ClickHouse/pull/103032) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed `recursiveRemoveLowCardinality` erasing custom geometry type names (e.g. `LineString` vs `Ring`, `MultiLineString` vs `Polygon`), which caused misinterpretation of the geometry type. Closes [#103207](https://github.com/ClickHouse/ClickHouse/issues/103207). [#103041](https://github.com/ClickHouse/ClickHouse/pull/103041) ([Joanna Hulboj](https://github.com/jh0x)).
* Fixed `input_format_max_block_size_bytes` being silently ignored during `INSERT` parsing when `max_insert_block_size_bytes` is `0` (the default). The setting now correctly limits the size of blocks produced by row input formats. [#103068](https://github.com/ClickHouse/ClickHouse/pull/103068) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Fixed ClickHouse occasionally producing invalid GSSAPI tokens due to incorrect stripping of trailing null bytes. [#103114](https://github.com/ClickHouse/ClickHouse/pull/103114) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Fix analyzer-time constant folding for short-circuit functions (`if`, `multiIf`, `and`, `or`, etc.) so that statically unreachable branches no longer raise exceptions at analysis time. For example, `WITH 0 AS n SELECT multiIf(n = 0, 0, intDiv(100, n))` now correctly returns `0` instead of failing with a division-by-zero error. [#103157](https://github.com/ClickHouse/ClickHouse/pull/103157) ([Peng](https://github.com/fastio)).
* `EXPLAIN SYNTAX` expands parameterized views. [#103263](https://github.com/ClickHouse/ClickHouse/pull/103263) ([Jordi Villar](https://github.com/jrdi)).
* Fix data corruption when writing Parquet (and other trailer-bearing formats such as ORC and Arrow) to HDFS via `INSERT INTO FUNCTION hdfs(...)`. Since 26.1, `WriteBufferFromHDFS` did not flush its working buffer on `finalize()`, so the last up to `DBMS_DEFAULT_BUFFER_SIZE` bytes of every file were silently lost, including the Parquet `PAR1` footer. Reading such files returned `Not a Parquet file (wrong magic bytes at the end of file)`. [#103268](https://github.com/ClickHouse/ClickHouse/pull/103268) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results and a possible logical error for correlated subqueries when a join size limit (`max_rows_in_join` / `max_bytes_in_join`) is set together with `join_overflow_mode = 'break'`. The join created internally to evaluate a correlated subquery now ignores those user limits, so it can no longer stop early and drop rows. [#103322](https://github.com/ClickHouse/ClickHouse/pull/103322) ([Groene AI](https://github.com/groeneai)).
* Fix a bug where `ALTER TABLE ... MODIFY SETTING` on an `EmbeddedRocksDB` table could persist an invalid setting value to the table metadata file even when the server rejected the query. On the next server restart the table would fail to attach with `CANNOT_PARSE_BOOL` (or a similar parsing error), and in databases where load failures are fatal the server would refuse to start. Invalid setting values are now rejected before any metadata is written. [#103417](https://github.com/ClickHouse/ClickHouse/pull/103417) ([Groene AI](https://github.com/groeneai)).
* Fixed a server abort when creating a table with an object-storage engine (`AzureBlobStorage`, `DeltaLakeAzure`, `S3`, `HDFS`) using an unsupported number of arguments. The server now returns a clean `NUMBER_OF_ARGUMENTS_DOESNT_MATCH` error instead of aborting in debug/sanitizer builds. [#103544](https://github.com/ClickHouse/ClickHouse/pull/103544) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash in `JSON` and `Dynamic` data type parameter parsing when the abstract syntax tree (AST) was structurally malformed (for example produced by the AST fuzzer): the `equals(name, value)` parameter expression could be left with fewer than two children, which `DataTypeObject` and `DataTypeDynamic` then dereferenced without bounds checking. [#103545](https://github.com/ClickHouse/ClickHouse/pull/103545) ([Groene AI](https://github.com/groeneai)).
* Fix logical errors in analyzer with column names collision in lambda used in prewhere. Closes [#103584](https://github.com/ClickHouse/ClickHouse/issues/103584). [#103627](https://github.com/ClickHouse/ClickHouse/pull/103627) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix sporadic `Logical error: 'Database <name> not found'` from `DataLakeConfiguration::getCatalog` when an `Iceberg` engine table is loaded inside a regular database during async metadata loading. [#103775](https://github.com/ClickHouse/ClickHouse/pull/103775) ([Groene AI](https://github.com/groeneai)).
* Fix `MULTIPLE_EXPRESSIONS_FOR_ALIAS` errors thrown by remote replicas when running queries that reference projection aliases inside `PREWHERE` / `WHERE` / `HAVING` / `QUALIFY` (e.g. `SELECT x AS a, y AS b, (a AND b) AS c FROM t PREWHERE c`) or `SELECT *` over self-joins with overlapping column names, with parallel replicas and `parallel_replicas_local_plan = 0`. Closes [#74324](https://github.com/ClickHouse/ClickHouse/issues/74324). [#103806](https://github.com/ClickHouse/ClickHouse/pull/103806) ([Groene AI](https://github.com/groeneai)).
* Fix server abort when a query uses nested `coalesce`/`ifNull` comparisons (e.g. `WHERE coalesce(a, b, coalesce(c, d), e) = const`) on a `MergeTree` table with multiple `minmax` skip indexes and `use_skip_indexes_for_disjunctions = 1`. The skip-index rewrite of `<op>(coalesce(...), const)` is now applied recursively to inner coalesce arguments, so the per-index `KeyCondition` RPN matches the template's RPN as the disjunction-tracking code already assumes. [#103929](https://github.com/ClickHouse/ClickHouse/pull/103929) ([Groene AI](https://github.com/groeneai)).
* Fix `max_rows_to_transfer` and `max_bytes_to_transfer` being silently ignored for `GLOBAL IN` and `GLOBAL JOIN` queries under the new analyzer. The settings now raise `SET_SIZE_LIMIT_EXCEEDED` (or break, depending on `transfer_overflow_mode`) when the materialised external table exceeds the configured limit, matching the behavior of the old analyzer. Closes [#103333](https://github.com/ClickHouse/ClickHouse/issues/103333). [#104119](https://github.com/ClickHouse/ClickHouse/pull/104119) ([Groene AI](https://github.com/groeneai)).
* Fix excessive catalog/S3 metadata reads when an INSERT or DDL statement references a non-existent table in a DataLake catalog database with `show_data_lake_catalogs_in_system_tables` enabled. The typo-hint suggestion path loaded full per-table Iceberg metadata for the whole catalog, which could exhaust memory on large catalogs. [#104124](https://github.com/ClickHouse/ClickHouse/pull/104124) ([DQ](https://github.com/il9ue)).
* Fix a crash (`LOGICAL_ERROR` "Columns are assumed to be of identical types, but they are different in Nullable" in debug builds, a `ColumnString::compareAt` null-pointer SIGSEGV in release builds) and a wrong result that could occur in queries using `direct` `join_algorithm` with a `MergeTree` right-side table when the lookup plan reordered columns during optimization. The right-side columns could land in wrong-named slots, so a filter or comparison on the join key saw a column of the wrong type. Surfaced by AST fuzzer as STID 2139-5111 and reported in [#107272](https://github.com/ClickHouse/ClickHouse/issues/107272). [#104174](https://github.com/ClickHouse/ClickHouse/pull/104174) ([Groene AI](https://github.com/groeneai)).
* Reject out-of-range integer partition ID for `Date` instead of silent overflow or `LOGICAL_ERROR` on `ALTER`. [#104250](https://github.com/ClickHouse/ClickHouse/pull/104250) ([Azat Khuzhin](https://github.com/azat)).
* Disable `additional_table_filters` with parallel replicas and the analyzer without query plan serialization. Previously it could lead to incorrect results. [#104296](https://github.com/ClickHouse/ClickHouse/pull/104296) ([Azat Khuzhin](https://github.com/azat)).
* Fix `dictGetOrNull` silently overwriting other columns in the `SELECT` projection with `NULL` when called with a `Nullable` key column whose values are missing in the dictionary. The function was mutating an input-aliased null map in place; it now deep-clones the result column before mutation. Closes [#73633](https://github.com/ClickHouse/ClickHouse/issues/73633). [#104327](https://github.com/ClickHouse/ClickHouse/pull/104327) ([Groene AI](https://github.com/groeneai)).
* Fix a broken patch part after `ALTER TABLE ... DROP PARTITION ID 'patch-...'` followed by `DETACH`/`ATTACH TABLE`. Previously the empty covering part was written without `partition.dat` and `source_parts.dat`, leading to a `broken-on-start_patch-...` entry in `system.detached_parts` after the next attach or server restart. Closes [#93132](https://github.com/ClickHouse/ClickHouse/issues/93132). Closes [#102103](https://github.com/ClickHouse/ClickHouse/issues/102103). [#104353](https://github.com/ClickHouse/ClickHouse/pull/104353) ([Groene AI](https://github.com/groeneai)).
* Fixed streaming `INSERT` with `input_format_max_block_wait_ms` for the `HTTP` interface and for `INSERT SELECT FROM input`, so partial input blocks are flushed before the request finishes. [#104534](https://github.com/ClickHouse/ClickHouse/pull/104534) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a bug where queries combining `arrayJoin` with `ORDER BY ... LIMIT` after a `JOIN` could silently return zero rows. The query plan optimization that lifts function evaluation above the `SortingStep` no longer applies when the lifted expression contains `arrayJoin`, since `arrayJoin` can change the number of rows. Closes [#82279](https://github.com/ClickHouse/ClickHouse/issues/82279). [#104558](https://github.com/ClickHouse/ClickHouse/pull/104558) ([Groene AI](https://github.com/groeneai)).
* Fix a rare server abort during `MergeTree` family table destruction. The abort could occur when `shutdown` raised an exception before the background-job scheduler was fully stopped: a background task firing in that narrow window would dispatch a virtual call through a partially-destroyed storage object and hit `__cxa_pure_virtual`. [#104561](https://github.com/ClickHouse/ClickHouse/pull/104561) ([Groene AI](https://github.com/groeneai)).
* Fix inconsistent result in `JSON` combined subcolumn with a type hint containing null value. [#104584](https://github.com/ClickHouse/ClickHouse/pull/104584) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix wrong results or missed projection when an aggregate projection contains multiple `sumIf` aggregates with different `IN (...)` conditions. [#104765](https://github.com/ClickHouse/ClickHouse/pull/104765) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix wrong row count from `arrayJoin()` used inside `JOIN ON`: the result was multiplied by the array length an extra time. [#104785](https://github.com/ClickHouse/ClickHouse/pull/104785) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix `deltaSumTimestamp` returning wrong results for signed integer types crossing zero. Resolves [#104750](https://github.com/ClickHouse/ClickHouse/issues/104750). [#104830](https://github.com/ClickHouse/ClickHouse/pull/104830) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix block structure mismatch in UnionStep after filter push-down with NULL constants. Closes [#104821](https://github.com/ClickHouse/ClickHouse/issues/104821). [#104853](https://github.com/ClickHouse/ClickHouse/pull/104853) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `Logical error: 'Metadata is not initialized'` raised by `DELETE FROM` on a freshly-attached `Iceberg`, `DeltaLake`, or `Hudi` table whose metadata file is corrupted or unloadable. A regular user-facing exception is reported instead, and the server keeps running. Closes [#104891](https://github.com/ClickHouse/ClickHouse/issues/104891). [#104917](https://github.com/ClickHouse/ClickHouse/pull/104917) ([Groene AI](https://github.com/groeneai)).
* Fixed the `max_memory_usage_soft_limit` was not updated on-the-fly when the configuration changed. The soft memory limit was calculated once at startup and cached, so subsequent config reloads had no effect. After this fix, the limit is recalculated and applied immediately on every config reload, no Keeper restart required. [#104940](https://github.com/ClickHouse/ClickHouse/pull/104940) ([Kai Zhu](https://github.com/nauu)).
* Fix JIT symbol resolution on macOS so that sort, expression, and aggregate JIT compilation no longer fail with `CANNOT_COMPILE_CODE: Could not find symbol _<name>`. [#104946](https://github.com/ClickHouse/ClickHouse/pull/104946) ([Alexei Fedotov](https://github.com/leshikus)).
* Fix an exception (`Received signal 6 (abort)` in vector hardening, observable as `Tuple::back()` on an empty vector) when executing a query of the form `SELECT ... FROM <Distributed table> WHERE/HAVING/GROUP BY ... (sharding_key_column IN tuple())` with `optimize_skip_unused_shards_rewrite_in` enabled under the new analyzer. [#104966](https://github.com/ClickHouse/ClickHouse/pull/104966) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `Logical error: 'Inconsistent AST formatting'` server abort (STID 1941-1bfa) on queries like `CREATE TABLE t (c0 Int CODEC(not((not(materialize(1), materialize(2)))), ZSTD)) ENGINE = Memory` in debug / sanitiser builds. The formatter no longer emits redundant outer parens around a multi-argument `tuple(...)` function call that appears inside `CODEC` / `STATISTICS` / `BACKUP_NAME` argument lists (where the operator form `(a, b)` is disabled), keeping the format-parse-format round-trip stable. [#104991](https://github.com/ClickHouse/ClickHouse/pull/104991) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` thrown by `ALTER TABLE ... MATERIALIZE INDEX` on parts that were created in 25.8 and contain a skip index over a column that was added with a separate `ALTER TABLE ... ADD COLUMN`. The mutation now correctly reads every column required by every pre-existing skip index and projection on the part during force-recalculation. Closes [#104872](https://github.com/ClickHouse/ClickHouse/issues/104872). [#105039](https://github.com/ClickHouse/ClickHouse/pull/105039) ([Groene AI](https://github.com/groeneai)).
* Fixed two `LOGICAL_ERROR: Reading from materialized CTE 'X' before it has been materialized` shapes thrown by queries with `enable_materialized_cte`: (1) a reused materialized CTE filtered by `IN (subquery)` over another materialized CTE, and (2) a materialized CTE referenced both directly and inside a `WHERE ... IN (...)` filter that hits a MergeTree primary key through a nested IN-subquery. `EXPLAIN` on the same queries was affected too because the bugs fired during plan optimization. Closes [#101940](https://github.com/ClickHouse/ClickHouse/issues/101940), closes [#102320](https://github.com/ClickHouse/ClickHouse/issues/102320). [#105041](https://github.com/ClickHouse/ClickHouse/pull/105041) ([Dmitry Novik](https://github.com/novikd)).
* Fix `countmin` statistics `PREWHERE` selectivity estimation for `Float32` columns. Two bugs caused `countmin` statistics to silently produce wrong estimates for `Float32` columns: `ConditionSelectivityEstimator` skipped statistics entirely when the column type (`Float32`) was narrower than the literal type (`Float64`), falling back to default selectivity and ignoring the sketch; and `StatisticsCountMinSketch::estimateEqual` hashed the first N bytes of a `Field` object, but `Field` stores `Float32` as `Float64` (`NearestFieldType<Float32>` = `Float64`), so the byte pattern used at query time differed from the actual `Float32` bytes stored during build. [#105047](https://github.com/ClickHouse/ClickHouse/pull/105047) ([Han Fei](https://github.com/hanfei1991)).
* `ATTACH TABLE name <clauses>;` queries that supply storage clauses (`ORDER BY`, `PARTITION BY`, `PRIMARY KEY`, `SAMPLE BY`, `TTL`, `UNIQUE KEY`, or engine `SETTINGS`) without an `ENGINE` now throw `BAD_ARGUMENTS` instead of silently re-attaching the table with its stored definition and discarding the user-supplied clauses. Query-level session `SETTINGS` (such as `log_comment`) are still applied. Use `ATTACH TABLE t;` to re-attach with stored metadata, or `ALTER TABLE t MODIFY SETTING ...` after `ATTACH` to change settings. [#105068](https://github.com/ClickHouse/ClickHouse/pull/105068) ([Groene AI](https://github.com/groeneai)).
* Fixes a use-after-free in `runningAccumulate` when called on a column whose aggregate function returns its own state (e.g. `uniqStateOrDefaultState`, `sumStateOrDefaultState`, `uniqStateForEachState`). [#105085](https://github.com/ClickHouse/ClickHouse/pull/105085) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fixed a bug in the Web UI (`play.html`): running a query while the cursor was past the only trailing `;` reported "empty query" instead of running the query. [#105107](https://github.com/ClickHouse/ClickHouse/pull/105107) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR: 'No user in current context, it's a bug'` when a `CREATE TABLE ... AS SELECT` inside a `Replicated` database reads from `system.current_roles` or `system.enabled_roles`. The query now succeeds and returns an empty result set in this internal DDL worker context. [#105150](https://github.com/ClickHouse/ClickHouse/pull/105150) ([Groene AI](https://github.com/groeneai)).
* Fixed `ILLEGAL_TYPE_OF_ARGUMENT` when merging `quantileExactWeightedInterpolated`, `quantileDD`, or `quantilePrometheusHistogram` aggregate states with their plural `quantilesXxxMerge` counterparts (and vice versa). The singular and plural variants of these three quantile families share the same internal aggregate state but were not listed in the internal name-mapping table, so cross-function state merge — and the function-fusion optimization for these families — were rejected. [#105189](https://github.com/ClickHouse/ClickHouse/pull/105189) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect results of `toStartOfWeek`, `toLastDayOfWeek`, `toMonday`, `toStartOfMonth`, `toLastDayOfMonth`, `toStartOfQuarter` and `toStartOfYear` for `Date32` and `DateTime64` arguments whose result falls outside the `Date` range: instead of overflowing into arbitrary dates, results before `1970-01-01` are now clamped to `1970-01-01` and results after `2149-06-06` are clamped to `2149-06-06`. This also fixes wrong query results (incorrectly pruned parts and granules) when such functions were used in `WHERE` over a `Date32` or `DateTime64` key containing out-of-range values. [#105244](https://github.com/ClickHouse/ClickHouse/pull/105244) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix a logical error in `arrayRemove` when the first argument is an array of `Variant` whose alternatives are all incompatible with the type of the second argument and `variant_throw_on_type_mismatch` is disabled. The function now treats the comparison as "never equal" and returns the array unchanged instead of triggering a server-side `assertTypeEquality` failure. [#105248](https://github.com/ClickHouse/ClickHouse/pull/105248) ([Groene AI](https://github.com/groeneai)).
* Query can be executed successfully even if `FileCache` fails to create some directory on disk for caching. [#105250](https://github.com/ClickHouse/ClickHouse/pull/105250) ([Den Kalantaevskii](https://github.com/Diskein)).
* Fix server abort with `Assertion 'px != 0' failed` in `ExtremesTransform` when a query with `extremes = 1` hits an exception (for example `MEMORY_LIMIT_EXCEEDED`) while the transform is building its extremes columns from the first chunk. The client now receives the original exception instead of crashing the server. [#105264](https://github.com/ClickHouse/ClickHouse/pull/105264) ([Groene AI](https://github.com/groeneai)).
* `LEFT ANTI JOIN` now correctly returns the right-side join key column with default values for unmatched rows, instead of duplicating the left key value. Previously, `SELECT a.x AS l, b.x AS r FROM a LEFT ANTI JOIN b ON a.x = b.x` could return `r = a.x` for the unmatched rows when it should return the default (`0` for `Int32`, `''` for `String`, `NULL` for `Nullable`). Only the join key column was affected; non-key right columns were already defaulted correctly. The same bug appeared in `RIGHT ANTI JOIN` whenever the optimizer swapped sides. Closes [#99959](https://github.com/ClickHouse/ClickHouse/issues/99959). [#105278](https://github.com/ClickHouse/ClickHouse/pull/105278) ([Groene AI](https://github.com/groeneai)).
* Fix data loss in `clickhouse-local` when started repeatedly with a non-default `--default_database` (for example `clickhouse-local --path X -- --default_database=mydb`): the lookup for the persisted database UUID was hardcoded to `metadata/default`, so each restart minted a fresh UUID and the previous run's tables became invisible. Closes [#101831](https://github.com/ClickHouse/ClickHouse/issues/101831). [#105284](https://github.com/ClickHouse/ClickHouse/pull/105284) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error `Mutation of `Memory` table produced incomplete output` raised when running `ALTER TABLE <memory_table> APPLY PATCHES` or `ALTER TABLE <memory_table> APPLY DELETED MASK`. `Memory` tables do not own patch parts or deletion masks, so both commands are now correctly treated as no-ops. [#105286](https://github.com/ClickHouse/ClickHouse/pull/105286) ([Groene AI](https://github.com/groeneai)).
* Fix long-running queries with Unity Catalog by passing a `table_id` parameter in the query request. [#105303](https://github.com/ClickHouse/ClickHouse/pull/105303) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix `CANNOT_CONVERT_TYPE` for `Merge` over `Merge` over `Distributed` with `distributed_group_by_no_merge=1`. [#105330](https://github.com/ClickHouse/ClickHouse/pull/105330) ([Azat Khuzhin](https://github.com/azat)).
* Fix `clickhouse local` and `clickhouse client` silently ignoring `--query`/`-q` when a positional file argument was also given. Both forms now produce `BAD_ARGUMENTS` consistently. [#105334](https://github.com/ClickHouse/ClickHouse/pull/105334) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `REPLACE TEMPORARY TABLE` silently creating a new table when the target didn't exist. It now throws `UNKNOWN_TABLE`, matching `REPLACE TABLE` semantics. Use `CREATE OR REPLACE TEMPORARY TABLE` to keep the create-or-replace behavior. [#105373](https://github.com/ClickHouse/ClickHouse/pull/105373) ([Groene AI](https://github.com/groeneai)).
* Fixed long-running reads (e.g. `INSERT ... SELECT`) from a `DataLakeCatalog` database with `catalog_type = 'glue'` failing with an `ExpiredToken` error once the STS session credentials captured at table-metadata load time crossed their expiry. The AWS STS credentials are now refreshed mid-query, so such reads continue past the token's expiry. [#105381](https://github.com/ClickHouse/ClickHouse/pull/105381) ([Pratima Patel](https://github.com/pratimapatel2008)).
* Fix logical error in negative `LIMIT BY` in some cases when used with `ARRAY JOIN`. [#105403](https://github.com/ClickHouse/ClickHouse/pull/105403) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix inflated `read_bytes` (and the derived bytes/s shown in `system.query_log`, progress bar, etc.) when reading Parquet files. The previous implementation reported the row group's total compressed size on every chunk, so reading K of N columns overcounted by `N / K`. It is now summed only across the selected columns. Also fixes file-level progress tracking for Iceberg tables, which previously never reported the data file size. [#105413](https://github.com/ClickHouse/ClickHouse/pull/105413) ([Groene AI](https://github.com/groeneai)).
* Fixed a possible server segfault in cluster table functions (`s3Cluster`, `urlCluster`, `fileCluster`, ...) when the planner produces a `SELECT` with the `recursive_with` flag set but no `WITH` expression. Closes [#105370](https://github.com/ClickHouse/ClickHouse/issues/105370). [#105433](https://github.com/ClickHouse/ClickHouse/pull/105433) ([Groene AI](https://github.com/groeneai)).
* Fix wrong result of `countDistinct` / `uniqExact` on `Nullable` columns when `count_distinct_optimization = 1` (the NULL group was incorrectly counted). [#105439](https://github.com/ClickHouse/ClickHouse/pull/105439) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a heap-buffer-overflow when reading Arrow or ArrowStream files with corrupted intermediate offsets in a binary or string column, and a null-pointer dereference when reading geo-tagged Arrow columns. [#105449](https://github.com/ClickHouse/ClickHouse/pull/105449) ([Raúl Marín](https://github.com/Algunenano)).
* Validate `Dynamic`/`Variant` types in window `PARTITION BY`, it was not checked before when `allow_suspicious_types_in_group_by` is disabled. Closes [#105028](https://github.com/ClickHouse/ClickHouse/issues/105028). [#105450](https://github.com/ClickHouse/ClickHouse/pull/105450) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `input_format_json_empty_as_default` not working in JSONStrings\* formats. Closes [#104913](https://github.com/ClickHouse/ClickHouse/issues/104913). [#105453](https://github.com/ClickHouse/ClickHouse/pull/105453) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `NULL` insert into `Variant` column via `VALUES` format during expression parsing. Closes [#104909](https://github.com/ClickHouse/ClickHouse/issues/104909). [#105455](https://github.com/ClickHouse/ClickHouse/pull/105455) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `dictGetOrDefault` throwing `CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN` when the default argument is a `Nullable` expression and `short_circuit_function_evaluation` is enabled with a mix of found and not-found dictionary keys. [#105461](https://github.com/ClickHouse/ClickHouse/pull/105461) ([Raúl Marín](https://github.com/Algunenano)).
* Fix silent value truncation in `Dynamic` columns when the `Quoted` (Values) text reader falls back to `String` for incomplete inferred types like `Map(Array(Nothing), ...)`. Previously the fallback wrapped the raw field with naive `'...'` concatenation, so an inner single quote (always present for such fallbacks) prematurely terminated the quoted string and the rest of the value was lost. [#105463](https://github.com/ClickHouse/ClickHouse/pull/105463) ([Groene AI](https://github.com/groeneai)).
* Fix SIGSEGV when reading `Dynamic` subcolumns from compressed `Memory` table after `ALTER`. Closes [#104901](https://github.com/ClickHouse/ClickHouse/issues/104901). [#105464](https://github.com/ClickHouse/ClickHouse/pull/105464) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `toFloat64`/`toUInt32`/`toString`/etc. on `Dynamic` ignoring `cast_keep_nullable`. Closes [#104789](https://github.com/ClickHouse/ClickHouse/issues/104789). [#105467](https://github.com/ClickHouse/ClickHouse/pull/105467) ([Pavel Kruglov](https://github.com/Avogar)).
* Include `skip_first_lines` in schema cache key for `WithNames` formats. Closes [#104527](https://github.com/ClickHouse/ClickHouse/issues/104527). [#105469](https://github.com/ClickHouse/ClickHouse/pull/105469) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a server segfault in `uniqStateOrNull` / `uniqStateOrDefault` / `uniqOrNullState` (and similar combinator chains over `uniq`) when used with `GROUP BY ... WITH ROLLUP`, `WITH CUBE`, or `WITH TOTALS` and a Nullable argument. [#105470](https://github.com/ClickHouse/ClickHouse/pull/105470) ([Groene AI](https://github.com/groeneai)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` exception when combining `ORDER BY ... WITH FILL INTERPOLATE` and `LIMIT N BY` with the analyzer enabled. Closes [#103474](https://github.com/ClickHouse/ClickHouse/issues/103474). [#105481](https://github.com/ClickHouse/ClickHouse/pull/105481) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix `toStartOfMillisecond` and `toStartOfMicrosecond` returning a result off by nearly a second for negative (pre-epoch) `DateTime64` values, and fix `UndefinedBehaviorSanitizer` signed-integer-overflow in `toStartOfSecond`, `toStartOfMillisecond`, and `toStartOfMicrosecond` for `DateTime64` inputs near `INT64_MIN`. [#105482](https://github.com/ClickHouse/ClickHouse/pull/105482) ([Groene AI](https://github.com/groeneai)).
* Add a new compatibility setting `analyzer_compatibility_prefer_alias_over_subcolumn` (disabled by default). When enabled, the new analyzer prefers the alias-prefix interpretation over `Tuple`-subcolumn / dotted-column matches for multi-part identifiers, restoring the previous interpreter's behavior. This avoids `AMBIGUOUS_IDENTIFIER` (and related) errors when a query joins a table whose name matches an inner table of a CTE/subquery that uses `SELECT *` over a join, where asterisk-renamed columns (e.g. `b.id`) would otherwise leak the inner table identifiers into the outer scope. [#105491](https://github.com/ClickHouse/ClickHouse/pull/105491) ([Vladimir Cherkasov](https://github.com/vdimir)).
* A vector search query executed with the *index only* optimization now returns the correct value for `L2Distance()` if it is in the `SELECT` list. The function was incorrectly returning the *L2-squared* distance value. Note that the vector search query was returning the correctly ranked results, only applications **explicitly retrieving and interpreting** the `L2Distance()` value would have seen the squared value. [#105495](https://github.com/ClickHouse/ClickHouse/pull/105495) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Fixed a rare issue in new Kafka table engine where messages could be incorrectly handled during topic partition reassignment, potentially leading to skipped messages after offset rollback. [#105500](https://github.com/ClickHouse/ClickHouse/pull/105500) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix an exception (`Trying to execute PLACEHOLDER action` logical error) when a `MATERIALIZED` CTE whose body is a correlated subquery is used as the right-hand side of `IN`. Such a CTE is now rejected at analysis time, consistent with how the same pattern is already rejected when the CTE is referenced directly in `FROM`. [#105518](https://github.com/ClickHouse/ClickHouse/pull/105518) ([Groene AI](https://github.com/groeneai)).
* Fix stdout/stdin compression not applied when format is explicitly specified. Closes [#104441](https://github.com/ClickHouse/ClickHouse/issues/104441). [#105528](https://github.com/ClickHouse/ClickHouse/pull/105528) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix SEGFAULT in `singleValueOrNull` deserialization for `JSON` type. Closes [#103630](https://github.com/ClickHouse/ClickHouse/issues/103630). [#105535](https://github.com/ClickHouse/ClickHouse/pull/105535) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `clickhouse-format --backslash` silently dropping `INSERT` `VALUES` data. Closes [#103533](https://github.com/ClickHouse/ClickHouse/issues/103533). [#105536](https://github.com/ClickHouse/ClickHouse/pull/105536) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `variant_throw_on_type_mismatch/dynamic_throw_on_type_mismatch=false` not catching exceptions during function execution. Closes [#103484](https://github.com/ClickHouse/ClickHouse/issues/103484). [#105543](https://github.com/ClickHouse/ClickHouse/pull/105543) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix ignoring `input_format_try_infer_datetimes` during insertion into shared data in `JSON`. Closes [#103221](https://github.com/ClickHouse/ClickHouse/issues/103221). [#105544](https://github.com/ClickHouse/ClickHouse/pull/105544) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `histogram` producing wrong results for small unsorted inputs. Closes [#103109](https://github.com/ClickHouse/ClickHouse/issues/103109). [#105548](https://github.com/ClickHouse/ClickHouse/pull/105548) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `DateTime` wrapping around for out-of-range values in `JSONExtract` and text deserializations. Closes [#103094](https://github.com/ClickHouse/ClickHouse/issues/103094). [#105551](https://github.com/ClickHouse/ClickHouse/pull/105551) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix usage of insertion table in table functions when `optimize_trivial_insert_select` is enabled. Closes [#103083](https://github.com/ClickHouse/ClickHouse/issues/103083). [#105555](https://github.com/ClickHouse/ClickHouse/pull/105555) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `CASE` expression returning the `ELSE` branch instead of the matching `THEN` when both the expression and a `WHEN` value were `NULL`. [#105556](https://github.com/ClickHouse/ClickHouse/pull/105556) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a crash in `replxx` caused by hitting the `FD_SETSIZE` limitation of `select` (now replaced with `poll`). Previously, with SSH or the web terminal enabled, this could crash the server. [#105559](https://github.com/ClickHouse/ClickHouse/pull/105559) ([Azat Khuzhin](https://github.com/azat)).
* Materialize subcolumns in `executePartitionByExpression` before executing expression. Closes [#103057](https://github.com/ClickHouse/ClickHouse/issues/103057). [#105573](https://github.com/ClickHouse/ClickHouse/pull/105573) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` exception when `TTL` expression references a subcolumn. [#105578](https://github.com/ClickHouse/ClickHouse/pull/105578) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a server crash (SIGSEGV) reachable by any user with `CREATE TABLE` rights when sending `CREATE TABLE ... TO INNER UUID '...'` without an `ENGINE` clause over HTTP or the native protocol. The same bug also crashed the client. The parser now reports a proper `BAD_ARGUMENTS` error instead of dereferencing a null pointer. [#105579](https://github.com/ClickHouse/ClickHouse/pull/105579) ([Groene AI](https://github.com/groeneai)).
* Fix `estimateCompressionRatio` window function losing accumulated data between rows. Closes [#101738](https://github.com/ClickHouse/ClickHouse/issues/101738). [#105581](https://github.com/ClickHouse/ClickHouse/pull/105581) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix crash when inserting tuples of different sizes in the same VALUES clause into a `String` column. Closes [#101727](https://github.com/ClickHouse/ClickHouse/issues/101727). [#105582](https://github.com/ClickHouse/ClickHouse/pull/105582) ([Pavel Kruglov](https://github.com/Avogar)).
* Hive partition value extraction now honors the `cast_string_to_date_time_mode` setting and accepts ISO 8601 timestamps with timezone suffixes (e.g. `+0000`, `+00:00`, `Z`) in partition keys by default. [#105584](https://github.com/ClickHouse/ClickHouse/pull/105584) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixes `NOT_IMPLEMENTED` error on `toString` from `DateTime` with Timezone containing `NULL` value. Closes [#103712](https://github.com/ClickHouse/ClickHouse/issues/103712). [#105587](https://github.com/ClickHouse/ClickHouse/pull/105587) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix OOB read in flattened `Dynamic` column `Native` deserialization. [#105666](https://github.com/ClickHouse/ClickHouse/pull/105666) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a `LOGICAL_ERROR` (`Unexpected return type from if`) raised during query planning for `if` expressions whose result type is `Variant` and whose second-or-third branch is a constant-condition `if` over a `UInt64` literal that fits into `Int64`. Closes [#105649](https://github.com/ClickHouse/ClickHouse/issues/105649). [#105680](https://github.com/ClickHouse/ClickHouse/pull/105680) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results when reading an Iceberg table with `iceberg_use_version_hint = 1` after another writer (such as the `icebergLocal`/`icebergS3` table function) without the setting advances the table. `version-hint.text` is now kept in sync by every writer once the file exists, so subsequent readers using the hint see the latest snapshot. [#105682](https://github.com/ClickHouse/ClickHouse/pull/105682) ([Groene AI](https://github.com/groeneai)).
* Fixed a silent under-count in `SELECT` queries when `use_query_condition_cache = 1` (default). A query of the shape `PREWHERE pk_prefix = X WHERE non_pk IN (...)` against a column with a bloom-filter skip index poisoned the `QueryConditionCache` for the `pk_prefix = X` predicate, so a subsequent benign `SELECT count() ... WHERE pk_prefix = X` returned an incorrect, under-counted result. Affected all 26.x releases. [#104781](https://github.com/ClickHouse/ClickHouse/issues/104781). [#105686](https://github.com/ClickHouse/ClickHouse/pull/105686) ([Groene AI](https://github.com/groeneai)).
* Fixed `singleValueOrNullMerge` returning a concrete value instead of `NULL` when merging a state that had already observed multiple distinct values. [#105734](https://github.com/ClickHouse/ClickHouse/pull/105734) ([Minh Vu](https://github.com/fallintoplace)).
* Fix `Template` input format error recovery after malformed rows. [#105735](https://github.com/ClickHouse/ClickHouse/pull/105735) ([Yue Ni](https://github.com/niyue)).
* Fix a crash in the `mongodb` table function, MongoDB storage and MongoDB dictionary source when the collection name is empty or contains NUL bytes. [#105776](https://github.com/ClickHouse/ClickHouse/pull/105776) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `Keeper` snapshot cleanup after failed writes so partial snapshots are cleaned up safely and failed writes can be retried without advancing `latest_snapshot_meta`. [#105779](https://github.com/ClickHouse/ClickHouse/pull/105779) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix `ALTER TABLE ... CLEAR COLUMN` being rejected for explicit `SummingMergeTree` and `CoalescingMergeTree` `columns_to_sum` columns. [#105785](https://github.com/ClickHouse/ClickHouse/pull/105785) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed an assertion in `DatabaseCatalog::tryGetDatabase` (and resulting `UNKNOWN_DATABASE` error in release builds) when creating a parameterized view whose database name is supplied via a query parameter, for example `CREATE VIEW {db:Identifier}.v AS SELECT {p:UInt64}`. Parameters in the DDL parts of the `CREATE` statement are now substituted at create time, while parameters in the SELECT body remain available for substitution at view-call time. [#105799](https://github.com/ClickHouse/ClickHouse/pull/105799) ([Groene AI](https://github.com/groeneai)).
* Fix `Bad get: has Decimal32, requested Decimal128` from `sumMap` and `sumMapWithOverflow` over a `Nested(... Nullable(Decimal(P, S)))` column when the aggregate state is serialised (e.g. parallel replicas, `sumMapState` via a binary-state formatter, external aggregation). [#105816](https://github.com/ClickHouse/ClickHouse/pull/105816) ([Groene AI](https://github.com/groeneai)).
* Fix `Expected ColumnLowCardinality, got String` / `Bad cast from type DB::ColumnString to DB::ColumnLowCardinality` errors when `apply_mutations_on_fly = 1` is used on a table with pending on-fly `UPDATE`/`DELETE` mutations queued before an `ALTER MODIFY COLUMN ... LowCardinality(...)` mutation. [#105847](https://github.com/ClickHouse/ClickHouse/pull/105847) ([Raúl Marín](https://github.com/Algunenano)).
* Iceberg writes now preserve NULL values in `Nullable(T)` partition columns. Previously, a NULL written by ClickHouse showed up as the default value of the inner type (`0` for `int`) when read back by Spark or other Iceberg readers. Closes [#105852](https://github.com/ClickHouse/ClickHouse/issues/105852). [#105862](https://github.com/ClickHouse/ClickHouse/pull/105862) ([Groene AI](https://github.com/groeneai)).
* Fixed `Parquet` and `ORC` filter pushdown for `IN (subquery)` predicates, allowing row-group/page/bloom-filter pruning to work for `file`, `url`, `s3`, and object-storage reads. [#105863](https://github.com/ClickHouse/ClickHouse/pull/105863) ([Arsen Muk](https://github.com/arsenmuk)).
* Fix read-in-order for `Merge` tables (with a new analyzer). [#105867](https://github.com/ClickHouse/ClickHouse/pull/105867) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed Iceberg v2 merge-on-read position deletes returning wrong rows when a single delete file references multiple data files and several such delete files apply to the same data file. The streaming reader (`use_roaring_bitmap_iceberg_positional_deletes = 0`) now filters delete-file rows by `file_path` in C++ instead of relying on Parquet row-group pruning, restoring the ascending-positions invariant. [#105888](https://github.com/ClickHouse/ClickHouse/pull/105888) ([Groene AI](https://github.com/groeneai)).
* Fix `Cannot find column` error for distributed queries with `IN Array(...)` filter for the new analyzer. [#105894](https://github.com/ClickHouse/ClickHouse/pull/105894) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix a SIGSEGV in `ALTER TABLE ... MODIFY COLUMN ... Nullable(...)` on `MergeTree` tables when a column with `STATISTICS` is concurrently dropped by another `ALTER`. Closes [#105912](https://github.com/ClickHouse/ClickHouse/issues/105912). [#105917](https://github.com/ClickHouse/ClickHouse/pull/105917) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash that could occur when a query reading from PostgreSQL — via the postgresql table function, the PostgreSQL table engine, or a dictionary with a PostgreSQL source — was cancelled (for example with KILL QUERY) and cancelling the remote PostgreSQL query failed. [#105949](https://github.com/ClickHouse/ClickHouse/pull/105949) ([Rory Shanks](https://github.com/rorylshanks)).
* Fix `SYSTEM INSTRUMENT ADD` formatting so handler arguments are separated by a single space, and reject invalid `SLEEP` instrumentation argument lists with more than two values or a range where the minimum is greater than the maximum. [#105984](https://github.com/ClickHouse/ClickHouse/pull/105984) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix possibly wrong results for queries that combine an outer join with a subsequent inner join referencing the outer join's null-supplying side. Join reordering could pick a plan that pulled inner-join conditions into the outer join's ON clause. [#105992](https://github.com/ClickHouse/ClickHouse/pull/105992) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a possible crash due to a too-large string literal sent within the query. [#105996](https://github.com/ClickHouse/ClickHouse/pull/105996) ([Nikita Taranov](https://github.com/nickitat)).
* Fix `INVALID_WITH_FILL_EXPRESSION` exception when using `INTERPOLATE ()` (empty) with a sorting prefix in `ORDER BY` and `use_with_fill_by_sorting_prefix` enabled. Sorting prefix columns are now correctly excluded from the implicit interpolation set, matching the behavior of explicitly named `INTERPOLATE (col)`. [#106001](https://github.com/ClickHouse/ClickHouse/pull/106001) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix `ALTER TABLE` partition operations silently failing for `Bool` partition keys. Closes [#101722](https://github.com/ClickHouse/ClickHouse/issues/101722). [#106004](https://github.com/ClickHouse/ClickHouse/pull/106004) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `JSONExtractRaw` and `JSONHas` for typed `JSON` paths with default values. Closes [#101721](https://github.com/ClickHouse/ClickHouse/issues/101721). [#106005](https://github.com/ClickHouse/ClickHouse/pull/106005) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix incorrect '/'-prefix addition on empty basepaths in data lake configurations. Closes [#105989](https://github.com/ClickHouse/ClickHouse/issues/105989). [#106013](https://github.com/ClickHouse/ClickHouse/pull/106013) ([thewisenerd](https://github.com/thewisenerd)).
* Fix `IcebergLocal` table engine becoming read-only after a `DETACH` + `ATTACH` cycle or a server restart, which made every subsequent `INSERT` fail with `Local object storage Local is readonly. (READONLY)`. [#106016](https://github.com/ClickHouse/ClickHouse/pull/106016) ([Groene AI](https://github.com/groeneai)).
* Fix `Keeper` failures during follower catch-up when the new request dispatcher response queue could fill before the response thread started. [#106049](https://github.com/ClickHouse/ClickHouse/pull/106049) ([Antonio Andelic](https://github.com/antonio2368)).
* Better compatibility with the old analyzer. If the table has columns like `x.a Array, x.b Array, x String`, prefer arrays for `ARRAY JOIN x`. [#106069](https://github.com/ClickHouse/ClickHouse/pull/106069) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed the filesystem cache being silently disabled for Azure Blob Storage (e.g. Delta Lake tables over Azure) because object metadata did not include the blob ETag. [#106091](https://github.com/ClickHouse/ClickHouse/pull/106091) ([thewisenerd](https://github.com/thewisenerd)).
* Fix `system.dictionaries` returning 0 rows with partial `SHOW DICTIONARIES` revoke. [#106105](https://github.com/ClickHouse/ClickHouse/pull/106105) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed a server crash when querying DeltaLake tables with `allow_experimental_delta_kernel_rs` enabled and a credential or option that contained invalid bytes (the Rust FFI panicked across the `extern "C"` boundary). [#106109](https://github.com/ClickHouse/ClickHouse/pull/106109) ([Raúl Marín](https://github.com/Algunenano)).
* Fix incorrect results for queries against tables whose `ORDER BY` contains a monotonically decreasing function such as `(c0 / -42)` or `intDiv(c0, -42)`. Predicates on the underlying column (for example, `c0 < 0`) could wrongly prune granules that contained matching rows, producing missing results. Closes [#106084](https://github.com/ClickHouse/ClickHouse/issues/106084). Closes [#106124](https://github.com/ClickHouse/ClickHouse/issues/106124). Closes [#106080](https://github.com/ClickHouse/ClickHouse/issues/106080). [#106136](https://github.com/ClickHouse/ClickHouse/pull/106136) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix support for using `WASM` SQL UDFs in `MATERIALIZED VIEW` definitions. [#106161](https://github.com/ClickHouse/ClickHouse/pull/106161) ([Yue Ni](https://github.com/niyue)).
* Iceberg partition pruning now correctly handles `WHERE partition_col = (SELECT ... FROM ...)` filters where the analyzer wraps the scalar subquery result in an internal `_CAST(Const, 'TargetType')` with matching source and target types. Previously such filters disabled partition pruning and triggered a full table scan. [#106204](https://github.com/ClickHouse/ClickHouse/pull/106204) ([Groene AI](https://github.com/groeneai)).
* Fix clickhouse local's `--query_id` parameter to allow it to specify custom query id. [#106205](https://github.com/ClickHouse/ClickHouse/pull/106205) ([Yue Ni](https://github.com/niyue)).
* Fixed the S3 storage class (`s3_storage_class` / `s3_storage_class_name`) being ignored for objects written via multipart upload on `S3` disks and object storage, which caused large objects to be created with the default `STANDARD` class. The option name is now accepted both as `s3_storage_class` and `s3_storage_class_name` for disks, object storage and backups. [#106214](https://github.com/ClickHouse/ClickHouse/pull/106214) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed Keeper sometimes getting stuck on startup when setting `nuraft_max_log_gap_in_stream` is set to non-default value (default is 0, i.e. disable pipelining of `append_entries` requests). [#106220](https://github.com/ClickHouse/ClickHouse/pull/106220) ([Michael Kolupaev](https://github.com/al13n321)).
* Validate corrupted `DDSketch` aggregate-function state (bin keys) on insertion instead of accepting malformed data. [#106236](https://github.com/ClickHouse/ClickHouse/pull/106236) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed coordinator mode mismatch when subqueries override in-order settings. [#106243](https://github.com/ClickHouse/ClickHouse/pull/106243) ([Nikita Taranov](https://github.com/nickitat)).
* Fix `optimize_skip_unused_shards` did not apply (and `force_optimize_skip_unused_shards` falsely failing) when a `Distributed` table is queried through a `Merge` table or the `merge` table function, with the predicate applied above it. [#106250](https://github.com/ClickHouse/ClickHouse/pull/106250) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix `INTERPOLATE ()` throwing `INVALID_WITH_FILL_EXPRESSION` when `ORDER BY` columns are aliased in the `SELECT` list with the old analyzer. Closes [#106248](https://github.com/ClickHouse/ClickHouse/issues/106248). [#106252](https://github.com/ClickHouse/ClickHouse/pull/106252) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fixed an abort when deserialising a malformed `AggregateFunction(uniqTheta, ...)` state from `RowBinary` input or a query parameter. The bad input is now rejected with `CORRUPTED_DATA` instead of escaping as a `std::exception` and aborting the process via `abortOnFailedAssertion`. [#106260](https://github.com/ClickHouse/ClickHouse/pull/106260) ([Groene AI](https://github.com/groeneai)).
* Reject out-of-range `IntervalKind` bytes during `RowBinaryWithNamesAndTypes` type decoding (`input_format_binary_decode_types_in_binary_format = 1`) with a clear `INCORRECT_DATA` error instead of constructing a `DataTypeInterval` with an invalid kind that could subsequently trip undefined behavior in hash paths. [#106261](https://github.com/ClickHouse/ClickHouse/pull/106261) ([Groene AI](https://github.com/groeneai)).
* Fix `SLRU` downgrade failure rollback issue in `26.1+`. Fix `System`/`Data` cache split priority with `keep_free_space_ratio` feature. [#106286](https://github.com/ClickHouse/ClickHouse/pull/106286) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Read the `null` subcolumn as a `JSON` path in `Nullable(JSON)` instead of the null-map. Closes [#106085](https://github.com/ClickHouse/ClickHouse/issues/106085). [#106295](https://github.com/ClickHouse/ClickHouse/pull/106295) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `RestCatalog::empty` returning the wrong result when an Iceberg REST catalog contains tables. [#106301](https://github.com/ClickHouse/ClickHouse/pull/106301) ([Lefteris](https://github.com/LefterisXefteris)).
* Fixed an exception for `INNER JOIN` queries with an empty left `MergeTree` table when `enable_parallel_replicas`, `query_plan_use_new_logical_join_step`, and `query_plan_optimize_join_order_algorithm = 'greedy'` are enabled. [#106338](https://github.com/ClickHouse/ClickHouse/pull/106338) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed an incorrect conversion of subnormal `Float16` values to `Float32` (e.g. when reading them from Numpy `.npy` files), caused by an off-by-one mantissa shift. [#106343](https://github.com/ClickHouse/ClickHouse/pull/106343) ([Joanna Hulboj](https://github.com/jh0x)).
* Fix a crash and a possible `NOT_FOUND_COLUMN_IN_BLOCK` error when constraint-based optimization (`optimize_using_constraints`) is used with correlated subqueries. [#106349](https://github.com/ClickHouse/ClickHouse/pull/106349) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed an out-of-bounds read in `sipHash64Keyed`, `sipHash128Keyed` and `sipHash128ReferenceKeyed` when hashing a column whose arrays are all empty and the key is not constant. [#106355](https://github.com/ClickHouse/ClickHouse/pull/106355) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed `SYSTEM RELOAD CONFIG` discarding per-endpoint Azure Blob Storage settings (such as `use_native_copy`), which caused a disk's configured settings to be ignored for `BACKUP`/`RESTORE` until the server was restarted. [#106357](https://github.com/ClickHouse/ClickHouse/pull/106357) ([Julia Kartseva](https://github.com/jkartseva)).
* Fix `regexpExtract(haystack, pattern)` so that patterns without a capturing group return the whole match instead of throwing `INDEX_OF_POSITIONAL_ARGUMENT_IS_OUT_OF_RANGE`. [#106374](https://github.com/ClickHouse/ClickHouse/pull/106374) ([Groene AI](https://github.com/groeneai)).
* Fix `LOGICAL_ERROR` exception during cache predownload when a remote S3 object is overwritten with shorter content between listing and reading. [#106375](https://github.com/ClickHouse/ClickHouse/pull/106375) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix memory usage growth in filesystem cache. [#106387](https://github.com/ClickHouse/ClickHouse/pull/106387) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix multiple heap out-of-bounds reads in the Arrow IPC format reader (`ArrowColumnToCHColumn`). A malformed Arrow file could declare more rows than its buffers contain, declare list/struct/map child lengths inconsistent with their parent, supply non-monotonic list offsets, or truncate a child validity bitmap, causing reads past the end of heap allocations. This is reachable by any user with `SELECT` privilege via `file()`, `format()`, table functions, or ArrowFlight inputs. All data, offsets, view-struct, and validity-bitmap buffers are now validated before any raw pointer access, and list/struct/map shapes and offsets are checked for consistency. [#106395](https://github.com/ClickHouse/ClickHouse/pull/106395) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed backups failing with `FILE_DOESNT_EXIST` when a refreshable materialized view's REPLACE target is collected on a Replicated or Shared database whose materialized view isn't yet instantiated on the backup-initiating replica. [#106411](https://github.com/ClickHouse/ClickHouse/pull/106411) ([Julia Kartseva](https://github.com/jkartseva)).
* Fix a logical error `Column identifier ... is already registered` when a mutation (`DELETE`/`UPDATE`) predicate contains an `IN`/`EXISTS` subquery that reads from a default table expression nested in another subquery. [#106414](https://github.com/ClickHouse/ClickHouse/pull/106414) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a logical error (`Left and right columns have same names`) in the join order optimizer that could occur for joins executed with parallel replicas when two relations in the join graph share column names. [#106418](https://github.com/ClickHouse/ClickHouse/pull/106418) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a logical error when building a polygon dictionary from source data containing `NaN` or infinite point coordinates. Such coordinates are now rejected with a clear error. [#106423](https://github.com/ClickHouse/ClickHouse/pull/106423) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a bug where the `used_privileges` and `missing_privileges` columns of `system.query_log` could contain privilege strings leaked from unrelated earlier queries of a different user, database, or session. [#106425](https://github.com/ClickHouse/ClickHouse/pull/106425) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Functions `base58Encode`, `base58Decode` and `tryBase58Decode` now respect `max_execution_time` and query cancellation on large inputs, and reject inputs larger than 10 KB instead of running for a very long time. The limit is configurable via the new setting `function_base58_max_input_size` (`0` disables it). [#106428](https://github.com/ClickHouse/ClickHouse/pull/106428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix sporadic incorrect results for `ORDER BY ... DESC` queries when reading wide parts in reverse order with `read_in_order_use_virtual_row_per_block = 1` and a small `max_block_size`. [#106429](https://github.com/ClickHouse/ClickHouse/pull/106429) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a `NOT_FOUND_COLUMN_IN_BLOCK` exception when querying an Iceberg or S3 table with a compound `WHERE` containing `IS NOT NULL` on a column that is not in the `SELECT` list, using the Parquet V3 native reader. [#106443](https://github.com/ClickHouse/ClickHouse/pull/106443) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Allows user to specify headers for `HTTPDictionary` using named collections. [#106459](https://github.com/ClickHouse/ClickHouse/pull/106459) ([Jan Rada](https://github.com/ZelvaMan)).
* Fix a case where a worker thread could stay attached to a stale thread group after `CurrentThread::attachToGroup` failed part way through, causing later tasks on the same thread to fail with `Thread is already attached to a group`. [#106462](https://github.com/ClickHouse/ClickHouse/pull/106462) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fixed an exception when a vector search query uses a vector index and uses another skip index like `minmax` and `use_skip_indexes_on_data_read = 1`. [#106473](https://github.com/ClickHouse/ClickHouse/pull/106473) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Malformed `Avro` enum values are now validated and rejected with an error instead of causing an out-of-bounds read and abort when deserializing corrupted `Avro` data. [#106476](https://github.com/ClickHouse/ClickHouse/pull/106476) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix inflated progress reporting when reading from Iceberg tables with `_file` or `_path` filters. Previously, `total_bytes_to_read` progress included all files from the manifest regardless of filtering. [#106491](https://github.com/ClickHouse/ClickHouse/pull/106491) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fixed a `Bad cast exception` for Redis dictionaries that use `STORAGE_TYPE 'simple'` with a `cache`/`direct` layout and a single string (complex) key; such dictionaries now work, and composite keys over `simple` storage report a clear error. [#106501](https://github.com/ClickHouse/ClickHouse/pull/106501) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix wrong-results bug where `WHERE c0 = const` returned no rows for tables with `ORDER BY f(c0)` when `f(const)` evaluates to NaN, e.g. `ORDER BY sqrt(c0)` with a negative constant. The primary-key analysis incorrectly pruned every granule and poisoned the query condition cache for subsequent queries. [#106507](https://github.com/ClickHouse/ClickHouse/pull/106507) ([Groene AI](https://github.com/groeneai)).
* Fix `LIMIT WITH TIES` and fractional `LIMIT WITH TIES` not respecting the collation from `ORDER BY ... COLLATE` when determining ties. Rows that are equal according to the collation (for example `'1'` and `'01'` under numeric collation) were compared byte-wise, so some tied rows were wrongly dropped from the result. [#106539](https://github.com/ClickHouse/ClickHouse/pull/106539) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `DISTINCT` in order and `LIMIT BY` in order optimizations (including negative `LIMIT BY`) returning wrong results when the input is sorted with a collation (`ORDER BY ... COLLATE`). Rows that are equal according to the collation (for example `'a'` and `'A'` under a case-insensitive collation) are ordered by collation key and are not adjacent by value, so the in order optimization is now skipped when a collator is used. [#106564](https://github.com/ClickHouse/ClickHouse/pull/106564) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed wrong results for `SELECT c, count() FROM t WHERE c GROUP BY c` against tables with the implicit `_minmax_count_projection`, an explicit aggregate projection, or a normal projection: every group used to collapse into one row with a constant key and the total row count. [#106590](https://github.com/ClickHouse/ClickHouse/pull/106590) ([Groene AI](https://github.com/groeneai)).
* Fixes a bug where users could not use scalar subqueries in the first argument of `IN` where the second argument is a non-constant tuple. [#106610](https://github.com/ClickHouse/ClickHouse/pull/106610) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix exception `Mutation of `Memory` table produced incomplete output` raised when running `ALTER TABLE <memory_table>` commands that have no per-row data effect on a `Memory` engine, namely `APPLY PATCHES`, `APPLY DELETED MASK`, `MATERIALIZE STATISTICS`, `MATERIALIZE INDEX`, `MATERIALIZE PROJECTION`, and `REWRITE PARTS`. `Memory` tables do not own those structures, so such commands are now treated as no-ops. [#106621](https://github.com/ClickHouse/ClickHouse/pull/106621) ([Groene AI](https://github.com/groeneai)).
* Fix `session_timezone` being ignored when serializing `LowCardinality(DateTime)` columns to text formats (CSV, TSV, JSONEachRow, etc.). Previously, after the first write of a `LowCardinality(DateTime)` column on a server, every subsequent query that wrote such a column rendered the wall-clock string in whichever timezone was first seen, regardless of `session_timezone`. [#106634](https://github.com/ClickHouse/ClickHouse/pull/106634) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` "Trying to get name of not a column: `ExpressionList`" raised by queries that pass an asterisk inside `multiIf` to a table function argument, e.g. `numbers(multiIf(*, ...), 2)`. The query now rejects the unresolvable matcher with `UNSUPPORTED_METHOD`. [#106647](https://github.com/ClickHouse/ClickHouse/pull/106647) ([Groene AI](https://github.com/groeneai)).
* Fix server failing to start with `Too many marks in file ...skp_idx_idx.cmrk4, marks expected 0 (bytes size 0)` when a `MergeTree` table has a skip-index part with zero granules and a non-empty marks file on disk. [#106675](https://github.com/ClickHouse/ClickHouse/pull/106675) ([Groene AI](https://github.com/groeneai)).
* Reject pathological `file` glob patterns that would cause unbounded recursion in directory listing. A maximum recursion depth of 1000 is now enforced; queries that exceed it raise `TOO_DEEP_RECURSION` instead of crashing the server with a stack overflow. [#106676](https://github.com/ClickHouse/ClickHouse/pull/106676) ([Groene AI](https://github.com/groeneai)).
* Fix server abort `Bad cast from type DB::ColumnNothing to DB::ColumnVector<char8_t>` in `FunctionIf::executeForConstAndNullableCondition` when the `if`/`multiIf` condition constant-folds to `Const(Nullable(Nothing))` (for example, an out-of-range subscript on an empty array, like `arraySort(x -> x, [])[toNullable(1)]`). [#106678](https://github.com/ClickHouse/ClickHouse/pull/106678) ([Groene AI](https://github.com/groeneai)).
* Fix exception `'Trying to read from input() twice.'` raised when the table function `input` is wrapped in a non-MATERIALIZED CTE that is referenced from more than one place in the query. The query is now rejected with a clean `INVALID_USAGE_OF_INPUT` error at planning time. `input` is a one-shot client stream and can only be consumed by a single source in the query plan. [#106682](https://github.com/ClickHouse/ClickHouse/pull/106682) ([Groene AI](https://github.com/groeneai)).
* Make `FORMAT` apply to the `EXPLAIN` output of `EXPLAIN ... INSERT ... SELECT ... FORMAT ...` also when `SETTINGS` precede the `FORMAT` or the output format is `Values`. Follow-up to [#101772](https://github.com/ClickHouse/ClickHouse/issues/101772). [#106686](https://github.com/ClickHouse/ClickHouse/pull/106686) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a rare spurious `RESOURCE_ACCESS_DENIED` error ("Scheduler queue with resource request is about to be destructed") for a query that was actually granted access to a workload resource, caused by a reused thread-local request object retaining a previous request's failure. [#106690](https://github.com/ClickHouse/ClickHouse/pull/106690) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a race between destroying `INATSConsumer` objects and calling `INATSConsumer::onMsg` on them via callbacks in the NATS library. [#106692](https://github.com/ClickHouse/ClickHouse/pull/106692) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixed `match`, `extract`, `extractAll` and `countMatches` returning wrong results for regular expressions containing hex or octal escapes. [#106709](https://github.com/ClickHouse/ClickHouse/pull/106709) ([ofeliacode](https://github.com/ofeliacode)).
* Keeper's internal Raft TLS now honors the `openSSL.client.verificationMode` setting. Previously peer certificate verification was always enabled for inter-Keeper Raft communication regardless of this setting, so `none` was silently ignored. Now `none` explicitly disables Raft peer-certificate verification, while an absent setting keeps the previous secure-by-default behavior. Configurations that explicitly set `none` will stop verifying Raft peer certificates after upgrade, matching the configured intent. [#106726](https://github.com/ClickHouse/ClickHouse/pull/106726) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix logical error in startup scripts in `SYSTEM RELOAD CONFIG`. Additionally, load startup scripts on `SYSTEM RELOAD CONFIG` (currently private-only functionality). [#106727](https://github.com/ClickHouse/ClickHouse/pull/106727) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Revert a change that made `sumMap` / the `-Map` combinator reject custom-named numeric value types (such as `SimpleAggregateFunction(sum, T)` and `Bool`) with `ILLEGAL_TYPE_OF_ARGUMENT: Values for -Map cannot be summed`, breaking previously-working aggregations. [#106729](https://github.com/ClickHouse/ClickHouse/pull/106729) ([Nikita Fomichev](https://github.com/fm4v)).
* Fixed multiple memory-safety and resource-exhaustion issues in format readers reachable from untrusted input: a heap out-of-bounds read in the native Parquet reader's `DataPageV2` definition/repetition level-length handling, a stack overflow on Parquet files with deeply nested schemas, and allocations that ignored `max_memory_usage` when parsing GeoParquet WKB/WKT geometry and Avro strings/bytes. [#106739](https://github.com/ClickHouse/ClickHouse/pull/106739) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a heap buffer overflow (server crash) in `decodeHTMLComponent` when decoding strings containing the expanding HTML entities `&nGt;` or `&nLt;`, reachable by any user with a single `SELECT`. [#106741](https://github.com/ClickHouse/ClickHouse/pull/106741) ([Raúl Marín](https://github.com/Algunenano)).
* Reject `CREATE TABLE`, `ALTER TABLE ADD INDEX`, and `CREATE INDEX` with `GRANULARITY 0` for skipping indexes with a clear `BAD_ARGUMENTS` error. Previously this triggered an `Inconsistent AST formatting` exception in debug builds. [#106783](https://github.com/ClickHouse/ClickHouse/pull/106783) ([Groene AI](https://github.com/groeneai)).
* Fixed Azure BACKUP/RESTORE ignoring endpoint settings for legacy-form `azure_blob_storage` disks. [#106784](https://github.com/ClickHouse/ClickHouse/pull/106784) ([Julia Kartseva](https://github.com/jkartseva)).
* Fixed a `Bad cast` exception while pruning parts by `MinMax` statistics when a key column is `LowCardinality` and the predicate constant is `LowCardinality(Nullable(...))`. [#106793](https://github.com/ClickHouse/ClickHouse/pull/106793) ([Groene AI](https://github.com/groeneai)).
* Fix inconsistent columns (that leads to `LOGICAL_ERROR` later) on exception (i.e. `MEMORY_LIMIT_EXCEEDED`) during parsing. [#106802](https://github.com/ClickHouse/ClickHouse/pull/106802) ([Azat Khuzhin](https://github.com/azat)).
* Fix after configuring `keeper_server.http_control.secure_port`, the server returned an HTTP response when making requests to HTTPS clients. [#106822](https://github.com/ClickHouse/ClickHouse/pull/106822) ([linjiayu1025-collab](https://github.com/linjiayu1025-collab)).
* Fix logical error in `parseDateTime` with non-ASCII input bytes. [#106856](https://github.com/ClickHouse/ClickHouse/pull/106856) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `SHOW CREATE ROW POLICY` emitting `restrictive`/`permissive` in lowercase instead of uppercase, inconsistent with other keywords. [#106865](https://github.com/ClickHouse/ClickHouse/pull/106865) ([Valery Petrov](https://github.com/valerypetrov)).
* Fixes the case when parallel replicas wasn't applied for view with `UNION` due to empty table in the `UNION`. [#106900](https://github.com/ClickHouse/ClickHouse/pull/106900) ([Igor Nikonov](https://github.com/devcrafter)).
* Fix server crash (SIGSEGV) when reading truncated `Protobuf` data with `input_format_allow_errors_num > 0`. [#106905](https://github.com/ClickHouse/ClickHouse/pull/106905) ([Andrey Tsarevskiy | Андрей Царевский ](https://github.com/atsarevskiy)).
* Fix `THERE_IS_NO_COLUMN` exception for distributed queries involving `optimize_rewrite_aggregate_function_with_if` optimization when the aggregate function argument requires a cast to `Nullable` type. [#106908](https://github.com/ClickHouse/ClickHouse/pull/106908) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix an exception (`LOGICAL_ERROR`) in the join runtime filter when the join key contains a `Variant` or `Dynamic` type nested inside a `Tuple`, `Array`, or `Map` and the right side of the join has a single distinct value. [#106931](https://github.com/ClickHouse/ClickHouse/pull/106931) ([Groene AI](https://github.com/groeneai)).
* Fixed a signed integer overflow (undefined behavior) in `arrayLevenshteinDistanceWeighted` and `arraySimilarity` when the weight arrays contain large integer values. The weighted distance is now accumulated in a wide integer for integral weights, so large integer weights no longer overflow and stay exact. [#106934](https://github.com/ClickHouse/ClickHouse/pull/106934) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash (null pointer dereference) when running `TRUNCATE` or `DROP` on an `EmbeddedRocksDB` table whose RocksDB handle was released, for example a `read_only` table whose data directory was emptied by a prior `TRUNCATE`. [#106940](https://github.com/ClickHouse/ClickHouse/pull/106940) ([Groene AI](https://github.com/groeneai)).
* Fix an exception (`std::length_error` reported as a `LOGICAL_ERROR`) when reading from a `*Cluster` table function such as `urlCluster` with a very large `max_streams_for_files_processing_in_cluster_functions` setting. The number of streams is now bounded to a sane value. [#106946](https://github.com/ClickHouse/ClickHouse/pull/106946) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash (null pointer dereference of `DB::IConnections`) in `RemoteQueryExecutor` when a distributed query is cancelled right before it is sent to a shard. [#106950](https://github.com/ClickHouse/ClickHouse/pull/106950) ([Groene AI](https://github.com/groeneai)).
* Fixed `elapsed_us` always being zero, and `read_rows`/`read_bytes` being undercounted, in `system.processors_profile_log` and `system.query_log` for asynchronous insert flush (`AsyncInsertFlush`) queries. [#106982](https://github.com/ClickHouse/ClickHouse/pull/106982) ([Christoph Wurm](https://github.com/cwurm)).
* Fix a crash (`Source column is not Map` / `SIGSEGV`) when merging sorted blocks that contain a `Variant` column with a `Map` variant whose local storage order differs from its global order. [#107011](https://github.com/ClickHouse/ClickHouse/pull/107011) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error `conflicted_part_name.has_value()` raised during a synchronous insert into a `ReplicatedMergeTree` table when the inserted block was fully deduplicated and the conflicting part's deduplication node had already been removed (for example by a concurrent `DROP PARTITION`). [#107026](https://github.com/ClickHouse/ClickHouse/pull/107026) ([Groene AI](https://github.com/groeneai)).
* Fixed an exception (logical error `this->visited_views == right->visited_views`) on `INSERT` when two materialized views on the same source table write to the same target table and a dependent view reads that target, with `materialized_views_squash_parallel_inserts` enabled. [#107027](https://github.com/ClickHouse/ClickHouse/pull/107027) ([Groene AI](https://github.com/groeneai)).
* Fixed a `Block structure mismatch in UnionStep stream` logical error (server abort on debug/sanitizer builds, `Code: 49` on release builds) that occurred when one branch of a `UNION`/`INTERSECT`/`EXCEPT` read a `Sparse`-serialized column while the sibling branch read the same column as a full one (for example when pushing to a materialized view). [#107041](https://github.com/ClickHouse/ClickHouse/pull/107041) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` exception when inserting into a DeltaLake table with columns that do not match its write schema (for example a `Nested` column that flattens to subcolumns, or a table function with an explicit column subset). Such inserts now fail with a user-facing `INCOMPATIBLE_COLUMNS` error instead. Closes [#87402](https://github.com/ClickHouse/ClickHouse/issues/87402). [#107058](https://github.com/ClickHouse/ClickHouse/pull/107058) ([Groene AI](https://github.com/groeneai)).
* Fix `TYPE_MISMATCH` error ("Cannot convert string ... to type ...") for `ORDER BY <numeric column> ... LIMIT n` queries when lazy materialization placed another column before the sort column. The top-K threshold is now read from the correct sort column. [#107060](https://github.com/ClickHouse/ClickHouse/pull/107060) ([Groene AI](https://github.com/groeneai)).
* Fixed a syntax error when a `FORMAT`, `SETTINGS`, or `INTO OUTFILE` clause follows `SHOW ROW POLICIES` or `SHOW MASKING POLICIES` (e.g. `SHOW ROW POLICIES FORMAT TabSeparated`). [#107061](https://github.com/ClickHouse/ClickHouse/pull/107061) ([Groene AI](https://github.com/groeneai)).
* Fix a compound `ALTER TABLE ... RENAME COLUMN a TO b, RENAME COLUMN c TO a` that reuses a freed column name (a "swap") between columns of different types. The materialized part recorded the wrong column type, so a later `SELECT` failed with `Conversion between numeric types and IPv6 is not supported` (or aborted on part load in debug builds). [#107064](https://github.com/ClickHouse/ClickHouse/pull/107064) ([Groene AI](https://github.com/groeneai)).
* Fixed non-deterministic results of the `roundDown` function when the boundaries array contains `NaN`. The same input value could return a finite boundary or `NaN` depending on the surrounding rows in a batch. `NaN` boundaries are now ignored, so the result depends only on the finite boundaries. [#107065](https://github.com/ClickHouse/ClickHouse/pull/107065) ([Groene AI](https://github.com/groeneai)).
* Fixed `quantileTDigest` and `quantileTDigestWeighted` throwing `DECIMAL_OVERFLOW` for `Date` and `DateTime` arguments when the interpolated quantile is fractional but in range (for example `quantileTDigestWeighted(date, weight)` on values that all fit in the type). The fractional result is now truncated to the result type, matching `quantilesTDigestWeighted`; genuine out-of-range values still raise an error. Closes: [#106722](https://github.com/ClickHouse/ClickHouse/issues/106722). [#107066](https://github.com/ClickHouse/ClickHouse/pull/107066) ([Groene AI](https://github.com/groeneai)).
* Fix `trimLeft`, `trimRight`, and `trimBoth` (and aliases `ltrim`, `rtrim`, `trim`) throwing `TOO_LARGE_STRING_SIZE` when the custom trim character set is longer than 16 characters. Trim sets of any length are now supported again. [#107071](https://github.com/ClickHouse/ClickHouse/pull/107071) ([Nikita Fomichev](https://github.com/fm4v)).
* Fixed silent truncation of out-of-range integer values in `Enum8`/`Enum16` type definitions. `Enum8('a' = 200)` now throws `ARGUMENT_OUT_OF_BOUND` instead of silently creating `Enum8('a' = -56)`. [#107081](https://github.com/ClickHouse/ClickHouse/pull/107081) ([Groene AI](https://github.com/groeneai)).
* Fix wrong row order (and a `LOGICAL_ERROR` "Rows are not sorted with permutation" in debug builds) for multi-column `ORDER BY ... LIMIT` queries that sort by `Nullable` columns when several rows tie on the leading columns. [#107094](https://github.com/ClickHouse/ClickHouse/pull/107094) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`Expected the argument N to have X rows, but it has Y`) when executing a function over a `Dynamic` column built by a JOIN over `Dynamic` (for example the non-joined rows of a `RIGHT`/`FULL JOIN`, or a correlated `EXISTS` subquery decorrelated into a join). [#107095](https://github.com/ClickHouse/ClickHouse/pull/107095) ([Groene AI](https://github.com/groeneai)).
* Fix spurious ZooKeeper session recreation on config reload. [#107096](https://github.com/ClickHouse/ClickHouse/pull/107096) ([Azat Khuzhin](https://github.com/azat)).
* Do not hold mutex across ZooKeeper reads in access entities refresh. [#107097](https://github.com/ClickHouse/ClickHouse/pull/107097) ([Azat Khuzhin](https://github.com/azat)).
* Fix a `Logical error: Too large size passed to allocator` exception on `INSERT` into a `MergeTree` table when `adaptive_write_buffer_initial_size` is set to an extremely large value. The adaptive write buffer initial size is now clamped to the buffer maximum. [#107104](https://github.com/ClickHouse/ClickHouse/pull/107104) ([Groene AI](https://github.com/groeneai)).
* Fix `LOGICAL ERROR` (`Bad cast from type DB::ColumnString to DB::ColumnLowCardinality`) when a `Variant` constant containing a `LowCardinality` member is compared to a key column whose key expression is a non-monotonic deterministic function (for example a `minmax` skip index over `sipHash64(col)`). [#107111](https://github.com/ClickHouse/ClickHouse/pull/107111) ([Groene AI](https://github.com/groeneai)).
* Fix a `Bad cast from type DB::IColumn const* to DB::ColumnNullable const*` logical error when a qualified asterisk (`t.*`) over a `JOIN ... USING` key is passed to an aggregate function and the other side of an outer JOIN has a `Nullable` key (with `join_use_nulls = 0`). [#107129](https://github.com/ClickHouse/ClickHouse/pull/107129) ([Groene AI](https://github.com/groeneai)).
* Fix `ALTER TABLE ... ON CLUSTER` batches that mix `MODIFY SETTING`/`RESET SETTING` with a comment change (for example `MODIFY COMMENT 'x', MODIFY SETTING old_parts_lifetime = 123`) being applied only on the leader replica, leaving the other replicas diverged. Also fix a positional or per-column-`SETTINGS` `MODIFY COLUMN ... COMMENT` being misclassified as a local comment-only metadata change, which left the column reorder out of the replicated metadata and could cause `INCOMPATIBLE_COLUMNS` on replica restart. [#107142](https://github.com/ClickHouse/ClickHouse/pull/107142) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` ("Table expression ... data must be initialized") raised when a qualified asterisk matcher (for example `x.*`) referenced a recursive CTE by name inside its own recursive term. Such matchers now expand the recursive table's columns, the same way a qualified column (`x.a`) or an unqualified matcher (`*`) already does in that position. [#107144](https://github.com/ClickHouse/ClickHouse/pull/107144) ([Groene AI](https://github.com/groeneai)).
* Fixed wrong query results caused by the query condition cache when on-fly mutations (`apply_mutations_on_fly`) or patch parts filtered rows before `PREWHERE`. A query reading with `apply_mutations_on_fly = 1` could poison the cache so that a later query with `apply_mutations_on_fly = 0` and the same predicate skipped marks it should have read and returned too few rows. The same fix also covers row-level security policies, which are prepended as a filter ahead of `PREWHERE`: a query run under a restrictive row policy could poison the cache for a later query that uses the same predicate without that policy. [#107145](https://github.com/ClickHouse/ClickHouse/pull/107145) ([Groene AI](https://github.com/groeneai)).
* Fixed `BACKUP` to `AzureBlobStorage`: copying a data file inside a backup wrote the destination object outside the backup directory. Backup object existence checks on `S3` destinations now use exact `HeadObject` requests instead of prefix listing, preventing false matches of similarly-prefixed keys. [#107153](https://github.com/ClickHouse/ClickHouse/pull/107153) ([Pablo Marcos](https://github.com/pamarcos)).
* Fixed a signed integer overflow in `quantileExactExclusive`, `quantilesExactExclusive`, `quantileExactInclusive` and `quantilesExactInclusive` that could produce a wrong result for `Int64` inputs spanning a large range. [#107154](https://github.com/ClickHouse/ClickHouse/pull/107154) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` ("Unexpected exception in refresh scheduling") that could put the server into a crash-loop on restart when a refreshable materialized view has a `REFRESH ... DEPENDS ON <name>` dependency whose unqualified name matches a temporary table or a CTE name. [#107156](https://github.com/ClickHouse/ClickHouse/pull/107156) ([Groene AI](https://github.com/groeneai)).
* Make sure we don't run startup scripts on config reload, as that is semantically wrong and unexpected by users - and has been known to be error-prone. [#107187](https://github.com/ClickHouse/ClickHouse/pull/107187) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Cap the max value for `queue_size` for pre-reserve. [#107205](https://github.com/ClickHouse/ClickHouse/pull/107205) ([Elian Gidoni](https://github.com/eliangidoni)).
* Fix the `Argument ... of GROUPING function is not a part of GROUP BY clause` error for queries that use the `grouping` function with the `group_by_use_nulls` setting enabled. [#107206](https://github.com/ClickHouse/ClickHouse/pull/107206) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix incorrect result order for `ORDER BY` over `UNION ALL` with `optimize_read_in_order` enabled when the union pipeline was narrowed due to `max_streams_for_union_step` settings; narrowing is now skipped when the plan relies on sorted UNION output streams. Closes [#106880](https://github.com/ClickHouse/ClickHouse/issues/106880). [#107208](https://github.com/ClickHouse/ClickHouse/pull/107208) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a possible null pointer dereference while resolving proxy configuration during late server shutdown. [#107231](https://github.com/ClickHouse/ClickHouse/pull/107231) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fix lightweight `UPDATE` queries with legacy parallel replicas enabled for non-replicated `MergeTree` tables. [#107246](https://github.com/ClickHouse/ClickHouse/pull/107246) ([Groene AI](https://github.com/groeneai)).
* Fixed a server abort (`std::out_of_range` logical error) when inserting into an `Iceberg` table whose write block column names do not match the field ids of the latest schema (for example after a concurrent writer renames a column within the `iceberg_metadata_staleness_ms` window). The insert now fails with a clean query error instead of crashing the server. [#107279](https://github.com/ClickHouse/ClickHouse/pull/107279) ([Groene AI](https://github.com/groeneai)).
* Fix the stuck shutdown bug on server and local due to static thread pools keeping idle threads indefinitely if `max_*_thread_pool_free_size > 0`. [#107291](https://github.com/ClickHouse/ClickHouse/pull/107291) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix the `s3` table function silently ignoring a lowercase positional `partition_strategy` (e.g. `hive`). [#107297](https://github.com/ClickHouse/ClickHouse/pull/107297) ([Julia Kartseva](https://github.com/jkartseva)).
* Fix `low_cardinality_allow_in_native_format=0` handling in parallel blocks marshalling. [#107319](https://github.com/ClickHouse/ClickHouse/pull/107319) ([Azat Khuzhin](https://github.com/azat)).
* Fix wrong (often empty) results from `ORDER BY <col> LIMIT n` when the `use_skip_indexes_for_top_k` optimization is active and a part with a `minmax` skip index on the sort column has had rows removed by a lightweight `DELETE`. The optimization no longer ranks the stale minmax of lightweight-deleted parts ahead of the parts that hold the live top rows. [#107320](https://github.com/ClickHouse/ClickHouse/pull/107320) ([Groene AI](https://github.com/groeneai)).
* Fixed a bug in ClickHouse Keeper where the snapshot metadata reported via `last_snapshot` (and `zk_latest_snapshot_size` in `mntr`) could move backwards after a stale or duplicated snapshot install, which could also let a same-index local snapshot overwrite a registered snapshot file in place while it was still being streamed to a peer or uploaded to S3. [#107321](https://github.com/ClickHouse/ClickHouse/pull/107321) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed possible server stack overflow (crash) when reading a deeply nested schema or value in the `MsgPack`, `BSON`, `ORC`, `Parquet`, `JSON`, `DeltaLake`, `Iceberg` and `Paimon` formats. Such deeply nested input is now rejected with an exception. [#107341](https://github.com/ClickHouse/ClickHouse/pull/107341) ([Raúl Marín](https://github.com/Algunenano)).
* Fix a possible logical error in `SYSTEM SYNC DATABASE REPLICA ... STRICT` and make the `STRICT` modifier actually take effect for database replicas. [#107344](https://github.com/ClickHouse/ClickHouse/pull/107344) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fixes a server abort in debug/sanitizer builds when reading a `DeltaLake` table whose ClickHouse schema names a column that is absent from the Delta column mapping, for example after a column was renamed or dropped in the Delta log. The query now fails with a catchable `INCORRECT_DATA` error instead. [#107347](https://github.com/ClickHouse/ClickHouse/pull/107347) ([Groene AI](https://github.com/groeneai)).
* Fix `ORDER BY ... WITH FILL` producing extra rows when an `ORDER BY` column before the fill column uses a `COLLATE` collation. The rows are now grouped by the sorting prefix using that collation, matching the sort order. [#107365](https://github.com/ClickHouse/ClickHouse/pull/107365) ([Groene AI](https://github.com/groeneai)).
* Fixed a crash (`LOGICAL_ERROR` in debug builds) and a silent wrong-results bug (in release builds) when reading an Iceberg table whose metadata re-binds an existing `schema-id` to a different schema across metadata versions. Such metadata is now rejected with `ICEBERG_SPECIFICATION_VIOLATION`. [#107370](https://github.com/ClickHouse/ClickHouse/pull/107370) ([Groene AI](https://github.com/groeneai)).
* Fix a `LOGICAL_ERROR` (`Variant N (T) has size X, but expected Y`) when a function such as `toString` or `concat` is applied to a `Variant` or `Dynamic` column that holds a single non-empty variant together with NULLs, and the function returns its input column unchanged. [#107374](https://github.com/ClickHouse/ClickHouse/pull/107374) ([Groene AI](https://github.com/groeneai)).
* Fix `Logical error: 'Duplicate announcement received for replica number N'` that could occur with parallel replicas when a scalar subquery contained nested subqueries reading the same table. [#107381](https://github.com/ClickHouse/ClickHouse/pull/107381) ([Groene AI](https://github.com/groeneai)).
* Fix `getServerSetting` to return the live effective value for runtime-changeable server settings (such as `max_server_memory_usage`, `mark_cache_size`, `max_concurrent_queries`, thread pool sizes, etc.), matching what `system.server_settings` reports. [#107388](https://github.com/ClickHouse/ClickHouse/pull/107388) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `arrayResize` with a `Decimal` size argument: the size is now interpreted by its real value (e.g. `arrayResize([1, 2, 3], 1.5::Decimal(2, 1))` returns one element) instead of the raw unscaled representation. [#107389](https://github.com/ClickHouse/ClickHouse/pull/107389) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `LOGICAL_ERROR` (`block.rows() == getRows()`) raised on an async `INSERT` into an `Alias` table when `use_strict_insert_block_limits` was enabled. [#107400](https://github.com/ClickHouse/ClickHouse/pull/107400) ([Groene AI](https://github.com/groeneai)).
* Fix a logical error (`Unexpected return type from equals. Expected Nullable(UInt8). Got UInt8`) when the disjunction (partial predicate) push-down optimization pushes a condition over a `USING` key whose type is widened by the JOIN. Also fix a server crash (segmentation fault) in the analyzer when resolving identifiers in `JOIN ... USING` queries that contain constant-foldable `if`/`multiIf` branches referencing unknown identifiers. [#107407](https://github.com/ClickHouse/ClickHouse/pull/107407) ([Groene AI](https://github.com/groeneai)).
* Fixed a heap buffer overflow (server crash) in `windowFunnel` when finalizing a crafted aggregate-function state with an out-of-range event type, reachable by any user with a single `SELECT`. [#107412](https://github.com/ClickHouse/ClickHouse/pull/107412) ([uwezkhan](https://github.com/uwezkhan)).
* Fixed undefined behavior when a non-finite floating-point value (such as `nan` or `inf`) is passed as the timestamp/duration argument of the `prometheusQuery` / `prometheusQueryRange` table functions. Such an argument now raises `BAD_ARGUMENTS` instead of producing a garbage timestamp. [#107417](https://github.com/ClickHouse/ClickHouse/pull/107417) ([Groene AI](https://github.com/groeneai)).
* Fix `MaterializedPostgreSQL` silently stopping replication of changes when the PostgreSQL database or table name contains upper-case letters (the `pgoutput` consumer requested an unquoted, lower-cased publication name that did not match the case-preserving publication). [#107423](https://github.com/ClickHouse/ClickHouse/pull/107423) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix an exception (`Logical error: Not-ready Set is passed as the second argument for function 'in'`) when a key expression (`ORDER BY`, `PRIMARY KEY`, `PARTITION BY`, or a skip `INDEX`) contained an `IN` operator with a table on the right-hand side, e.g. `ORDER BY (x IN some_table)`. Such key expressions are now rejected at table creation time. [#107424](https://github.com/ClickHouse/ClickHouse/pull/107424) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect results from the `optimize_rewrite_aggregate_function_with_if` optimization for aggregate functions that preserve `NULL` payload values (the `*_respect_nulls` family: `anyRespectNulls`, `first_value_respect_nulls`, `anyLast_respect_nulls`, `last_value_respect_nulls`). The optimization no longer rewrites `f(if(cond, x, NULL))` into the `-If` form for such functions. [#107430](https://github.com/ClickHouse/ClickHouse/pull/107430) ([Groene AI](https://github.com/groeneai)).
* Fix a spurious `filesystem error: in last_write_time: No such file or directory` exception when listing a local-disk object storage directory (e.g. an Iceberg table on a `local` disk) while files are being concurrently replaced. A concurrently removed entry is now omitted from the listing instead of aborting it. [#107432](https://github.com/ClickHouse/ClickHouse/pull/107432) ([Groene AI](https://github.com/groeneai)).
* Fix `THERE_IS_NO_COLUMN` error when `optimize_if_transform_strings_to_enum = 1` and the optimized `if`/`transform`-over-string-literals expression is a `GROUP BY` or `ORDER BY` key over a Distributed table or parallel replicas. [#107455](https://github.com/ClickHouse/ClickHouse/pull/107455) ([Groene AI](https://github.com/groeneai)).
* Fixed a rare server crash in `DISTINCT` processing that could occur when an allocation failed (for example, when hitting a memory limit) while the set of distinct keys was being initialized. [#107467](https://github.com/ClickHouse/ClickHouse/pull/107467) ([Groene AI](https://github.com/groeneai)).
* Fix `LOGICAL_ERROR: Unexpected return type from materialize` (and similar type-mismatch errors) when `apply_mutations_on_fly = 1` is used on a table with a pending on-fly `UPDATE` whose target column is also read as a function input by an earlier on-fly `UPDATE`, before an `ALTER MODIFY COLUMN ... LowCardinality(...)` mutation. [#107475](https://github.com/ClickHouse/ClickHouse/pull/107475) ([Groene AI](https://github.com/groeneai)).
* Fixed stale AWS STS credentials when reading `DeltaLake` tables over `S3`: the engine now keeps the freshly-credentialed `S3` client when refreshing its snapshot, so long-running reads no longer fail after the STS token's TTL expires. The STS assume-role credentials provider now also honors credential refresh for any `S3` access using STS. [#107480](https://github.com/ClickHouse/ClickHouse/pull/107480) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Fixed `SELECT ... FINAL` and `OPTIMIZE TABLE ... FINAL` returning duplicate rows after `CREATE TABLE ... CLONE AS`, `ATTACH PARTITION ... FROM` or `MOVE PARTITION ... TO TABLE` adopted parts from a plain `MergeTree` into a `ReplacingMergeTree`, `SummingMergeTree` or `AggregatingMergeTree`. The adopted part's merge level is now reset to 0 when the source and destination engines differ, so the destination deduplicates it on the next merge. [#107481](https://github.com/ClickHouse/ClickHouse/pull/107481) ([Groene AI](https://github.com/groeneai)).
* Fix an integer underflow in the PostgreSQL wire protocol parser where a message with a length field smaller than 4 caused a `size - 4` wraparound and an oversized `resize`/`ignore`. [#107485](https://github.com/ClickHouse/ClickHouse/pull/107485) ([uwezkhan](https://github.com/uwezkhan)).
* Query cancellation is now better tracked while waiting for the quorum in ReplicatedMergeTree. [#107513](https://github.com/ClickHouse/ClickHouse/pull/107513) ([Nikita Taranov](https://github.com/nickitat)).
* Fixed a `Not-ready Set is passed as the second argument for function 'in'` (`LOGICAL_ERROR`) when querying a table with a `PARTITION BY` key and an `IN`/`NOT IN` subquery wrapped inside a larger expression, for example `WHERE (c0 IN (SELECT ...)) != 0`. [#107515](https://github.com/ClickHouse/ClickHouse/pull/107515) ([Groene AI](https://github.com/groeneai)).
* Fixed `currentUser()`, `user()`, `SESSION_USER` and `authenticatedUser()` evaluating to an empty string on the asynchronous insert flush path (with `async_insert = 1`). This affected `DEFAULT`/`MATERIALIZED` column expressions and materialized views that reference these functions, which silently stored an empty string instead of the inserting user. [#107541](https://github.com/ClickHouse/ClickHouse/pull/107541) ([Groene AI](https://github.com/groeneai)).
* With `enable_analyzer = 1` (the default), querying a table by its bare name when it only exists in another database now suggests the right table, e.g. `SELECT * FROM functions` reports `Maybe you meant system.functions?`. Previously the new analyzer gave a hint-less `Unknown table expression identifier` error, while the old analyzer already produced the helpful suggestion. [#107550](https://github.com/ClickHouse/ClickHouse/pull/107550) ([Groene AI](https://github.com/groeneai)).
* Account memory used by the rapidjson library (in `prettyPrintJSON`, `JSONMergePatch` and the rapidjson JSON parser) against the memory tracker, so pathological inputs are rejected with `MEMORY_LIMIT_EXCEEDED` instead of allocating without bound. [#107555](https://github.com/ClickHouse/ClickHouse/pull/107555) ([Raúl Marín](https://github.com/Algunenano)).
* Fix a `LOGICAL_ERROR` (`updateFormatPrewhereInfo called more than once`) raised when querying a `file()`, `url()`, or object-storage source with both an explicit `PREWHERE` and a `WHERE` while `optimize_prewhere_after_pushdown` was enabled. [#107568](https://github.com/ClickHouse/ClickHouse/pull/107568) ([Groene AI](https://github.com/groeneai)).
* Fix a crash (null pointer dereference) that could happen when a distributed query plan was executed locally (`make_distributed_plan` + `distributed_plan_execute_locally`) with `log_formatted_queries = 1`. [#107570](https://github.com/ClickHouse/ClickHouse/pull/107570) ([Groene AI](https://github.com/groeneai)).
* Fixed a server abort (`std::terminate`, signal 6) during teardown of a distributed-plan query (`make_distributed_plan = 1`) when a worker status-check failed to re-schedule the next check (for example `CANNOT_SCHEDULE_TASK` on shutdown or `MEMORY_LIMIT_EXCEEDED`). The query now fails cleanly and the server keeps running. [#107575](https://github.com/ClickHouse/ClickHouse/pull/107575) ([Groene AI](https://github.com/groeneai)).
* Added missing bounds checks in Elf and DWARF parsing. [#107579](https://github.com/ClickHouse/ClickHouse/pull/107579) ([Michael Kolupaev](https://github.com/al13n321)).
* Added missing bounds checks in ORC reader. [#107580](https://github.com/ClickHouse/ClickHouse/pull/107580) ([Michael Kolupaev](https://github.com/al13n321)).
* Fixed an exception (`Digest does not match` logical error) that could happen on `RENAME TABLE`, `RENAME DATABASE`, or `CREATE OR REPLACE TABLE` involving a `TimeSeries` table inside a `Replicated` database. Renaming a `TimeSeries` table is now supported. [#107583](https://github.com/ClickHouse/ClickHouse/pull/107583) ([Groene AI](https://github.com/groeneai)).
* Fix an unauthenticated memory-exhaustion denial of service on the MySQL protocol port. [#107599](https://github.com/ClickHouse/ClickHouse/pull/107599) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix `DROP TABLE` of a `TimeSeries` table in a `Replicated` database, which previously leaked the inner tables and left the background drop task retrying forever (`DROP TABLE ... SYNC` would hang). [#107604](https://github.com/ClickHouse/ClickHouse/pull/107604) ([Groene AI](https://github.com/groeneai)).
* Fixed two path-traversal issues in the replicated part fetch protocol that could let a malicious replica write files outside the part directory. [#107606](https://github.com/ClickHouse/ClickHouse/pull/107606) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed 'Account must be specified error' when reading a Delta Lake table over Azure. [#107620](https://github.com/ClickHouse/ClickHouse/pull/107620) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fixed `ALTER TABLE ... REPLACE PARTITION` on a plain `MergeTree` table resurrecting the replaced-out parts after a server restart, which made the table return both the replacement rows and the stale replaced rows. [#107623](https://github.com/ClickHouse/ClickHouse/pull/107623) ([Groene AI](https://github.com/groeneai)).
* Fix a server crash when reading a materialized view whose target is a `Distributed` table while the query runs with `enable_analyzer = 0`. [#107653](https://github.com/ClickHouse/ClickHouse/pull/107653) ([Groene AI](https://github.com/groeneai)).
* When several quotas are assigned to the same user or role, all of them are now enforced together (a query is rejected if any of them is exceeded), instead of only one quota being enforced and chosen non-deterministically. `SHOW QUOTA` and `system.quota_usage` now show all quotas enforced for the current user. [#107664](https://github.com/ClickHouse/ClickHouse/pull/107664) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `s3` and other object storage table functions throwing `LOGICAL_ERROR` instead of `BAD_ARGUMENTS` when a key-value argument is duplicated, e.g. `s3('http://...', format = 'CSV', format = 'TSV')`. [#107670](https://github.com/ClickHouse/ClickHouse/pull/107670) ([Groene AI](https://github.com/groeneai)).
* Fixed the MySQL interface being unusable with `MySQL Connector/J` 8.2.0 and newer (including 9.x). The `info` field of the `OK` packet is now length-encoded, matching the MySQL server, so the JDBC driver can connect. [#107693](https://github.com/ClickHouse/ClickHouse/pull/107693) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `LOGICAL_ERROR` ("Input nodes size mismatch in dag") when a query with `make_distributed_plan = 1` joins on a function-wrapped key whose two sides have no common type (for example `ON intDiv(-1, t1.key) = t2.key` with a `UInt64` right key). [#107701](https://github.com/ClickHouse/ClickHouse/pull/107701) ([Groene AI](https://github.com/groeneai)).
* Reading Arrow/ArrowStream data with empty `String`/`Binary` columns produced by Apache Arrow Java \< 19.0.0 (including Apache Spark) no longer throws `INCORRECT_DATA`. [#107764](https://github.com/ClickHouse/ClickHouse/pull/107764) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a `BAD_GET` exception ("Bad get: has String, requested UInt64") from `countmin` column statistics estimation when a query compares a column against a literal of a different type that is not pre-coerced, such as `numeric_col IN (SELECT '5')` or `string_col IN (SELECT 5)`. [#107793](https://github.com/ClickHouse/ClickHouse/pull/107793) ([Groene AI](https://github.com/groeneai)).
* Fixed the `odbc` and `jdbc` table functions hanging for minutes and ignoring query cancellation (`KILL QUERY`, `max_execution_time`) when the bridge becomes unresponsive while inferring the remote table structure. [#107809](https://github.com/ClickHouse/ClickHouse/pull/107809) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an exception (`Logical error: 'index >= result.start'`) when formatting a malformed query that mixes the positional and named secret-argument forms of the `s3`/`gcs` table functions, e.g. `s3('url', 'a', 'b', secret_access_key = 'c')`. [#107818](https://github.com/ClickHouse/ClickHouse/pull/107818) ([Groene AI](https://github.com/groeneai)).
* Fix set skip index not pruning granules over `LowCardinality` columns. [#107868](https://github.com/ClickHouse/ClickHouse/pull/107868) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fixed insert deduplication computing wrong hashes for `String` and `Array` columns with the server setting `insert_deduplication_version = new_unified_hash`: identical inserts could fail to deduplicate because the deduplication hash depended on the row's position within the inserted block. [#107915](https://github.com/ClickHouse/ClickHouse/pull/107915) ([Sema Checherinda](https://github.com/CheSema)).
* Fix incorrect results of `ORDER BY` over `Nullable` columns with multiple sort keys on macOS (Apple Silicon), caused by a missing sign-extension in the JIT-compiled sort comparator. [#107973](https://github.com/ClickHouse/ClickHouse/pull/107973) ([Raúl Marín](https://github.com/Algunenano)).
* Fix performance regression when reading `Dynamic` columns with multiple threads. Caused by [#100730](https://github.com/ClickHouse/ClickHouse/pull/100730). Closes [#107942](https://github.com/ClickHouse/ClickHouse/issues/107942). [#107997](https://github.com/ClickHouse/ClickHouse/pull/107997) ([Pavel Kruglov](https://github.com/Avogar)).
* The deprecated data lake setting `storage_catalog_url` is now correctly rejected by the catalog guard (previously only `storage_catalog_type` and `storage_aws_access_key_id` were checked), and the error message lists all deprecated settings. [#108040](https://github.com/ClickHouse/ClickHouse/pull/108040) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a `Bad cast from type DB::ColumnSparse to DB::ColumnVector<char8_t>` logical error when a `LIKE` query reads from a `text` index via the direct-read fallback path over a column stored sparse. [#108068](https://github.com/ClickHouse/ClickHouse/pull/108068) ([Groene AI](https://github.com/groeneai)).
* Always run access cache batch-finished handlers, even on empty batch. [#108124](https://github.com/ClickHouse/ClickHouse/pull/108124) ([Azat Khuzhin](https://github.com/azat)).
* Fixed a `LOGICAL_ERROR` (`Column identifier is already registered`) for some queries with `UNION ALL`. [#100770](https://github.com/ClickHouse/ClickHouse/pull/100770) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed a use-after-free of the workload storage mutex during server shutdown. [#101447](https://github.com/ClickHouse/ClickHouse/pull/101447) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fixed a deadlock in `ALTER DATABASE MODIFY COMMENT` with the `Shared` catalog. [#103683](https://github.com/ClickHouse/ClickHouse/pull/103683) ([Nikolay Degterinsky](https://github.com/evillique)).
* An empty Unicode-quoted identifier now raises a `SYNTAX_ERROR` instead of `CANNOT_PARSE_QUOTED_STRING`. [#104173](https://github.com/ClickHouse/ClickHouse/pull/104173) ([leonard9893](https://github.com/leonard9893)).
* Preserve the original parameter types of `timeSeries*` aggregate functions so that `AggregateFunction` types round-trip correctly across table reattach and parallel replicas. [#104812](https://github.com/ClickHouse/ClickHouse/pull/104812) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fixed a `LOGICAL_ERROR` for a materialized CTE under `serialize_query_plan` with parallel replicas. [#104896](https://github.com/ClickHouse/ClickHouse/pull/104896) ([Igor Nikonov](https://github.com/devcrafter)).
* Fixed signed integer overflow in the `timeSeries*ToGrid` functions when the staleness (window) parameter is near `INT64_MAX`. [#105319](https://github.com/ClickHouse/ClickHouse/pull/105319) ([Groene AI](https://github.com/groeneai)).
* A `compatibility` setting value no longer reverts `apply_row_policy_after_final` to `false`, so row policies are always applied correctly with `FINAL`. [#105637](https://github.com/ClickHouse/ClickHouse/pull/105637) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed `clickhouse chdig client` by honoring `SETPGROUP`/`RESETIDS`/`SETSIGDEF` in the `posix_spawn` stub. [#105858](https://github.com/ClickHouse/ClickHouse/pull/105858) ([Azat Khuzhin](https://github.com/azat)).
* Fixed an exception during merge-tree sanity checks on projections when the merge/mutate executor was not initialized. [#105919](https://github.com/ClickHouse/ClickHouse/pull/105919) ([Mikhail Artemenko](https://github.com/Michicosun)).
* During index analysis on projections, the `minmax` index is now loaded from the projection itself rather than from the parent part, producing correct results. [#105940](https://github.com/ClickHouse/ClickHouse/pull/105940) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fixed an exception in `addMonotonicChain` for `materialize(monotonic_chain(...))`. [#106050](https://github.com/ClickHouse/ClickHouse/pull/106050) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed `RESTORE` failing on backups that include `MASKING POLICY` dependents. [#106086](https://github.com/ClickHouse/ClickHouse/pull/106086) ([Julia Kartseva](https://github.com/jkartseva)).
* Fixed possible memory corruption when expanding SQL user-defined functions with `prefer_column_name_to_alias` enabled. [#106121](https://github.com/ClickHouse/ClickHouse/pull/106121) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* A dictionary using the bridge connection is now reloaded after a server restart, re-establishing the connection. Closes [#106151](https://github.com/ClickHouse/ClickHouse/issues/106151). [#106152](https://github.com/ClickHouse/ClickHouse/pull/106152) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fixed the filesystem cache for `LocalObjectStorage`. [#106239](https://github.com/ClickHouse/ClickHouse/pull/106239) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fixed the lazy remote source for table functions with `use_delayed_remote_source`. [#106470](https://github.com/ClickHouse/ClickHouse/pull/106470) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fixed `timeSeriesLastToGrid` for timestamps before the grid start and out-of-window timestamps. [#106504](https://github.com/ClickHouse/ClickHouse/pull/106504) ([Vitaly Baranov](https://github.com/vitlibar)). [#106577](https://github.com/ClickHouse/ClickHouse/pull/106577) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fixed a `LOGICAL_ERROR` (`Inconsistent AST formatting`) on a function name containing query parameters. [#106635](https://github.com/ClickHouse/ClickHouse/pull/106635) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fixed a logical error when a table is dropped before distributed plan task deserialization. [#106944](https://github.com/ClickHouse/ClickHouse/pull/106944) ([Alexander Gololobov](https://github.com/davenger)).
* Use exact comparison for `Nullable` `GROUP BY` keys. [#107050](https://github.com/ClickHouse/ClickHouse/pull/107050) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed a `LOGICAL_ERROR` (`Trying to get name of not a column`) raised when a table-function argument was not a column expression (for example an unresolved `*` matcher from `multiIf`/`CASE`). [#107411](https://github.com/ClickHouse/ClickHouse/pull/107411) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed unbounded growth of the time-zone cache (`DateLUT`) when many distinct invalid time-zone names are processed. [#107464](https://github.com/ClickHouse/ClickHouse/pull/107464) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Write the `part_log` entry before reporting a plain `MergeTree` mutation as done. [#107741](https://github.com/ClickHouse/ClickHouse/pull/107741) ([Azat Khuzhin](https://github.com/azat)).
* `arrayFold` now sanity-checks its array argument against malformed input. [#107932](https://github.com/ClickHouse/ClickHouse/pull/107932) ([Michael Kolupaev](https://github.com/al13n321)).
* Fixed a rare data race and possible use-after-free on the cached skip-index archive reader of a `MergeTree` part, which could happen when a query read skip indices while the part was being moved or renamed. [#107995](https://github.com/ClickHouse/ClickHouse/pull/107995) ([Raúl Marín](https://github.com/Algunenano)).
* Fix performance regression for `Map` subcolumns with `PREWHERE`. [#107988](https://github.com/ClickHouse/ClickHouse/pull/107988) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `parseDateTimeBestEffort` with a timezone throwing `CANNOT_PARSE_DATETIME` on NULL rows of `toString(Nullable(DateTime64))`. [#108310](https://github.com/ClickHouse/ClickHouse/pull/108310) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed the `ArrowFlight` table function and engine rejecting a named collection that omits the optional `dataset` key with a `No such key 'dataset'` error. [#108041](https://github.com/ClickHouse/ClickHouse/pull/108041) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an `Inconsistent AST formatting` logical error for a no-argument window function inside a `CODEC` or engine declaration (e.g. `CODEC(cume_dist() OVER (...))`); such a function now keeps its parentheses so the query survives a format/parse round-trip. [#107806](https://github.com/ClickHouse/ClickHouse/pull/107806) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `hasToken` with a separator-containing needle silently returning results via a text index instead of raising `BAD_ARGUMENTS`. [#108189](https://github.com/ClickHouse/ClickHouse/pull/108189) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* The setting `use_skip_indexes_on_data_read` can now be reverted to its pre-26.1 default (`false`) via the `compatibility` setting, providing an escape hatch for a performance regression where the on-data-read path defeats `minmax`/`set`/`bloom_filter` skip-index mark-range pruning. [#108330](https://github.com/ClickHouse/ClickHouse/pull/108330) ([egor romanov](https://github.com/egor-click)).
* Fixed a possible crash (null pointer dereference) when the `database`/`db` override of a named collection passed to `remote`/`remoteSecure` is not a constant database name, e.g. `remote(nc, database = (SELECT 1))`. The query now fails with a clear error instead of crashing. [#108271](https://github.com/ClickHouse/ClickHouse/pull/108271) ([Groene AI](https://github.com/groeneai)).
* Fixed refreshable materialized view getting stuck if the ZooKeeper connection is lost at the wrong moment. [#108234](https://github.com/ClickHouse/ClickHouse/pull/108234) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix `Bad cast from type DB::ColumnVector<...> to DB::ColumnTuple` when reading an `Array(Tuple(...))` column whose value is filled with defaults, e.g. after `ALTER TABLE ... ADD COLUMN` or after an unfinished `ALTER TABLE ... CLEAR COLUMN` mutation applied on the fly. [#107232](https://github.com/ClickHouse/ClickHouse/pull/107232) ([Groene AI](https://github.com/groeneai)).
* Fix a `Bad cast from type DB::ColumnDynamic to DB::ColumnNullable` logical error when an explicit reference to a `JOIN ... USING` key whose common supertype is `Dynamic` is passed to an aggregate function, for example `count(t.key) IGNORE NULLS`. [#107289](https://github.com/ClickHouse/ClickHouse/pull/107289) ([Groene AI](https://github.com/groeneai)).
* Fix silent data loss on plain (non-replicated) `MergeTree` when `REPLACE PARTITION`, `MOVE PARTITION`, `DETACH PARTITION`, or `DETACH PART` is run on a partition that still has unapplied lightweight `UPDATE` patches. These operations now reject the command, as `ReplicatedMergeTree` already does. [#107386](https://github.com/ClickHouse/ClickHouse/pull/107386) ([Groene AI](https://github.com/groeneai)).
* Fix a crash (SIGSEGV in release builds, type-mismatch assertion in debug builds) in `has` over a `Map` with a `Dynamic` key when the lookup argument is `LowCardinality`, e.g. `has(map('a'::Dynamic, ...), toLowCardinality('b'))`. [#107956](https://github.com/ClickHouse/ClickHouse/pull/107956) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` ("Block structure mismatch ... between `ConvertingTransform` and `RemovingReplicatedColumnsTransform`") when inserting into a materialized view whose `TO` target table declares a column with a wider `Enum` than the view's `SELECT` produces. The valid `Enum` widening is now applied. [#107648](https://github.com/ClickHouse/ClickHouse/pull/107648) ([Groene AI](https://github.com/groeneai)).
* Fix `NUMBER_OF_COLUMNS_DOESNT_MATCH` error when querying a `Distributed` table (or using parallel replicas) that has several `ALIAS` columns expanding to the same expression and referencing them together with `ORDER BY`/`GROUP BY`/`HAVING`. [#107913](https://github.com/ClickHouse/ClickHouse/pull/107913) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fixed undefined behavior (null pointer passed to `memcpy`) in the `detectCharset` and `detectLanguageUnknown` functions when the input string is larger than 32768 bytes and no character set can be detected. [#108250](https://github.com/ClickHouse/ClickHouse/pull/108250) ([Groene AI](https://github.com/groeneai)).
* Fix `signed integer overflow` (undefined behavior) in `dateDiff` with `hour` and `minute` units on extreme `DateTime64` values close to the `Int64` range limits. [#108229](https://github.com/ClickHouse/ClickHouse/pull/108229) ([Groene AI](https://github.com/groeneai)).
* Fix `Too many marks` for a text index on an empty merged part. [#106867](https://github.com/ClickHouse/ClickHouse/pull/106867) ([Azat Khuzhin](https://github.com/azat)).
* Fix a `LOGICAL_ERROR` ("Unexpected return type from if") when reading a column under `apply_mutations_on_fly = 1` after an `ALTER UPDATE col = ... WHERE <cond>` with a non-constant or false condition followed by `ALTER MODIFY COLUMN col <new type>`. [#108128](https://github.com/ClickHouse/ClickHouse/pull/108128) ([Groene AI](https://github.com/groeneai)).
* Fix a server abort (`Logical error` in `IColumn::insertFrom`) when casting an `Array(Dynamic)` or `Array(Variant)` to `QBit` with `accurateCastOrNull`, e.g. `accurateCastOrNull(CAST(range(114), 'Array(Dynamic)'), 'QBit(Float32, 114)')`. [#108288](https://github.com/ClickHouse/ClickHouse/pull/108288) ([Groene AI](https://github.com/groeneai)).
* Fixed a syntax error when an alias follows a subquery in `DESCRIBE TABLE (...) AS ...`. [#100205](https://github.com/ClickHouse/ClickHouse/pull/100205) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* `getClientHTTPHeader` is now correctly treated as non-deterministic, so its result is no longer incorrectly reused by the query result cache. [#108029](https://github.com/ClickHouse/ClickHouse/pull/108029) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="266-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Build `delta-kernel-rs` with the `default-engine-native-tls` feature so that its own HTTP client (`reqwest`) can reuse the OpenSSL that ClickHouse already links in. This is only a partial `native-tls` enablement: `object_store` still forces `reqwest/rustls-tls-native-roots`, so `reqwest` ends up with both the `native-tls` and `rustls` backends. `delta-kernel-rs` remains disabled under MSan for now because `ring` is still compiled in via `object_store` (both transitively through `rustls` and directly for AWS request HMAC signing), and its hand-written assembly does not generate the symbols MSan requires (tracked upstream at [arrow-rs-object-store#585](https://github.com/apache/arrow-rs-object-store/pull/585)). [#96856](https://github.com/ClickHouse/ClickHouse/pull/96856) ([Austin Bonander](https://github.com/abonander)).
* Add PGO (Profile-Guided Optimization) and BOLT (Binary Optimization and Layout Tool) post-link optimization for the `clickhouse` binary. Profiles are collected from CI workloads and applied as a best-effort step during release builds — both stages fall back to non-optimized output if a profile is stale or incompatible. As of today, there are no benefits from PGO. [#100938](https://github.com/ClickHouse/ClickHouse/pull/100938) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `--storage` mode to `clickhouse keeper-bench` that benchmarks `KeeperStorage` in-process (no network, no raft, no state machine), using the same `setup`/`generator` config sections as the network mode. [#103081](https://github.com/ClickHouse/ClickHouse/pull/103081) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix build with `ENABLE_AWS_S3=OFF`. [#105390](https://github.com/ClickHouse/ClickHouse/pull/105390) ([Yue Ni](https://github.com/niyue)).
* Update `mongo-cxx-driver` to r4.3.0. [#105522](https://github.com/ClickHouse/ClickHouse/pull/105522) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix build against RapidJSON. [#105674](https://github.com/ClickHouse/ClickHouse/pull/105674) ([Ilya Golshtein](https://github.com/ilejn)).
* Speed up the build by removing transitive includes from widely-used base/ headers and stripping unused code from the vendored `Poco/Logger.h`. [#105702](https://github.com/ClickHouse/ClickHouse/pull/105702) ([Raúl Marín](https://github.com/Algunenano)).
* Updated `libxml2` from 2.15.1 to 2.15.3. [#105985](https://github.com/ClickHouse/ClickHouse/pull/105985) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `expat` 2.8.1 inside Poco. [#105988](https://github.com/ClickHouse/ClickHouse/pull/105988) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Bump `thrift` to `v0.23.0`. [#105993](https://github.com/ClickHouse/ClickHouse/pull/105993) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `postgres` tag `REL_18_4`. [#105994](https://github.com/ClickHouse/ClickHouse/pull/105994) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Upgrade `krb5` to 1.22.2. [#106076](https://github.com/ClickHouse/ClickHouse/pull/106076) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Update bundled `curl` to 8.20.0. [#106077](https://github.com/ClickHouse/ClickHouse/pull/106077) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Bumped `mariadb-connector-c` to 3.1.29. All the ClickHouse-relevant patches preserved. [#106287](https://github.com/ClickHouse/ClickHouse/pull/106287) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Bump distroless base image digests for libssl3t64 CVE fixes. [#106360](https://github.com/ClickHouse/ClickHouse/pull/106360) ([Rahul Nair](https://github.com/motsc)).
* Use `wasmtime` v45.0.1. [#106836](https://github.com/ClickHouse/ClickHouse/pull/106836) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Bump `openssl` to 3.5.7. [#106844](https://github.com/ClickHouse/ClickHouse/pull/106844) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Distroless Docker build now also updates the `:X.Y-distroless` and `:X.Y.Z-distroless` floating tags, not just the full-version tag. [#106932](https://github.com/ClickHouse/ClickHouse/pull/106932) ([Rahul Nair](https://github.com/motsc)).
* Disable unused `curl` features, such as NTLM auth, cookies, alt-svc, HSTS, DNS-over-HTTPS, netrc, MIME, AWS SigV4. [#107226](https://github.com/ClickHouse/ClickHouse/pull/107226) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Updated `NuRaft` with a fix for a snapshot-install livelock that occurred when snapshot IO ran on a background thread. The `nuraft_use_bg_thread_for_snapshot_io` Keeper setting remains disabled by default; CI now randomizes it to cover both modes. [#107338](https://github.com/ClickHouse/ClickHouse/pull/107338) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix building `abseil` when the ClickHouse checkout path contains a substring matching a header extension. [#107349](https://github.com/ClickHouse/ClickHouse/pull/107349) ([zhiqiang](https://github.com/zhiqiang-hhhh)).
* Determine the L2 cache size from `CPUID` on x86\_64 instead of the glibc-specific `sysconf(_SC_LEVEL2_CACHE_SIZE)`, which is not available under musl libc. [#107469](https://github.com/ClickHouse/ClickHouse/pull/107469) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Increase the stack size for musl builds to 8 MiB to support deeply-nested queries. [#107470](https://github.com/ClickHouse/ClickHouse/pull/107470) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Derive the set of C library symbols localized in Rust static libraries from the actual reference libraries instead of a hand-maintained allowlist, so all compiler-rt builtins and platform libm functions are covered. [#107571](https://github.com/ClickHouse/ClickHouse/pull/107571) ([Raúl Marín](https://github.com/Algunenano)).
* Switch the distroless server and keeper images to `gcr.io/distroless/base-nossl-debian13` so they only ship the libraries ClickHouse actually links against and stop pulling in ones we statically link ourselves. [#107837](https://github.com/ClickHouse/ClickHouse/pull/107837) ([Rahul Nair](https://github.com/motsc)).
* Re-enable 50 stateless tests on macOS (`arm_darwin`) that were stale-skipped, and use `fsync` instead of `F_FULLFSYNC` for directory syncing on macOS. [#107887](https://github.com/ClickHouse/ClickHouse/pull/107887) ([Raúl Marín](https://github.com/Algunenano)).

<h3 id="265">
  ClickHouse release 26.5, 2026-05-21. [Presentation](https://presentations.clickhouse.com/2026-release-26.5/), [Video](https://www.youtube.com/watch?v=P1IDAvsi7p8)
</h3>

<h4 id="265-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* Changed defaults of `date_time_input_format` and `cast_string_to_date_time_mode` from `basic` to `best_effort`. Queries that previously failed to parse non-basic datetime strings (e.g. `2024 April 4`, `Apr 15, 2020 10:30:00`) may now succeed by default. To keep the old strict parsing behavior, set these settings to `basic` (or use `compatibility`). [#89334](https://github.com/ClickHouse/ClickHouse/pull/89334) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Tuple element name `null` is now forbidden because it conflicts with the subcolumn name used for Nullable null maps, causing ambiguous subcolumn resolution. [#98377](https://github.com/ClickHouse/ClickHouse/pull/98377) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add a setting `dynamic_disk_allow_from_env`, `dynamic_disk_allow_from_zk`, `dynamic_disk_allow_include` to disallow usage of `from_env`, `from_zk`, `include` in dynamic disks. Backward Incompatible Change because prohibits by default the behaviour which used to be allowed by default. [#99138](https://github.com/ClickHouse/ClickHouse/pull/99138) ([Kseniia Sumarokova](https://github.com/kssenii)).
* You can no longer use the obsolete Arrow-based Parquet reader and writer. The native implementation will be used instead. [#100949](https://github.com/ClickHouse/ClickHouse/pull/100949) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `SHOW CREATE TABLE t` now prefers the temporary table when both a permanent and a temporary table named `t` exist and no database is specified, matching the existing behavior of `DESCRIBE TABLE`. Additionally, `DESCRIBE TEMPORARY TABLE` syntax is now supported. [#100966](https://github.com/ClickHouse/ClickHouse/pull/100966) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduced default `http_max_fields` from 1,000,000 to 1,000 and `http_max_field_name_size` from 128 KB to 4 KB to limit pre-authentication memory usage by HTTP connections. Added `http_max_request_header_size` and `http_headers_read_timeout` settings. Users who rely on the previous higher limits can restore them via settings. [#103285](https://github.com/ClickHouse/ClickHouse/pull/103285) ([Sema Checherinda](https://github.com/CheSema)).
* Added a `histograms` nested column to `system.metric_log` that snapshots every registered histogram metric per row, with a new `system_metric_log_show_zero_values_in_histograms` setting to control zero-value emission. Deprecates the `system.histogram_metric_log` table. [#103770](https://github.com/ClickHouse/ClickHouse/pull/103770) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* `CAST` to `DateTime` or `DateTime64` without an explicit time zone now preserves the time zone of its source argument (when the source is a `DateTime`/`DateTime64` with an explicit time zone), matching the behavior of the `toDateTime`/`toDateTime64` functions. Closes [#55072](https://github.com/ClickHouse/ClickHouse/issues/55072). [#104433](https://github.com/ClickHouse/ClickHouse/pull/104433) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Removed the `kql` table function. Use `SET dialect = 'kusto'` to run queries in the KQL dialect. [#105101](https://github.com/ClickHouse/ClickHouse/pull/105101) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The window functions `RANK` and `DENSE_RANK` now reject arguments and throw `NUMBER_OF_ARGUMENTS_DOESNT_MATCH`, in line with the SQL standard. Previously, queries such as `RANK(x) OVER (ORDER BY id)` were silently accepted with the argument ignored. To restore the previous lenient behavior, set `allow_rank_dense_rank_arguments = 1`. Closes [#49526](https://github.com/ClickHouse/ClickHouse/issues/49526). [#104324](https://github.com/ClickHouse/ClickHouse/pull/104324) ([Groene AI](https://github.com/groeneai)).

<h4 id="265-new-feature">
  New Feature
</h4>

* Added a new setting `max_bytes_ratio_before_external_join`, mirroring `max_bytes_ratio_before_external_group_by` and `max_bytes_ratio_before_external_sort`. It expresses the spill-to-disk threshold for hash joins as a fraction of available memory; combined with the absolute `max_bytes_before_external_join`, the smaller resulting threshold applies. [#103862](https://github.com/ClickHouse/ClickHouse/pull/103862) ([Alexey Milovidov](https://github.com/alexey-milovidov)). The `new max_bytes_ratio_before_external_join` setting is now enabled by default at 0.5, mirroring `max_bytes_ratio_before_external_group_by` and `max_bytes_ratio_before_external_sort`. Hash joins automatically spill to grace hash join once the right-side data exceeds half of the available system memory (when memory limits are configured). [#104285](https://github.com/ClickHouse/ClickHouse/pull/104285) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add table function `filesystem`. It allows to represent directory structure as a table, to query files' metadata and contents with SQL. Originally [#42039](https://github.com/ClickHouse/ClickHouse/pull/42039) by @perst20. See [#42039](https://github.com/ClickHouse/ClickHouse/issues/42039). See [#50208](https://github.com/ClickHouse/ClickHouse/issues/50208). [#53610](https://github.com/ClickHouse/ClickHouse/pull/53610) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow passing bare function names to higher-order functions like `arrayMap`, `arrayFilter`, etc. For example, `arrayMap(negate, [1, 2, 3])` is now equivalent to `arrayMap(x -> negate(x), [1, 2, 3])`. [#101033](https://github.com/ClickHouse/ClickHouse/pull/101033) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add setting `send_table_structure_on_insert_with_inline_data` and `--inline-insert-data` client option to allow the server to parse inline INSERT data itself over the native protocol, avoiding the round-trip to receive table structure and improving performance for many small inserts. [#101034](https://github.com/ClickHouse/ClickHouse/pull/101034) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `tokenizeQuery` and `highlightQuery` functions for SQL query tokenization and syntax highlighting. `tokenizeQuery` returns lexer tokens with byte offsets and token types; `highlightQuery` returns parser-based syntax highlighting ranges with highlight categories (keyword, identifier, function, number, string, etc.). [#101054](https://github.com/ClickHouse/ClickHouse/pull/101054) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `url_base` setting to resolve relative URLs in the `url` table function and `URL` table engine, following RFC 3986 semantics. [#101113](https://github.com/ClickHouse/ClickHouse/pull/101113) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support negative values in the `LIMIT BY` clause to select rows from the *end* of each group instead of the beginning. For example, `LIMIT -2 BY id` returns the last two rows per `id`. Negative offsets (`LIMIT -1 OFFSET -1 BY id`) and mixed signs (`LIMIT -2 OFFSET 1 BY id`) are supported as well. [#103222](https://github.com/ClickHouse/ClickHouse/pull/103222) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Support `json_value` function to output with `tuple` and `array` to improve performance of multiple json query. [#78362](https://github.com/ClickHouse/ClickHouse/pull/78362) ([kevinyhzou](https://github.com/KevinyhZou)). Support multi-path `Tuple`/`Array` JSONPath argument in `JSON_VALUE`, `JSON_EXISTS`, and `JSON_QUERY`, by @KevinyhZou. [#101102](https://github.com/ClickHouse/ClickHouse/pull/101102) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* A new `kafka_autodetect_client_rack` parameter is introduced. If set, discover the Availability Zone via cloud facilities and propagate it as the `client.rack` parameter of `librdkafka` to avoid cross-zone communications. [#81323](https://github.com/ClickHouse/ClickHouse/pull/81323) ([Ilya Golshtein](https://github.com/ilejn)).
* Add `Read` event type to `system.blob_storage_log` for tracking object storage read operations, controlled by new setting `enable_blob_storage_log_for_read_operations`. [#96867](https://github.com/ClickHouse/ClickHouse/pull/96867) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Users can now see ZooKeeper watches issued by `clickhouse-server` using the new `system.zookeeper_watches` table. [#99277](https://github.com/ClickHouse/ClickHouse/pull/99277) ([Den Kalantaevskii](https://github.com/Diskein)).
* Added `Shards` profile event that counts the number of shards involved in distributed queries, summed across all tables. [#99470](https://github.com/ClickHouse/ClickHouse/pull/99470) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `WASM` UDFs can be declared `DETERMINISTIC` and become a subject of constant folding. [#100005](https://github.com/ClickHouse/ClickHouse/pull/100005) ([Vasily Chekalkin](https://github.com/bacek)).
* Add `parallel_replicas_prefer_local_replica` setting: when disabled, parallel replicas are selected purely by the load balancing algorithm, allowing even `max_parallel_replicas = 1` queries to be directed to another host. [#100139](https://github.com/ClickHouse/ClickHouse/pull/100139) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `{disk,storage,http}_connections_rcvbuf` and `{disk,storage,http}_connections_sndbuf` server settings to control TCP socket buffer sizes on outgoing HTTP connections, allowing operators to override kernel autotuning and cap per-connection memory usage. [#100478](https://github.com/ClickHouse/ClickHouse/pull/100478) ([Sema Checherinda](https://github.com/CheSema)).
* Support `CREATE OR REPLACE MATERIALIZED VIEW` with the same atomic swap semantics as `CREATE OR REPLACE TABLE`. Works with inner tables, `TO` tables, `POPULATE`, `REFRESH`, and `ON CLUSTER`. [#100539](https://github.com/ClickHouse/ClickHouse/pull/100539) ([DQ](https://github.com/il9ue)).
* Add `s3_read_request_duration_microseconds` and `s3_read_request_bytes` histogram metrics to observe S3 GET request connection lifetime and bytes consumed, visible in `system.histogram_metrics` and the Prometheus endpoint. [#102058](https://github.com/ClickHouse/ClickHouse/pull/102058) ([Sema Checherinda](https://github.com/CheSema)).
* Add `Paimon`, `PaimonS3`, `PaimonAzure`, `PaimonHDFS`, and `PaimonLocal` table engines with incremental read support backed by Keeper snapshot progress tracking. Incremental mode returns only new rows since the last committed snapshot. Targeted snapshot delta reads are available via `paimon_target_snapshot_id`, and per-query snapshot caps via `max_consume_snapshots`. Background metadata refresh is configurable with `paimon_metadata_refresh_interval_sec`. Gated by `allow_experimental_paimon_storage_engine`. [#102343](https://github.com/ClickHouse/ClickHouse/pull/102343) ([XiaoBinMu](https://github.com/Binnn-MX)).
* Added a new Kafka table setting `kafka_map_virtual_columns_on_write`. When enabled, columns named `_key`, `_timestamp`, `_headers.name` and `_headers.value` in the Kafka table schema are produced as the corresponding Kafka message key, timestamp and headers on `INSERT`, and are excluded from the message payload. [#103243](https://github.com/ClickHouse/ClickHouse/pull/103243) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `SYSTEM PAUSE VIEW [db.]name` and `SYSTEM PAUSE VIEWS` queries for refreshable materialized views. Unlike `SYSTEM STOP VIEW`, `SYSTEM PAUSE VIEW` does not interrupt the currently running refresh — the in-flight refresh is allowed to complete and only subsequent refreshes are prevented. Undone by `SYSTEM START VIEW` or `SYSTEM START VIEWS`, which now uniformly clear both the stopped and paused states. [#103252](https://github.com/ClickHouse/ClickHouse/pull/103252) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Added function `regexpPosition` (with PostgreSQL-compatible aliases `regexpInstr` and `regexp_instr`) that returns the byte position of the N-th regex match in a string. Supports start offset, return-after-match mode, regex flags, and capture-group selection. [#104172](https://github.com/ClickHouse/ClickHouse/pull/104172) ([Abhinav Agarwal](https://github.com/aagarwal-gtr)).
* New functions `isPrime` and `isProbablePrime` for primality checks. `isPrime` returns an exact result for unsigned integers up to `UInt64`. `isProbablePrime` also supports `UInt128` and `UInt256`; for those wider types, `0` means definitely composite and `1` means probably prime. The optional second argument of `isProbablePrime`, `rounds`, controls the confidence (capped at `256`); the default of `25` rounds bounds the false-positive rate for a random composite below `10^-15`, and `isProbablePrime` is cancellable. [#104234](https://github.com/ClickHouse/ClickHouse/pull/104234) ([Nihal Z. Miaji](https://github.com/nihalzp)). [#104639](https://github.com/ClickHouse/ClickHouse/pull/104639) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#104806](https://github.com/ClickHouse/ClickHouse/pull/104806) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* `clear` and `/clear` now clear the terminal in the clickhouse command-line tools instead of running as a mistaken query. [#104318](https://github.com/ClickHouse/ClickHouse/pull/104318) ([Tyler Hannan](https://github.com/tylerhannan)).
* Allow the `file` table function to accept an `Array(String)` of paths in `SELECT` queries. [#104442](https://github.com/ClickHouse/ClickHouse/pull/104442) ([Yue](https://github.com/niyue)).
* Add `deterministic` and `higher_order` columns to `system.functions` table. [#104479](https://github.com/ClickHouse/ClickHouse/pull/104479) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Add an optional encoding variant parameter to `bech32Encode` (`bech32` / `bech32m`) and a raw decode mode to `bech32Decode` for non-SegWit address encoding (e.g. Cosmos SDK, Injective, Osmosis). [#98986](https://github.com/ClickHouse/ClickHouse/pull/98986) ([Yash ](https://github.com/Onyx2406)).
* You can now write data in `AvroConfluent` format, which was previously input-only. This enables producing Confluent Schema Registry-framed Avro messages directly from ClickHouse, for example when writing to Kafka. The schema is automatically registered with the registry. Use the new `output_format_avro_confluent_subject` setting to specify the subject name. [#101935](https://github.com/ClickHouse/ClickHouse/pull/101935) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Added the `prettyPrintJSON` function to format a JSON string into a human-readable form. Useful for dashboards or reports where prettifying previously required an extra step on the client side. Closes [#62523](https://github.com/ClickHouse/ClickHouse/issues/62523). [#102594](https://github.com/ClickHouse/ClickHouse/pull/102594) ([Dmitry Prokofyev](https://github.com/prokofyevDmitry)).
* Added `STRING_AGG` as a case-insensitive alias of `groupConcat` for PostgreSQL / SQL-standard compatibility. [#105125](https://github.com/ClickHouse/ClickHouse/pull/105125) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Individual subquery results can now be cached independently using `SETTINGS use_query_cache = true` on specific subqueries, without caching the entire outer query. A new setting `query_cache_for_subqueries = true` enables bulk propagation of `use_query_cache` into all subqueries. Note: `use_query_cache` on the outer query no longer auto-propagates to subqueries. [#99804](https://github.com/ClickHouse/ClickHouse/pull/99804) ([Vincent Voyer](https://github.com/vvo)).
* Added lexer-based syntax highlighting to the query editor in the Web UI (`play.html`), modelled after `clickhouse-client` colors. [#105105](https://github.com/ClickHouse/ClickHouse/pull/105105) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="265-experimental-feature">
  Experimental Feature
</h4>

* Added an experimental web terminal interface at `/webterminal` that provides an interactive `clickhouse-client` session in the browser over WebSocket. Disabled by default; enable with the `allow_experimental_webterminal` server setting. See it [here](https://play.clickhouse.com/webterminal?user=play). [#100277](https://github.com/ClickHouse/ClickHouse/pull/100277) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#105191](https://github.com/ClickHouse/ClickHouse/pull/105191) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#105059](https://github.com/ClickHouse/ClickHouse/pull/105059) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `Kafka2` engine (experimental, with Keeper-based offset storage) now supports direct `SELECT` queries and the `kafka_commit_on_select` setting. [#100276](https://github.com/ClickHouse/ClickHouse/pull/100276) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `WASM` UDFs can now coerce more numeric types: smaller integers to wider integers (e.g. `Int8` to `UInt64`), and any integer to floating point (e.g. `Int32` to `Float32`). [#100435](https://github.com/ClickHouse/ClickHouse/pull/100435) ([Vasily Chekalkin](https://github.com/bacek)).
* Support `LIKE` function in `DELETE FROM system.webassembly_modules` query. [#104397](https://github.com/ClickHouse/ClickHouse/pull/104397) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Support geo types for `Iceberg`. [#103113](https://github.com/ClickHouse/ClickHouse/pull/103113) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Add prepared statements functionality to ArrowFlight SQL server. [#103047](https://github.com/ClickHouse/ClickHouse/pull/103047) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Improved KQL parser (for the Kusto language support) robustness by preserving parser depth and backtracks counters across KQL parser stages, so parser limits are tracked consistently for complex KQL queries. [#103528](https://github.com/ClickHouse/ClickHouse/pull/103528) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).

<h4 id="265-performance-improvement">
  Performance Improvement
</h4>

* Reuse the Parquet footer metadata cache when reading local Parquet files via the `file` table function or `File` table engine. Previously the cache was only consulted for object-storage backends. [#104260](https://github.com/ClickHouse/ClickHouse/pull/104260) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Push `ORDER BY ... LIMIT n` through `LEFT`/`RIGHT` joins when the sort key only references columns from the side preserved by the join, restricting how many rows the preserved-side input must produce before joining. Controlled by the new setting `query_plan_top_k_through_join` (default enabled). [#104268](https://github.com/ClickHouse/ClickHouse/pull/104268) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Enable `use_top_k_dynamic_filtering` and `use_skip_indexes_for_top_k` settings by default to improve performance of `ORDER BY ... LIMIT N` queries. [#99537](https://github.com/ClickHouse/ClickHouse/pull/99537) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Restrict `use_top_k_dynamic_filtering` to fixed-length sort columns by default, avoiding regressions on `ORDER BY <var-length-column> LIMIT N` queries where the per-row threshold comparison cost exceeds the I/O savings. The previous behavior is available via the new `use_top_k_dynamic_filtering_for_variable_length_types` setting. [#104216](https://github.com/ClickHouse/ClickHouse/pull/104216) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Use the oversize-arena feature of `jemalloc` to reduce page faults. [#103958](https://github.com/ClickHouse/ClickHouse/pull/103958) ([Nikita Taranov](https://github.com/nickitat)).
* Limit simultaneously active streams in `UNION ALL` to reduce peak memory usage. [#100176](https://github.com/ClickHouse/ClickHouse/pull/100176) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Slightly optimize the userspace page cache. [#100300](https://github.com/ClickHouse/ClickHouse/pull/100300) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Now the userspace page cache is always better than the OS page cache.
* Cold reads of object storage through the userspace page cache (`use_page_cache_for_object_storage = 1`) are now significantly faster, because consecutive cache misses are coalesced into a single HTTP request instead of one request per `page_cache_block_size` block. [#104230](https://github.com/ClickHouse/ClickHouse/pull/104230) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Speed up the index analysis involving type casting and function application. Closes [#55653](https://github.com/ClickHouse/ClickHouse/issues/55653). [#100366](https://github.com/ClickHouse/ClickHouse/pull/100366) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Speed up huge queries on `Merge` tables over a huge number of underlying tables. Closes [#32465](https://github.com/ClickHouse/ClickHouse/issues/32465). [#100369](https://github.com/ClickHouse/ClickHouse/pull/100369) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove vtable from setting field types, reducing `Settings` copy size by \~28x and improving cache locality via typed-array layout for all settings types. [#102269](https://github.com/ClickHouse/ClickHouse/pull/102269) ([Raúl Marín](https://github.com/Algunenano)).
* Add `max_threads_min_free_memory_per_thread` and `max_insert_threads_min_free_memory_per_thread` settings to automatically reduce query parallelism when the server is low on free memory. [#100383](https://github.com/ClickHouse/ClickHouse/pull/100383) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reduce memory usage on low-memory systems (\< 4 GiB). [#100389](https://github.com/ClickHouse/ClickHouse/pull/100389) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `OptimizeTrivialGroupByLimitPass`. For trivial `SELECT ... FROM t GROUP BY k LIMIT n` queries (no `HAVING`, `ORDER BY`, or window functions), the analyzer now sets `max_rows_to_group_by = n + offset` with `group_by_overflow_mode = 'any'`, so aggregation stops once `n` distinct keys have been produced instead of grouping the entire input. Controlled by the new setting `optimize_trivial_group_by_limit_query` (enabled by default). [#104473](https://github.com/ClickHouse/ClickHouse/pull/104473) ([Amos Bird](https://github.com/amosbird)) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Granule-level implicit min-max index for the `_part_offset` and `_block_number` virtual columns, including for projections. Enables fast pruning of granules based on virtual column predicates. [#103952](https://github.com/ClickHouse/ClickHouse/pull/103952) ([Mikhail Artemenko](https://github.com/Michicosun)). [#104746](https://github.com/ClickHouse/ClickHouse/pull/104746) ([Mikhail Artemenko](https://github.com/Michicosun)). [#105137](https://github.com/ClickHouse/ClickHouse/pull/105137) ([Mikhail Artemenko](https://github.com/Michicosun)).
* For the `prealloc_serialized` family of aggregation methods, precompute per-row hashes during the batch-serialization pass and use them to (a) skip rehashing in `emplaceKey`/`findKey` and (b) software-prefetch the next row's bucket. Speeds up multi-key string/serialized aggregation by hiding hash-table cache-miss latency. [#104475](https://github.com/ClickHouse/ClickHouse/pull/104475) ([Amos Bird](https://github.com/amosbird)) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Query condition cache for `Iceberg` tables. [#102115](https://github.com/ClickHouse/ClickHouse/pull/102115) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Optimize `cramersV`, `cramersVBiasCorrected`, `theilsU`, and `contingency` when used with window functions. Closes [#83521](https://github.com/ClickHouse/ClickHouse/issues/83521). [#93384](https://github.com/ClickHouse/ClickHouse/pull/93384) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Added a query optimization that rewrites `tupleElement(dictGet('dict', ('a', 'b', 'c'), key), N)` into `dictGet('dict', 'a', key)`, avoiding fetching unnecessary dictionary attributes. Controlled by the `optimize_dictget_tuple_element` setting (enabled by default). [#100186](https://github.com/ClickHouse/ClickHouse/pull/100186) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Enable buffering for sorting steps on the initiator for distributed queries with sorting. [#100661](https://github.com/ClickHouse/ClickHouse/pull/100661) ([Nikita Taranov](https://github.com/nickitat)).
* Performance improvement for `partial_merge` JOIN. [#100945](https://github.com/ClickHouse/ClickHouse/pull/100945) ([Artem Zuikov](https://github.com/4ertus2)).
* Slightly reduced memory over-allocation in `partial_merge` JOIN. [#100963](https://github.com/ClickHouse/ClickHouse/pull/100963) ([Artem Zuikov](https://github.com/4ertus2)).
* Optimize allocations/deallocations by caching sampling settings instead of traversing the entire memory-tracker hierarchy. [#101267](https://github.com/ClickHouse/ClickHouse/pull/101267) ([Azat Khuzhin](https://github.com/azat)).
* Reduce memory allocation overhead during S3 multipart uploads by preallocating internal tracking containers. [#101799](https://github.com/ClickHouse/ClickHouse/pull/101799) ([Gagan Dhakrey](https://github.com/gagandhakrey)).
* Add software prefetch in hash join probe phase to reduce memory access latency for large hash tables, controlled by setting `enable_software_prefetch_in_join`. [#102444](https://github.com/ClickHouse/ClickHouse/pull/102444) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Optimize `MemoryTracker` layout, improving its performance by \~25%. [#103464](https://github.com/ClickHouse/ClickHouse/pull/103464) ([Azat Khuzhin](https://github.com/azat)).
* Rewrite `coalesce(a, b, ...) <op> const` and `ifNull(a, b) <op> const` predicates before index analysis so per-column primary key and skip indexes on each argument can prune granules. Controlled by the new setting `allow_key_condition_coalesce_rewrite` (on by default). [#103468](https://github.com/ClickHouse/ClickHouse/pull/103468) ([Manuel](https://github.com/raimannma)).
* Significantly improved query performance when reading Iceberg catalogs with large JSON metadata files by optimizing escaped slash processing. [#103998](https://github.com/ClickHouse/ClickHouse/pull/103998) ([Mohaidoss](https://github.com/mohaidoss)).
* Avoid index uncompressed cache overhead when the cache is disabled (server setting `index_uncompressed_cache_size = 0`, which is the default). [#104063](https://github.com/ClickHouse/ClickHouse/pull/104063) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix `ORDER BY ... LIMIT` queries with small limit reading excessive granules when combined with a non-selective `WHERE` filter. Previously, any filter above an in-order read disabled the per-mark-range task split, so the pipeline could not cancel between granules and read the whole part for each stream. [#104112](https://github.com/ClickHouse/ClickHouse/pull/104112) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed missing hash table sizes cache reuse after reordering JOIN sides. [#104131](https://github.com/ClickHouse/ClickHouse/pull/104131) ([Nikita Taranov](https://github.com/nickitat)).
* When `fsync_after_insert` is enabled, fsync of part files is now performed in parallel using the IO thread pool, speeding up insert finalization on wide tables. The full ClickBench `hits` load is about 22% faster. [#104137](https://github.com/ClickHouse/ClickHouse/pull/104137) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Vectorise `find_first_symbols`, `find_first_not_symbols`, `find_last_symbols_or_null`, `find_last_not_symbols_or_null`, and `splitInto` on AArch64 using NEON. Previously these helpers had a SIMD path only on x86 (SSE2 / SSE4.2) and fell through to a scalar loop on ARM. Speeds up TSV parsing by \~2x, URL functions and `splitByChar` by \~1.3x on the ClickBench `hits` dataset; very dense JSON parsing (sub-16-byte field cadence) regresses slightly in line with the existing SSE2 trade-off. [#104228](https://github.com/ClickHouse/ClickHouse/pull/104228) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reading data through a trivial `ALIAS` column (e.g. `some_alias['key']` where `some_alias ALIAS m`) now goes through the same per-subcolumn read path as referencing the underlying column directly, restoring large I/O savings for `Map`, `Array`, `Tuple` and `Nullable` aliased columns. [#104245](https://github.com/ClickHouse/ClickHouse/pull/104245) ([Raúl Marín](https://github.com/Algunenano)).
* Reduced lock contention on the asynchronous remote-FS read path by making the per-query `AsyncReadCounters` lockless. [#104374](https://github.com/ClickHouse/ClickHouse/pull/104374) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Slightly better query plan for projections in-order scan. [#103723](https://github.com/ClickHouse/ClickHouse/pull/103723) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Extend `optimizeUseNormalProjections` to also handle a specific case where nothing was filtered but the projection's sorting key can remove the sorting step from the query plan. [#104680](https://github.com/ClickHouse/ClickHouse/pull/104680) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Allow `json.path[]` syntax sugar and explicit type hints to work correctly on typed `JSON` paths. [#99179](https://github.com/ClickHouse/ClickHouse/pull/99179) ([Pavel Kruglov](https://github.com/Avogar)).
* Optimize `json.path[N].nested.path` (which expands to `tupleElement(tupleElement(json.path[N], 'nested'), 'path')`) into `json.path[].nested.path[N]`, which reads much less data. [#99802](https://github.com/ClickHouse/ClickHouse/pull/99802) ([Pavel Kruglov](https://github.com/Avogar)).
* Optimize `SHOW TABLES` access checks in `system.parts` by hoisting database-level grant checks out of the per-table loop. [#100860](https://github.com/ClickHouse/ClickHouse/pull/100860) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Remove a redundant per-table `SHOW TABLES` access check in the `SELECT name` / `SELECT database, name` fast path of `system.tables`. [#100881](https://github.com/ClickHouse/ClickHouse/pull/100881) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Enable JIT compilation on macOS. [#100947](https://github.com/ClickHouse/ClickHouse/pull/100947) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Skip deferring the row policy after `FINAL` when it depends only on sorting-key columns and is deterministic, and skip the corresponding `PREWHERE` deferral that the row policy was forcing in that case. [#102884](https://github.com/ClickHouse/ClickHouse/pull/102884) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Added support for `hasAny` and `hasAll` as filter predicates in text indexes. [#103266](https://github.com/ClickHouse/ClickHouse/pull/103266) ([Anton Popov](https://github.com/CurtizJ)).
* Route long-lived MergeTree heap state (per-part and per-table metadata) to a dedicated jemalloc arena, exposed via `jemalloc.mergetree_arena.*` async metrics. Reduces default-arena fragmentation in steady-state and keeps per-part survivors from pinning otherwise-decayable pages. [#104136](https://github.com/ClickHouse/ClickHouse/pull/104136) ([Raúl Marín](https://github.com/Algunenano)).
* Improve ZooKeeper client timeout handling under heavy load when many requests are pipelined on a single session. The ZooKeeper client now uses a progress-based timeout: as long as any data is received from the server within `session_timeout_ms`, the wait is extended. A hard cap of `3 * session_timeout_ms` per request still bounds caller latency. Closes [#100466](https://github.com/ClickHouse/ClickHouse/issues/100466). [#104351](https://github.com/ClickHouse/ClickHouse/pull/104351) ([Antonio Andelic](https://github.com/antonio2368)).
* Move per-event trace flags into a separate array and allocate them lazily, reducing the overhead of `ProfileEvents` tracing. [#105030](https://github.com/ClickHouse/ClickHouse/pull/105030) ([Azat Khuzhin](https://github.com/azat)).
* Add `compareTrackAt` for `ColumnDecimal`, improving comparison performance for `Decimal` columns. [#105110](https://github.com/ClickHouse/ClickHouse/pull/105110) ([Artem Zuikov](https://github.com/4ertus2)).
* Added a SIMD implementation of `MD5` (`AVX2` / `AVX512`) that hashes multiple inputs in parallel, improving throughput. [#105161](https://github.com/ClickHouse/ClickHouse/pull/105161) ([Joanna Hulboj](https://github.com/jh0x)).

<h4 id="265-improvement">
  Improvement
</h4>

* Improve the help output for all ClickHouse applications: `--help` now consistently returns exit code `0`, prints to `stdout`, and a top-level `clickhouse --help` lists all subcommands. Adds a `--no-sudo` option for `clickhouse start` / `restart` (useful in Docker), and a `clickhouse help` subcommand. Continuation of [#58244](https://github.com/ClickHouse/ClickHouse/issues/58244) from @qoega. [#98148](https://github.com/ClickHouse/ClickHouse/pull/98148) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The default of `input_format_column_name_matching_mode` is changed from `match_case` to `auto`. Input formats that match input column names against the table schema (`JSONEachRow`, `CSVWithNames`, `JSONColumns`, `BSONEachRow`, `RowBinaryWithNames`, etc.) now first try a case-sensitive match and fall back to case-insensitive matching when the case-sensitive match misses. The previous strict behavior is preserved under `compatibility`. [#104320](https://github.com/ClickHouse/ClickHouse/pull/104320) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `STDDEV` as a case-insensitive alias of `stddevSamp` for PostgreSQL/SQL-standard compatibility. [#105120](https://github.com/ClickHouse/ClickHouse/pull/105120) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `array_to_string` as a case-insensitive alias of `arrayStringConcat` for PostgreSQL compatibility. [#105121](https://github.com/ClickHouse/ClickHouse/pull/105121) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `unnest` as a case-insensitive alias of `arrayJoin` for PostgreSQL compatibility (function-call form). [#105124](https://github.com/ClickHouse/ClickHouse/pull/105124) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The progress bar in `clickhouse-client` now shows temporary data on disk usage (e.g. for external sort, aggregation, or JOIN) next to RAM, including a per-host breakdown for distributed queries. [#105190](https://github.com/ClickHouse/ClickHouse/pull/105190) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `system.predicate_statistics_log`, a new sampled log of predicate filter selectivity and MergeTree index-granule pruning per query. Disabled by default; enable via the `predicate_statistics_sample_rate` server setting. Needed for automatic index and projection recommendations. [#98727](https://github.com/ClickHouse/ClickHouse/pull/98727) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Allow skipping local shard with missing table when `skip_unavailable_shards` is enabled. [#100141](https://github.com/ClickHouse/ClickHouse/pull/100141) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add startup warnings (visible in `system.warnings`) when a Linux mdraid array is being resynchronized or is in a degraded state, as both can affect disk I/O performance or indicate disk failures. [#100941](https://github.com/ClickHouse/ClickHouse/pull/100941) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* WASM UDFs now appear in `system.functions` with correct `origin` (`WasmUserDefined`), `syntax`, `arguments`, and `returned_value` columns populated from their ClickHouse type metadata. Previously they were either missing or listed with the wrong origin as duplicates. [#101053](https://github.com/ClickHouse/ClickHouse/pull/101053) ([Vasily Chekalkin](https://github.com/bacek)).
* The `generate_series` table function now supports negative step values for generating descending sequences, e.g. `SELECT * FROM generate_series(99, 0, -1)`. [#101056](https://github.com/ClickHouse/ClickHouse/pull/101056) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `Context has expired` exceptions raised by some functions (`dotProduct`, `formatRow`, `structureToCapnProtoSchema`/`structureToProtobufSchema`, user-defined functions) when used in deferred execution paths such as `DEFAULT`/`MATERIALIZED` expressions and table engine settings, by ensuring those functions hold a strong context where required. [#101109](https://github.com/ClickHouse/ClickHouse/pull/101109) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix spurious `Cache limits violated` logical errors on priorities created with zero limits (such as the per-query filesystem cache priority used when `enable_filesystem_query_cache_limit` is on). [#101428](https://github.com/ClickHouse/ClickHouse/pull/101428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Auto-detect the region for `s3express` endpoints. [#101520](https://github.com/ClickHouse/ClickHouse/pull/101520) ([Pradeep Chhetri](https://github.com/chhetripradeep)).
* Support field ids for data files in `Iceberg` writes. Closes [#102322](https://github.com/ClickHouse/ClickHouse/issues/102322). [#102362](https://github.com/ClickHouse/ClickHouse/pull/102362) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* The left panel in the web UI (`play.html`) now scrolls independently, stays visible when the page is scrolled, and clicking a table scrolls to the query area. [#102498](https://github.com/ClickHouse/ClickHouse/pull/102498) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow opening the Play UI in a new tab via Ctrl/Cmd/Shift+click or middle-click on the ClickHouse logo in the left panel. [#102501](https://github.com/ClickHouse/ClickHouse/pull/102501) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* New metrics to track memory used by projection primary keys and projection index granularity across all tables. [#102587](https://github.com/ClickHouse/ClickHouse/pull/102587) ([Narasimha Pakeer](https://github.com/npakeer)).
* Apply `max_network_bandwidth_for_user` and `max_network_bandwidth_for_all_users` to remote filesystem reads/writes. [#103080](https://github.com/ClickHouse/ClickHouse/pull/103080) ([Azat Khuzhin](https://github.com/azat)).
* Improve the resilience of backups when Refreshable Materialized Views are constantly refreshed by making decisions based on the snapshotted tables' state rather than a global one. [#103384](https://github.com/ClickHouse/ClickHouse/pull/103384) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* `SELECT * FROM system.databases` now always lists data lake catalog databases regardless of the `show_data_lake_catalogs_in_system_tables` setting. Previously they were hidden by default, which was inconsistent with `SHOW DATABASES` that always showed them. [#103444](https://github.com/ClickHouse/ClickHouse/pull/103444) ([Alsu Giliazova](https://github.com/alsugiliazova)).
* Align the default of the server setting `concurrent_threads_soft_limit_ratio_to_cores` in code with the shipped `config.xml` value (`2`), so the default `max_min_fair` concurrent threads scheduler caps query processing threads at 2x cores out of the box even when the shipped `config.xml` is not used. [#103446](https://github.com/ClickHouse/ClickHouse/pull/103446) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improved sanitizer robustness in parser and string-function edge cases by handling empty input in `getURLScheme`, avoiding null-pointer arithmetic in `Lexer::nextToken` `max_query_size` checks, and short-circuiting UTF-8 subsequence evaluation on empty haystacks before decoding. [#103489](https://github.com/ClickHouse/ClickHouse/pull/103489) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Improved correctness of monotonicity inference for `divide(0, x)` and `intDiv(0, x)`: previously the functions were unconditionally reported as monotonic, but `0 / x` is non-monotonic on any range that includes 0 because `0 / 0` is undefined (`NaN`/`Inf` for `divide`, division-by-zero exception for `intDiv`). The false claim caused `KeyCondition::applyMonotonicFunctionsChainToRange` to produce ranges with `left > right`, which tripped a `LOGICAL_ERROR` `Invalid binary search result in MergeTreeSetIndex` in debug builds when an `IN` / `NOT IN` expression on the primary key wrapped the key in `divide(0, key)` or `intDiv(0, key)`. Release builds were unaffected — the assertion is gated by `#ifndef NDEBUG`. [#103621](https://github.com/ClickHouse/ClickHouse/pull/103621) ([Groene AI](https://github.com/groeneai)).
* Replace the `HTTPConnectionPool*TCP{Rcv,Snd}BufBytes_{p50,p75,p90,p95}` async metrics with a bucket-based histogram `http_pool_tcp_buf_bytes` (labels `group`, `direction`) in `system.histogram_metrics`. Per-group total async metrics are preserved. [#103704](https://github.com/ClickHouse/ClickHouse/pull/103704) ([Sema Checherinda](https://github.com/CheSema)).
* The server settings `{disk,storage,http}_connections_{rcvbuf,sndbuf}` are now reported as changeable without restart in `system.server_settings`. Their values can be updated via `SYSTEM RELOAD CONFIG`; the runtime application path was already in place since [#100478](https://github.com/ClickHouse/ClickHouse/issues/100478). [#103772](https://github.com/ClickHouse/ClickHouse/pull/103772) ([Sema Checherinda](https://github.com/CheSema)).
* Add support for resolved symbols (`Array(String)`) in `flameGraph`. [#103816](https://github.com/ClickHouse/ClickHouse/pull/103816) ([Azat Khuzhin](https://github.com/azat)).
* CLI client can now specify `<rainbow_parentheses>false</rainbow_parentheses>` in its config in environments where terminal colors clash with the parentheses (similarly, `clickhouse format` now has `--no_rainbow_parentheses`). [#103851](https://github.com/ClickHouse/ClickHouse/pull/103851) ([Larry Snizek](https://github.com/larry-cdn77)).
* Fix `MultiVolnitsky` UTF-8 case-insensitive search by rolling back partial `putNGram` inserts on failure and switching failed needles to fallback searchers, avoiding inconsistent state. [#103864](https://github.com/ClickHouse/ClickHouse/pull/103864) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Implement `sched_getcpu` via `rseq` TLS in glibc-compatibility musl. [#104016](https://github.com/ClickHouse/ClickHouse/pull/104016) ([Azat Khuzhin](https://github.com/azat)).
* Replicated refreshable materialized view in APPEND mode will no longer refresh twice if connection to zookeeper was briefly lost during refresh. [#104051](https://github.com/ClickHouse/ClickHouse/pull/104051) ([Michael Kolupaev](https://github.com/al13n321)).
* Allow Distributed tables without an explicit column list to validate sharding keys against the inferred remote table structure. [#104111](https://github.com/ClickHouse/ClickHouse/pull/104111) ([Yue](https://github.com/niyue)).
* Fix REST catalog with `Azure` `abfss` path. [#104120](https://github.com/ClickHouse/ClickHouse/pull/104120) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Honor `role_arn` and `role_session_name` auth settings in the Keeper S3 snapshot client, allowing snapshot uploads to use STS `AssumeRole`-based authentication. [#104140](https://github.com/ClickHouse/ClickHouse/pull/104140) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a memory leak when running queries with `MATERIALIZED` CTEs. [#104153](https://github.com/ClickHouse/ClickHouse/pull/104153) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `lowerUTF8` / `upperUTF8` exception when processing large non-ASCII data sets (e.g. during text-index builds) where the accumulated output buffer would exceed 2 GiB; reject excessively long single rows with a clear error. [#104229](https://github.com/ClickHouse/ClickHouse/pull/104229) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Harden MergeTree column-statistics loading against transient I/O failures to prevent permanently disabling statistics-based optimizations for affected parts. [#104372](https://github.com/ClickHouse/ClickHouse/pull/104372) ([zoomxi](https://github.com/zoomxi)).
* `INSERT INTO ... SELECT FROM input(...)` no longer requires the `CREATE TEMPORARY TABLE` grant. [#104470](https://github.com/ClickHouse/ClickHouse/pull/104470) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added a new MergeTree setting `concurrent_part_removal_threshold_for_remote_disk` (default `16`) that is used instead of `concurrent_part_removal_threshold` when at least one part being removed is stored on a remote disk. The previous threshold of `100` could make `DROP TABLE` and other part-removal operations on object storage backends stall for tens of seconds because removals were performed serially even though each one is a separate network round-trip. The new setting causes the parallel removal path to be entered much sooner on remote storage, while leaving local-disk behavior unchanged. [#104676](https://github.com/ClickHouse/ClickHouse/pull/104676) ([Groene AI](https://github.com/groeneai)).
* New setting `defer_partition_pruning_after_final` (default `1`) makes the 26.3-introduced behavior of skipping partition pruning under `FINAL` opt-out. Set it to `0` to restore pre-26.3 partition pruning — substantially faster on event-log workloads where same-PK rows cannot span partitions. `compatibility = '26.2'` flips it to `0` automatically. [#104705](https://github.com/ClickHouse/ClickHouse/pull/104705) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix `intExp2` returning wrong results for out-of-range inputs (shifts `>= 64` under JIT, and integers with magnitude exceeding `INT_MAX` on both code paths). [#105054](https://github.com/ClickHouse/ClickHouse/pull/105054) ([Raúl Marín](https://github.com/Algunenano)).
* Quote shell arguments built from CLI options and parsed input in `clickhouse install` and `clickhouse git-import` so paths, user/group names, and commit hashes containing whitespace or shell metacharacters are handled correctly. [#105232](https://github.com/ClickHouse/ClickHouse/pull/105232) ([Raúl Marín](https://github.com/Algunenano)).
* The `Alias` table engine is now non-experimental and available without the `allow_experimental_alias_table_engine` setting. [#103488](https://github.com/ClickHouse/ClickHouse/pull/103488) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added `--queries-format` option to `clickhouse-benchmark` to choose between the default tab-escaped one-query-per-line input (`tsv`) and parsing standard input as a script of multiple queries separated by `;` (`script`). [#99972](https://github.com/ClickHouse/ClickHouse/pull/99972) ([Aleksandr Musorin](https://github.com/AVMusorin)).
* The element-wise tuple operators `tuplePlus`, `tupleMinus`, `tupleMultiply`, `tupleDivide`, `tupleModulo`, `tupleIntDiv`, and `tupleIntDivOrZero` are now variadic and accept two or more tuples of the same size, applied element-wise as a left-fold. They previously accepted exactly two arguments only. [#104659](https://github.com/ClickHouse/ClickHouse/pull/104659) ([Aruj Bansal](https://github.com/arujbansal)).
* Added a new built-in web UI at `/processors-profile` that visualizes the pipeline of any past `SELECT` query as a heatmap, sourced from `system.query_log` and `system.processors_profile_log`. Each processor is colored by its `elapsed_us` and shows per-processor stats (rows, bytes, wait times) on hover. [#104614](https://github.com/ClickHouse/ClickHouse/pull/104614) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Setting `query_plan_use_logical_join_step` (and its alias `query_plan_use_new_logical_join_step`) is now obsolete and has no effect; the logical join step is always used. [#104017](https://github.com/ClickHouse/ClickHouse/pull/104017) ([Vladimir Cherkasov](https://github.com/vdimir)).
* The `user` input on `play.html` and the other built-in web pages (`dashboard.html`, `jemalloc.html`, `merges.html`, `binary.html`, `webterminal.html`) is no longer pre-filled with the literal text `default`. It now shows a `user` placeholder hint and is empty by default. When left empty, the page does not send a `user=` URL parameter (and the WebTerminal auth JSON omits the `user` field), so the server applies its usual fallback to the `default` user — and HTTP credentials supplied via other channels (`X-ClickHouse-User`, HTTP Basic, per-handler `<handler><user>` configuration) are no longer overridden. [#105254](https://github.com/ClickHouse/ClickHouse/pull/105254) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `ORC` reader: decouple offset-based read (`readBigAt`) from `use_prefetch`, so EC-encoded data on `HDFS` can be read correctly even when `use_prefetch = false` (e.g. by Gluten). [#103348](https://github.com/ClickHouse/ClickHouse/pull/103348) ([zhanglistar](https://github.com/zhanglistar)).
* Files downloaded from `play.html` with the `CSVWithNames` format now use the `.csv` file extension. [#103737](https://github.com/ClickHouse/ClickHouse/pull/103737) ([JackFielding](https://github.com/JackFielding)).
* More input validation for the BigLake catalog. [#105117](https://github.com/ClickHouse/ClickHouse/pull/105117) ([Konstantin Vedernikov](https://github.com/scanhex12)).

<h4 id="265-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Fix inconsistent formatting by remembering if an expression was parenthesized. [#92340](https://github.com/ClickHouse/ClickHouse/pull/92340) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix accurate comparison between Decimal and Float types. [#94293](https://github.com/ClickHouse/ClickHouse/pull/94293) ([zoomxi](https://github.com/zoomxi)).
* Allow positional arguments in distributed queries. [#94359](https://github.com/ClickHouse/ClickHouse/pull/94359) ([simonmichal](https://github.com/simonmichal)).
* Fix assertion failure in `DatabaseCatalog::updateDependencies` when dropping and recreating a materialized view with the same name; also fix view dependencies being silently lost during `RENAME TABLE` or `EXCHANGE TABLES` when referential dependencies were empty. [#98779](https://github.com/ClickHouse/ClickHouse/pull/98779) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a server abort (assertion failure in `DatabaseCatalog::getTableImpl`) that occurred when creating a table via `ON CLUSTER` with a UUID identical to an existing database's UUID. [#98861](https://github.com/ClickHouse/ClickHouse/pull/98861) ([xiaohuanlin](https://github.com/xiaohuanlin)).
* Fixed usage of skip indexes on data read (with enabled setting `use_skip_indexes_on_data_read`) and existing patch parts created by lightweight updates. [#99543](https://github.com/ClickHouse/ClickHouse/pull/99543) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Not-ready Set" exception when a filter with `IN (subquery)` is moved to PREWHERE by the query optimizer. [#100375](https://github.com/ClickHouse/ClickHouse/pull/100375) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Cannot find column" error when combining `ADD COLUMN` with `RENAME COLUMN` in a single `ALTER TABLE` statement. [#100387](https://github.com/ClickHouse/ClickHouse/pull/100387) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix views with mixed `UNION` and `INTERSECT`/`EXCEPT` operators returning wrong results after `DETACH`/`ATTACH` or server restart. [#100390](https://github.com/ClickHouse/ClickHouse/pull/100390) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Trying to execute PLACEHOLDER action" exception that could occur during stress testing with the AST fuzzer when a correlated subquery appeared in an IN clause. [#100398](https://github.com/ClickHouse/ClickHouse/pull/100398) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception when inserting into an Iceberg table with a `Date` column partitioned by `year`, `month`, or `day` transforms. [#100404](https://github.com/ClickHouse/ClickHouse/pull/100404) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix skip index being used with incompatible data after `ALTER TABLE MODIFY COLUMN` changes the column type, which could cause server crashes in sanitizer builds or incorrect query results. [#100526](https://github.com/ClickHouse/ClickHouse/pull/100526) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix credential leak in `query_log` for `paimonCluster`, `paimonS3Cluster`, `paimonAzureCluster`, and `deltaLakeS3` table functions. [#100529](https://github.com/ClickHouse/ClickHouse/pull/100529) ([JIaQi Tang](https://github.com/JiaQiTang98)).
* Fix `DROP TABLE` on Kafka engine tables potentially hanging indefinitely due to a deadlock in `rd_kafka_consumer_close`. [#100604](https://github.com/ClickHouse/ClickHouse/pull/100604) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Replace the hardcoded `source_table_engines` list with runtime lookup via `StorageFactory` and `DatabaseFactory`. Add `source_access_type` to `DatabaseFactory::EngineFeatures` so that `CREATE DATABASE` with source engines (PostgreSQL, MySQL, S3, etc.) requires the same source grants as `CREATE TABLE`. Fixes `GRANT TABLE ENGINE ON *` failing with `table_engines_require_grant=false`. Closes [#71544](https://github.com/ClickHouse/ClickHouse/issues/71544). [#100746](https://github.com/ClickHouse/ClickHouse/pull/100746) ([pufit](https://github.com/pufit)).
* Fix server crash when reading from a table whose `ALIAS` column contained a correlated subquery nested inside a function call (e.g. `ALIAS toString(intDivOrZero(x, (SELECT ...)))`). `CREATE TABLE` and `ALTER TABLE` now reject any subquery at any depth in `DEFAULT` / `ALIAS` / `MATERIALIZED` column expressions with `THERE_IS_NO_DEFAULT_VALUE`. Previously, the shallow validation accepted nested subqueries, so the correlated case crashed at read time and the nested non-correlated case appeared to work but could lead to unexpected behavior; both are now rejected at DDL time. [#100753](https://github.com/ClickHouse/ClickHouse/pull/100753) ([Groene AI](https://github.com/groeneai)).
* Fixed a server crash (`Logical error: Bad cast from type DB::FunctionNode to DB::ColumnNode`) that could occur when using queries with correlated subqueries on tables that have `CONSTRAINT ... ASSUME` definitions, when `optimize_substitute_columns` and `convert_query_to_cnf` settings are enabled. [#100756](https://github.com/ClickHouse/ClickHouse/pull/100756) ([Groene AI](https://github.com/groeneai)).
* Fix an exception that could occur when inserting a row into a JSON column where the row introduced a new dynamic field alongside a typed field with an incompatible value, and the column was subsequently used as a GROUP BY key. [#100758](https://github.com/ClickHouse/ClickHouse/pull/100758) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix workload IO scheduling being silently bypassed for S3/object-storage writes that go through the `DiskObjectStorageTransaction` path (used by `s3_with_keeper` disks and explicitly when `use_fake_transaction=false`). Previously, INSERT writes into MergeTree tables on such disks ignored `CREATE RESOURCE` / `CREATE WORKLOAD` throttling because the resource link was never injected into `WriteSettings` for the transactional write path. [#100777](https://github.com/ClickHouse/ClickHouse/pull/100777) ([JIaQi Tang](https://github.com/JiaQiTang98)).
* Fix shared schema-cache collision between `Protobuf` and `ProtobufList`: reading a message first as `FORMAT Protobuf` and then as `FORMAT ProtobufList` could fail because `ProtobufList` forced the cached schema into its envelope form. `ProtobufList` now falls back to the cached message type when no envelope schema is available. [#100849](https://github.com/ClickHouse/ClickHouse/pull/100849) ([Callum Cooper](https://github.com/callumc34)).
* Fix heap-buffer-overflow in Rust CXX bridge due to `std::exception` ABI mismatch. [#100931](https://github.com/ClickHouse/ClickHouse/pull/100931) ([Azat Khuzhin](https://github.com/azat)).
* `FunctionVariantAdaptor` now throws `ILLEGAL_TYPE_OF_ARGUMENT` when all `Variant` alternatives are incompatible with a function, instead of silently returning `Nullable(Nothing)`. Previously, a `WHERE function(variant_col)` predicate where no alternative type was compatible would return 0 rows with no error, while the equivalent `SELECT` context already threw correctly. [#100939](https://github.com/ClickHouse/ClickHouse/pull/100939) ([Vasily Chekalkin](https://github.com/bacek)).
* `TRUNCATE ALL TABLES` no longer fails when the database contains views. [#100943](https://github.com/ClickHouse/ClickHouse/pull/100943) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the `optimize_rewrite_array_exists_to_has` optimization to correctly handle type-incompatible cases (e.g. Date vs String) and re-enable it by default. [#100944](https://github.com/ClickHouse/ClickHouse/pull/100944) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix S3 settings priority so that `storage_configuration` disk settings override global `<s3>` section, and user/profile/query-level settings override both. [#100975](https://github.com/ClickHouse/ClickHouse/pull/100975) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix sparse serialization losing the sign of negative zero (-0.0) for BFloat16, Float32, and Float64 columns. [#100983](https://github.com/ClickHouse/ClickHouse/pull/100983) ([Takumi Hara](https://github.com/takumihara)).
* Fixed two bugs in the WKT geometry parser used when reading WKT-encoded GeoParquet and Arrow files: `MULTILINESTRING` geometries were incorrectly parsed as `Polygon` (causing an exception for typed columns and silent data corruption for mixed `Geometry` columns), and a malformed WKT string with no type keyword triggered undefined behaviour instead of a clean error. [#100997](https://github.com/ClickHouse/ClickHouse/pull/100997) ([Vasily Chekalkin](https://github.com/bacek)).
* Fix `grouping`/`GROUPING SETS` queries on Distributed tables with a single shard that failed with "Method executeImpl is not supported for 'grouping' function". [#101030](https://github.com/ClickHouse/ClickHouse/pull/101030) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` "Column identifier is already registered" in the planner that could occur when the same table expression was processed multiple times. [#101048](https://github.com/ClickHouse/ClickHouse/pull/101048) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR exception "Column identifier is already registered" when `additional_result_filter` setting is used with UNION or EXCEPT queries. [#101051](https://github.com/ClickHouse/ClickHouse/pull/101051) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed server crash (Logical error: Bad cast from ColumnVector to ColumnNullable) when using `* APPLY` with aggregate functions and `group_by_use_nulls=1` with GROUPING SETS, ROLLUP, or CUBE. [#101062](https://github.com/ClickHouse/ClickHouse/pull/101062) ([Groene AI](https://github.com/groeneai)).
* Fix infinite loop when `input_format_csv_skip_first_lines` or `input_format_tsv_skip_first_lines` exceeds the number of lines in the file. [#101111](https://github.com/ClickHouse/ClickHouse/pull/101111) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix out-of-bounds access in lazy materialization optimization that could cause an exception in debug builds. [#101144](https://github.com/ClickHouse/ClickHouse/pull/101144) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix type inference in recursive CTEs: column types are now iteratively widened via `getLeastSupertype` across the non-recursive and recursive sides of the `UNION ALL` until convergence, preventing integer overflow in expressions like `x + 1`. [#101155](https://github.com/ClickHouse/ClickHouse/pull/101155) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Clamp MergeTree compress block size settings (max\_compress\_block\_size, min\_compress\_block\_size, marks\_compress\_block\_size, primary\_key\_compress\_block\_size) to 256 MiB to prevent server crash when extreme values are set via CREATE TABLE SETTINGS. [#101159](https://github.com/ClickHouse/ClickHouse/pull/101159) ([Groene AI](https://github.com/groeneai)).
* Fix a LOGICAL\_ERROR crash in `QueryAnalyzer::resolve()` when a ROW POLICY uses a scalar subquery in its `USING` clause (e.g. `USING (SELECT 1)`). Closes [#100695](https://github.com/ClickHouse/ClickHouse/issues/100695). [#101263](https://github.com/ClickHouse/ClickHouse/pull/101263) ([Groene AI](https://github.com/groeneai)).
* Fix undefined behavior in `MergeTreeDataPartWriterCompact::cancel` when a stream allocation fails. [#101292](https://github.com/ClickHouse/ClickHouse/pull/101292) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixes a case where timezone was not included during the assignment in the ALTER statement. Closes [#101328](https://github.com/ClickHouse/ClickHouse/issues/101328). Related [https://github.com/ClickHouse/ClickHouse/pull/100647](https://github.com/ClickHouse/ClickHouse/pull/100647). [#101403](https://github.com/ClickHouse/ClickHouse/pull/101403) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix server crash (LOGICAL\_ERROR) for INSERT SELECT queries with ORDER BY ALL when the SELECT pipeline produces multiple streams. [#101443](https://github.com/ClickHouse/ClickHouse/pull/101443) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect query results caused by join reordering pushing an INNER JOIN filter (referencing only the preserved side of an outer join) into the outer join’s ON clause. [#101504](https://github.com/ClickHouse/ClickHouse/pull/101504) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Skip applying lazy materialization for plans with arrayJoin, which could lead to limit not being respected. Close [#101608](https://github.com/ClickHouse/ClickHouse/issues/101608). [#101644](https://github.com/ClickHouse/ClickHouse/pull/101644) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix incorrect JOIN query results when `mergeFilterIntoJoinCondition` optimization silently dropped a WHERE equality condition with mismatched types. [#101652](https://github.com/ClickHouse/ClickHouse/pull/101652) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Fix the `error` test hint not working for syntax/parsing errors — previously `-- { error SYNTAX_ERROR }` on a malformed query would fail with "Expected server error" instead of matching the client-side parse error. [#101675](https://github.com/ClickHouse/ClickHouse/pull/101675) ([Groene AI](https://github.com/groeneai)).
* Fix `INTO OUTFILE ... TRUNCATE` not actually using atomic rename — the write went directly to the original file instead of a temp file, so on query failure the original content was destroyed. Now the data is written to a temp file and renamed only on success. [#101884](https://github.com/ClickHouse/ClickHouse/pull/101884) ([Pablo Marcos](https://github.com/pamarcos)).
* Fixed an exception `Unsupported DeltaLake type: varchar(n)` when reading Delta Lake tables whose schema contains varchar(n) or char(n) column types. These types are now mapped to String, consistent with how the Delta Lake protocol stores them as plain byte arrays in Parquet. [#101973](https://github.com/ClickHouse/ClickHouse/pull/101973) ([Flavio Malavazi](https://github.com/flaviomalavazi)).
* Fix silent data loss when reading tar archives from S3 with `schema_inference_mode=union` and heterogeneous Parquet schemas — the Parquet metadata cache incorrectly reused the first file's metadata for all subsequent files in the archive. [#101990](https://github.com/ClickHouse/ClickHouse/pull/101990) ([Ahaan Limaye](https://github.com/ahaanlimaye)).
* Fix server crash (LOGICAL\_ERROR) when executing ALTER TABLE UPDATE/DELETE on Iceberg tables when no prior SELECT or INSERT was done on the table in the same server lifetime. [#102113](https://github.com/ClickHouse/ClickHouse/pull/102113) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix possible crash when an ALTER query executed on tables from in-memory database (e.g. temporary tables). [#102360](https://github.com/ClickHouse/ClickHouse/pull/102360) ([Den Kalantaevskii](https://github.com/Diskein)).
* Fixed `formatQuery` producing duplicate grants like `GRANT FILE ON *.*, FILE ON *.* TO x` instead of `GRANT FILE ON *.* TO x` when formatting backward-compatible READ/WRITE grants on the same source. [#102411](https://github.com/ClickHouse/ClickHouse/pull/102411) ([Groene AI](https://github.com/groeneai)).
* Fix lost parallelism for aggregation after read-in-order queries when `max_streams_to_max_threads_ratio` is greater than 1. [#102467](https://github.com/ClickHouse/ClickHouse/pull/102467) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a crash (`LOGICAL_ERROR: Unknown virtual column`) when selecting subcolumns (like `.null` for Nullable, `.size0` for Array, tuple elements, or map keys/values) from a Buffer table engine. [#102470](https://github.com/ClickHouse/ClickHouse/pull/102470) ([Groene AI](https://github.com/groeneai)).
* Fix exception "Cannot fold actions for projection" in join reorder optimization when a LEFT/RIGHT JOIN with `join_use_nulls` is combined with other joins involving more than two tables. [#102516](https://github.com/ClickHouse/ClickHouse/pull/102516) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed silent overflow in scalar pointwise operations on numericIndexedVector (e.g. `numericIndexedVectorPointwiseAdd`) when the scalar is out of range. Such inputs now raise `INCORRECT_DATA` instead of returning corrupted values. [#102546](https://github.com/ClickHouse/ClickHouse/pull/102546) ([FriendLey](https://github.com/FriendLey)).
* Fix inconsistent AST formatting for INSERT with SAMPLE and query-level OFFSET. Closes [#102523](https://github.com/ClickHouse/ClickHouse/issues/102523). [#102547](https://github.com/ClickHouse/ClickHouse/pull/102547) ([zoomxi](https://github.com/zoomxi)).
* Fix `LOGICAL_ERROR` exception in `groupConcat` when deserializing a malformed aggregate function state. [#102558](https://github.com/ClickHouse/ClickHouse/pull/102558) ([Christoph Wurm](https://github.com/cwurm)).
* Now we do not accept garbage at the end of Time64 CSV values with `input_format_csv_use_default_on_bad_values=0`. Closes [#102490](https://github.com/ClickHouse/ClickHouse/issues/102490). [#102596](https://github.com/ClickHouse/ClickHouse/pull/102596) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix UNKNOWN\_ELEMENT\_OF\_ENUM exception when inserting default value to JSON column with Enum typed paths. Closes [#102359](https://github.com/ClickHouse/ClickHouse/issues/102359). [#102687](https://github.com/ClickHouse/ClickHouse/pull/102687) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix columns\_substreams.txt corruption during column rename in some cases. Closes [#102259](https://github.com/ClickHouse/ClickHouse/issues/102259). [#102689](https://github.com/ClickHouse/ClickHouse/pull/102689) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix inserting into Time data type during JSON parsing. Closes [#102016](https://github.com/ClickHouse/ClickHouse/issues/102016). [#102690](https://github.com/ClickHouse/ClickHouse/pull/102690) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix hex encoding of content sample in cached schema filenames. Closes [#101904](https://github.com/ClickHouse/ClickHouse/issues/101904). [#102703](https://github.com/ClickHouse/ClickHouse/pull/102703) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed sort order violation (crash in debug, silent data corruption in release) during `SummingMergeTree` merge when the `ORDER BY` key is a hash expression over a `Float32` column containing signaling NaN values. [#102791](https://github.com/ClickHouse/ClickHouse/pull/102791) ([Groene AI](https://github.com/groeneai)).
* Make `DETACH DATABASE ... SYNC` and other operations that call `waitDetachedTableNotInUse` cancellable via `KILL QUERY` and responsive to server shutdown, preventing indefinite hangs when a concurrent query holds a table reference. [#102804](https://github.com/ClickHouse/ClickHouse/pull/102804) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed possible incorrect result of `ANY RIGHT JOIN`. [#102893](https://github.com/ClickHouse/ClickHouse/pull/102893) ([Nikita Taranov](https://github.com/nickitat)).
* Fix S3 requests failing with `ios_base::clear: unspecified iostream_category error` instead of being retried, caused by Poco `BufferedStreamBuf::flushBuffer` not handling short writes from the socket layer. [#102894](https://github.com/ClickHouse/ClickHouse/pull/102894) ([Sema Checherinda](https://github.com/CheSema)).
* Fix `input('auto')` table function failing via HTTP interface in INSERT SELECT queries. [#102902](https://github.com/ClickHouse/ClickHouse/pull/102902) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Disable trivial LIMIT optimization with row policies/additional\_table\_filters (to allow parallel index analysis). [#102921](https://github.com/ClickHouse/ClickHouse/pull/102921) ([Azat Khuzhin](https://github.com/azat)).
* Hide secret key in `HMAC` SQL function. Fix [#102927](https://github.com/ClickHouse/ClickHouse/issues/102927). [#102997](https://github.com/ClickHouse/ClickHouse/pull/102997) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fix `MULTIPLE_EXPRESSIONS_FOR_ALIAS` exception raised on distributed queries that reference the same `quantile` call multiple times (e.g. in `SELECT`, `HAVING`, and `ORDER BY`) with `optimize_syntax_fuse_functions` enabled. [#103014](https://github.com/ClickHouse/ClickHouse/pull/103014) ([tanner-bruce](https://github.com/tanner-bruce)).
* Fixes a case found by CI where a not-ready set was passed when the filter depends on the left-side column. Closes [#102966](https://github.com/ClickHouse/ClickHouse/issues/102966). [#103029](https://github.com/ClickHouse/ClickHouse/pull/103029) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix castOrNull to JSON in some cases. Closes [#101818](https://github.com/ClickHouse/ClickHouse/issues/101818). [#103036](https://github.com/ClickHouse/ClickHouse/pull/103036) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `SELECT DISTINCT` silently returning incomplete results when an aggregate projection matched the query and some parts of the table had no projection data (e.g. the projection was added on a table that already held data, and `MATERIALIZE PROJECTION` was not run). Closes [#102951](https://github.com/ClickHouse/ClickHouse/issues/102951). [#103052](https://github.com/ClickHouse/ClickHouse/pull/103052) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `TOO_FEW_ARGUMENTS_FOR_FUNCTION` exception when a `WHERE` predicate such as `AND(OR(A, A), A)` collapses to a single top-level argument during common expression extraction in the analyzer. [#103072](https://github.com/ClickHouse/ClickHouse/pull/103072) ([Peng](https://github.com/fastio)).
* Fix a logical error `Function writeSlice expects same column types for GenericArraySlice and GenericArraySink` raised when evaluating `if`/`ifNull` over tuples, maps, or arrays containing a `QBit` element. `ColumnQBit::structureEquals` incorrectly compared the inner tuple of one `QBit` column against the outer wrapper of the other, so structurally identical `QBit` columns were reported as different. [#103084](https://github.com/ClickHouse/ClickHouse/pull/103084) ([Groene AI](https://github.com/groeneai)).
* Make `DETACH DATABASE` with `database_atomic_wait_for_drop_and_detach_synchronously` respect `KILL QUERY` instead of hanging indefinitely when a table reference is held. [#103095](https://github.com/ClickHouse/ClickHouse/pull/103095) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix segfault when deleting WASM module using non-identifier predicate (e.g. `WHERE 1=1`). [#103101](https://github.com/ClickHouse/ClickHouse/pull/103101) ([Joe Redfern](https://github.com/JosephRedfern)).
* Fix backward compatibility break where old clients fail with `UNEXPECTED_PACKET_FROM_SERVER` when inserting into a newer server via `remote()` or distributed tables, caused by unconditional `sendProgress` at the end of `processInsertQuery`. [#103148](https://github.com/ClickHouse/ClickHouse/pull/103148) ([Sema Checherinda](https://github.com/CheSema)).
* IN with non-constant tuple second argument must not CAST tuple elements down to the LHS type, this can overflow. Closes [#103055](https://github.com/ClickHouse/ClickHouse/issues/103055). [#103169](https://github.com/ClickHouse/ClickHouse/pull/103169) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix use-of-uninitialized-value in protocol function. [#103187](https://github.com/ClickHouse/ClickHouse/pull/103187) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `LOGICAL_ERROR` (`Bad cast … to ColumnLowCardinality`) during MergeTree index analysis when a `WHERE` clause compares a `LowCardinality` key column with a constant cast to a type that contains nested `LowCardinality` (for example `Variant(LowCardinality(Date), String)`). [#103211](https://github.com/ClickHouse/ClickHouse/pull/103211) ([Groene AI](https://github.com/groeneai)).
* Fix `Logical error: 'index < bucket_count'` in the `timeSeries*ToGrid` aggregate function family (e.g. `timeSeriesResampleToGridWithStaleness`, `timeSeriesChangesToGrid`, `timeSeriesResetsToGrid`, `timeSeriesRateToGrid`) when called with extreme timestamp parameters that would overflow signed 64-bit arithmetic in the bucket count computation. Also cap the total number of grid buckets at 16 million to prevent accidental large-memory allocation from adversarial inputs. [#103223](https://github.com/ClickHouse/ClickHouse/pull/103223) ([Groene AI](https://github.com/groeneai)).
* Fix `Logical error: 'Port is already connected'` exception during pipeline expansion in the lazy `FINAL` path for `ReplacingMergeTree`. The bug affected queries with `query_plan_optimize_lazy_final = 1` when `ReadFromMergeTree::initializePipeline` inserted internal transforms (e.g. a `Resize`) that wired the sub-pipeline's processors together, causing `LazyUnorderedReadFromMergeTreeSource::expandPipeline` to try to connect output ports that were already connected. [#103230](https://github.com/ClickHouse/ClickHouse/pull/103230) ([Groene AI](https://github.com/groeneai)).
* Fix wrong results from `LIMIT BY` and `DISTINCT` when the input is a `UNION ALL` of sorted subqueries. The query plan optimizer incorrectly treated such a union as globally sorted, causing extra rows to be returned. [#103231](https://github.com/ClickHouse/ClickHouse/pull/103231) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix possible crash during statistics calculation in Map type with lazy replication. Closes [#102390](https://github.com/ClickHouse/ClickHouse/issues/102390). [#103273](https://github.com/ClickHouse/ClickHouse/pull/103273) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a data race for ClickHouse, MySQL, PostgreSQL and XDBC dictionary sources where `clone() const` reads from and `isModified() const` writes to the same `invalidate_query_response` string. [#103277](https://github.com/ClickHouse/ClickHouse/pull/103277) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix incorrect monotonicity detection for `Date32`. Closes [#101265](https://github.com/ClickHouse/ClickHouse/issues/101265). [#103283](https://github.com/ClickHouse/ClickHouse/pull/103283) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Cap pre-auth TCP Hello packet strings to 64 KB and add `handshake_timeout_milliseconds` server setting to limit total handshake time, preventing unauthenticated clients from consuming excessive memory or holding threads indefinitely. [#103284](https://github.com/ClickHouse/ClickHouse/pull/103284) ([Sema Checherinda](https://github.com/CheSema)).
* Fix Parquet ColumnIndex stats min\_value > max\_value for String columns. [#103334](https://github.com/ClickHouse/ClickHouse/pull/103334) ([Saurabh Kumar Ojha](https://github.com/saurabhojha)).
* Fix incorrect handling of NULL rows for `Nullable(Tuple(...))` inputs in `flattenTuple` and `tupleToNameValuePairs`. `flattenTuple` now preserves the outer null map so NULL rows stay NULL. `tupleToNameValuePairs` now changes the result's value type to `Nullable(T)` when possible when the input is `Nullable(Tuple(...))`, so NULL rows produce `[('a', NULL), ('b', NULL)]` instead of `[('a', 0), ('b', 0)]`. When the element type cannot be wrapped in `Nullable` (e.g. `Array`), default values are used instead of NULL. Closes [#103312](https://github.com/ClickHouse/ClickHouse/issues/103312). [#103383](https://github.com/ClickHouse/ClickHouse/pull/103383) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Check for malformed flattened Dynamic data in Native format. [#103392](https://github.com/ClickHouse/ClickHouse/pull/103392) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix stale RPC causing replication stall after snapshot sync. [#103406](https://github.com/ClickHouse/ClickHouse/pull/103406) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix a `LOGICAL_ERROR` "Cannot pop N rows from X" that aborted the server (in debug / sanitizer builds) when reading a malformed BSON document containing a value whose BSON type is incompatible with the target column type inside a `Nullable(T)` or `Array(Nullable(T))` column. The malformed row now produces a clean `ILLEGAL_COLUMN` exception as intended. [#103418](https://github.com/ClickHouse/ClickHouse/pull/103418) ([Groene AI](https://github.com/groeneai)).
* Fix a server abort in `arrayFill` and `arrayReverseFill` when applied to an `Array(String)` column whose first row is empty together with a constant-false lambda. The aggregate / sub-array loop underflowed a `size_t` index to `SIZE_MAX`, which then caused an out-of-bounds read inside `ColumnString::doInsertManyFrom`. Same bug family as [#12263](https://github.com/ClickHouse/ClickHouse/issues/12263). [#103424](https://github.com/ClickHouse/ClickHouse/pull/103424) ([Groene AI](https://github.com/groeneai)).
* Fixes ACCESS\_DENIED / UNKNOWN\_TABLE in downstream APPEND RMVs with SQL SECURITY DEFINER when an upstream REPLACE RMV's EXCHANGE flips the target storage identity mid-resolution. [#103427](https://github.com/ClickHouse/ClickHouse/pull/103427) ([Alexander Gololobov](https://github.com/davenger)).
* Populate `_time` column from `url` table function. [#103437](https://github.com/ClickHouse/ClickHouse/pull/103437) ([Nikita Taranov](https://github.com/nickitat)).
* Fix potential out-of-bounds read in the `ALP` codec decompression path when processing malformed input with an invalid bit-width. [#103457](https://github.com/ClickHouse/ClickHouse/pull/103457) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix a bug where `SYSTEM SYNC FILESYSTEM CACHE '<name>' ON CLUSTER ...` could lose the cache name while formatting the query, causing remote nodes to sync all filesystem caches instead of only the requested cache. [#103469](https://github.com/ClickHouse/ClickHouse/pull/103469) ([Asish Kumar](https://github.com/officialasishkumar)).
* Fix processing of URL-encoded path in `deltaLakeAzure`. Closes [#103509](https://github.com/ClickHouse/ClickHouse/issues/103509). [#103525](https://github.com/ClickHouse/ClickHouse/pull/103525) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fix heap-use-after-free in multiplying an `AggregateFunction` state by an integer (e.g. `quantilesExactState(...) * N`). The exponentiation-by-squaring loop merged the state with itself, which is undefined when the aggregate function's `merge` reallocates its internal storage. Closes STID 0988-40af. [#103536](https://github.com/ClickHouse/ClickHouse/pull/103536) ([Groene AI](https://github.com/groeneai)).
* Fixed a rare `LOGICAL_ERROR` "Part X intersects previous part Y" raised during `ReplicatedMergeTree` table startup when two empty unexpected parts on disk had overlapping but non-containing block ranges. The exception aborted the table-attach thread and prevented the table from coming up. [#103537](https://github.com/ClickHouse/ClickHouse/pull/103537) ([Groene AI](https://github.com/groeneai)).
* Fix `Logical error: Incorrect mark rows for part ...` (debug-only assertion) that was triggered by mutations on `MergeTree` tables with non-adaptive index granularity (`index_granularity_bytes = 0`) whose last data mark was incomplete (most reliably reproduced via `DETACH`/`ATTACH` followed by a lightweight `DELETE`). [#103538](https://github.com/ClickHouse/ClickHouse/pull/103538) ([Groene AI](https://github.com/groeneai)).
* Fix `clickhouse-local` returning 0 rows silently when reading from `/proc` and `/sys` pseudo-files via the `file()` table function (e.g. `SELECT * FROM file('/proc/cpuinfo', 'RawBLOB')`). [#103548](https://github.com/ClickHouse/ClickHouse/pull/103548) ([Ashrith Bandla](https://github.com/ashrithb)).
* Fixed handling of the `max_string_length` argument for the `GenerateRandom` table engine. [#103550](https://github.com/ClickHouse/ClickHouse/pull/103550) ([Alex Kuleshov](https://github.com/0xAX)).
* Fix masking nested credentials in logs. [#103552](https://github.com/ClickHouse/ClickHouse/pull/103552) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix SVE detection using SVE instructions when unavailable. [#103568](https://github.com/ClickHouse/ClickHouse/pull/103568) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `GenerateRandom` storage args parsing. [#103574](https://github.com/ClickHouse/ClickHouse/pull/103574) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix infinite loop on `WITH FILL` for data starting with ±inf. [#103580](https://github.com/ClickHouse/ClickHouse/pull/103580) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix `JSONExtract` into a `Variant` type silently truncating fractional JSON numbers. Previously, `JSONExtract('{"x": 3.14}', 'x', 'Variant(Int64, Float64)')` returned `Int64=3` and `JSONExtract('{"x": 3.14}', 'x', 'Variant(String, Int64)')` returned `Int64=3`, dropping the fractional part. The fractional value is now preserved losslessly: a `Float64`/`Decimal` member claims it when present, otherwise a `String` member captures the original JSON. `Variant` types containing only integer members (e.g. `Variant(Int64, Int32)`) and direct integer extraction (`JSONExtract(json, 'Int64')`, `JSONExtractInt`, etc.) are unchanged. [#103620](https://github.com/ClickHouse/ClickHouse/pull/103620) ([Groene AI](https://github.com/groeneai)).
* Fix `SYSTEM INSTRUMENT REMOVE` without arguments producing `std::bad_optional_access` (error code 1001) instead of `SYNTAX_ERROR` (error code 62). [#103622](https://github.com/ClickHouse/ClickHouse/pull/103622) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix logical error / undefined behavior in `windowID` and `tumble` window view when called with a timezone string as the 3rd argument. [#103641](https://github.com/ClickHouse/ClickHouse/pull/103641) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* S3 client logging now treats HTTP 400 responses that include a non-empty x-amz-bucket-region header (wrong SigV4 signing region) as an informational wrong-region case with a clearer log line instead of the generic error-style path. The STS web identity credentials provider is added to the S3 credentials chain only when web identity is configured, which reduces spurious warnings for deployments that do not use it. Closes [#99140](https://github.com/ClickHouse/ClickHouse/issues/99140). [#103673](https://github.com/ClickHouse/ClickHouse/pull/103673) ([MeltonSmith](https://github.com/MeltonSmith)).
* Fix `SYSTEM SYNC REPLICA <db>.<tbl> IF EXISTS` to silently succeed when the database does not exist, matching the existing behaviour for a missing table and the precedent set by `DROP TABLE IF EXISTS`. Previously the query threw `UNKNOWN_DATABASE` despite `IF EXISTS`. Closes [#103629](https://github.com/ClickHouse/ClickHouse/issues/103629). [#103689](https://github.com/ClickHouse/ClickHouse/pull/103689) ([Groene AI](https://github.com/groeneai)).
* Fix logical error `Arguments of 'plus' have incorrect data types` thrown by `FunctionBinaryArithmetic::executeImpl2` when a `MergeTree` table had `Array(LowCardinality(...))` in its sort key and a `WHERE` clause used `plus` / `minus` between that column and an `Array` constant of a different element type. `KeyCondition::getMonotonicityForRange` now strips `LowCardinality` recursively before invoking the inner numeric dispatch. [#103701](https://github.com/ClickHouse/ClickHouse/pull/103701) ([Groene AI](https://github.com/groeneai)).
* Fix dynamic cache resize race in 26.1+. [#103702](https://github.com/ClickHouse/ClickHouse/pull/103702) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fixed an issue where text and bloom\_filter skip indices on `ALIAS` columns whose expression contained a lambda with captured constants (e.g. `arrayMap((k, v) -> concat(k, '=', v), mapKeys(m), mapValues(m)))` were silently ignored. [#103708](https://github.com/ClickHouse/ClickHouse/pull/103708) ([Anton Popov](https://github.com/CurtizJ)).
* Fix `position` and `positionCaseInsensitive` with a `start_pos` close to `UINT64_MAX` getting stuck or causing a segmentation fault due to overflowing pointer arithmetic. [#103766](https://github.com/ClickHouse/ClickHouse/pull/103766) ([Raúl Marín](https://github.com/Algunenano)).
* Fixes undefined behavior while parsing dateTime with a double fractional part. [#103773](https://github.com/ClickHouse/ClickHouse/pull/103773) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed a data-correctness regression in 26.x where JIT-compiled `if` and `multiIf` with a `Decimal` result type and a non-`Decimal` (integer or float) literal in one branch silently returned a value `10^scale` too small. The slow (non-JIT) path was unaffected. Workaround on affected versions: `SET compile_expressions = 0`. [#103809](https://github.com/ClickHouse/ClickHouse/pull/103809) ([Groene AI](https://github.com/groeneai)).
* Fixes forwarding the tokenizer from the text index to supported functions. [#103826](https://github.com/ClickHouse/ClickHouse/pull/103826) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Fix wrong results from `numbers`, `generate_series`, and similar range-honoring sources when the `WHERE` clause uses `IN` or `NOT IN` over a tuple whose elements deduplicate to a single key column (for example, `WHERE tuple(number, number) NOT IN (tuple(1, 2))`). Closes [#103660](https://github.com/ClickHouse/ClickHouse/issues/103660). [#103835](https://github.com/ClickHouse/ClickHouse/pull/103835) ([Groene AI](https://github.com/groeneai)).
* Keep the auto-spilling hash join's actual memory peak under `max_bytes_before_external_join`. Previously, statistics-driven preallocation, in-place hash table doubling, and unbounded `GraceHashJoin` in-memory buckets could each push the query past the configured cap and trip `MEMORY_LIMIT_EXCEEDED`. [#103838](https://github.com/ClickHouse/ClickHouse/pull/103838) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a hang in `clickhouse-local` shutdown when system logs (such as `text_log` or `filesystem_cache_log`) are configured. `SystemLogs::flushImpl` was calling `BaseDaemon::instance().flushTextLogs()`, which throws `std::bad_cast` outside `clickhouse-server` and left the saving threads running until `pthread_cond_destroy` blocked the destruction of the system log queues. [#103874](https://github.com/ClickHouse/ClickHouse/pull/103874) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reject `MATERIALIZED` CTE queries whose body resolves to different inferred column types in different references with a clear `TYPE_MISMATCH` error instead of crashing the server with a `Bad cast` `LOGICAL_ERROR`. This previously happened when the CTE body referenced identifiers from outer scope (for example an alias from the calling subquery's projection) that were inlined as different constants per reference. [#103879](https://github.com/ClickHouse/ClickHouse/pull/103879) ([Groene AI](https://github.com/groeneai)).
* Fix a use-of-uninitialized-value in the JOIN-conversion query plan optimizers (`tryConvertAnyOuterJoinToInnerJoin`, `tryConvertAnyJoinToSemiOrAntiJoin`) when the filter on top of an `ANY` `OUTER` `JOIN` contains a non-deterministic function such as `rand`, `now`, or `rowNumberInAllBlocks`. The optimizer no longer attempts to constant-fold such filters and leaves the JOIN unchanged, which also prevents incorrect conversions to `INNER`/`SEMI`/`ANTI JOIN` that could silently drop rows. [#103880](https://github.com/ClickHouse/ClickHouse/pull/103880) ([Groene AI](https://github.com/groeneai)).
* Fix a use-after-free in `StorageKafka2` that could crash the server when a Keeper session is replaced while the consumer is holding ephemeral topic-partition locks. [#103890](https://github.com/ClickHouse/ClickHouse/pull/103890) ([Groene AI](https://github.com/groeneai)).
* Fixed a `LOGICAL_ERROR` "Primary key type mismatch" thrown when joining an `EmbeddedRocksDB` table via `JOIN ... USING (key)` against a subquery whose key column has a different type (e.g. `Nullable(UInt64)`, `Int64`, `Decimal`) than the storage's primary key. The planner now declines `DirectKeyValueJoin` on type mismatch and falls back to `HashJoin`, which handles the type conversion. [#103928](https://github.com/ClickHouse/ClickHouse/pull/103928) ([Groene AI](https://github.com/groeneai)).
* `SET max_threads = DEFAULT` (and the same for `max_final_threads` and `max_parsing_threads`) no longer loses the auto state. Previously, after resetting one of these settings, `system.settings` would report the resolved core count (e.g. `32`) instead of `'auto(32)'`, and the server would behave as if the value had been explicitly pinned. [#103991](https://github.com/ClickHouse/ClickHouse/pull/103991) ([Groene AI](https://github.com/groeneai)).
* Fix `SIZES_OF_ARRAYS_DONT_MATCH` when reading `AggregateFunction(topK(N), String)` columns whose persisted `alpha_size` was grown by a pre-25.12 deserialize+serialize cycle. [#104002](https://github.com/ClickHouse/ClickHouse/pull/104002) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed SQL injection vulnerability in PostgreSQL, Cassandra and XDBC dictionary sources: string keys containing single quotes were escaped with `\'` (backslash), which these backends treat as a literal backslash rather than an escape sequence, allowing arbitrary SQL to be injected into dictionary lookup queries. `ExternalQueryBuilder` now emits SQL-standard `''` escaping for those backends; ClickHouse and MySQL dictionary sources continue to use backslash escaping. [#104009](https://github.com/ClickHouse/ClickHouse/pull/104009) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixed possible type mismatch in aggregation when a column type was altered to/from LowCardinality, and min-max projection wasn't rebuilt. [#104013](https://github.com/ClickHouse/ClickHouse/pull/104013) ([Nikita Taranov](https://github.com/nickitat)).
* Fix infinite loop of query optimizations caused by not propagating prevention of unused column removal when merging expressions. [#104083](https://github.com/ClickHouse/ClickHouse/pull/104083) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix `LOGICAL_ERROR` in `StreamingStorageRegistry::renameTable` when batch-renaming streaming tables (S3Queue, Kafka, RabbitMQ) by using UUID-based identity tracking instead of name-based. [#104101](https://github.com/ClickHouse/ClickHouse/pull/104101) ([Nikita Taranov](https://github.com/nickitat)).
* Fixed wrong results when a CTE constructed with `UNION ALL` contained a `SELECT DISTINCT` branch and the outer query projected only a subset of the CTE's columns. The new analyzer's `RemoveUnusedProjectionColumnsPass` was incorrectly removing the un-referenced column from the inner `DISTINCT` projection, causing rows that should have remained distinct (same value in the projected column but different value in the dropped column) to collapse into one. [#104114](https://github.com/ClickHouse/ClickHouse/pull/104114) ([Groene AI](https://github.com/groeneai)).
* Fix several edge case correctness issues in setting `optimize_inverse_dictionary_lookup` where the optimization could silently drop rows or suppress exceptions. Closes [#103270](https://github.com/ClickHouse/ClickHouse/issues/103270). Close [#103085](https://github.com/ClickHouse/ClickHouse/issues/103085). [#104133](https://github.com/ClickHouse/ClickHouse/pull/104133) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix write out of bounds while deserializing `quantileTiming` state. [#104141](https://github.com/ClickHouse/ClickHouse/pull/104141) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix undefined behavior when an out-of-range `Float64` value is converted to a wide integer type (`UInt64`, `Int64`, `Int128`, `UInt128`, `Int256`, `UInt256`). Previously, values equal to `Float64(numeric_limits<T>::max())` (which rounds up to a value above the actual maximum) bypassed the bounds check and produced UB in the subsequent cast. This affected aggregate-function parameter parsing (`topK`, `histogram`, `uniqUpTo`, `groupArrayInsertAt`, etc.) and integer-typed settings via `SET <setting> = <Float64>`. Closes [#103817](https://github.com/ClickHouse/ClickHouse/issues/103817). [#104154](https://github.com/ClickHouse/ClickHouse/pull/104154) ([Groene AI](https://github.com/groeneai)).
* Fix `LOGICAL_ERROR` exception "Unexpected return type from comparison. Expected `UInt8`. Got `Const(Nullable(UInt8))`" when comparing a nested `Tuple(Tuple(Nullable(...)))` (or deeper nesting) with a `String` literal. The comparison's return type is now correctly inferred as `Nullable(UInt8)`, matching the runtime behaviour. [#104171](https://github.com/ClickHouse/ClickHouse/pull/104171) ([Groene AI](https://github.com/groeneai)).
* Fixed a server abort (`UndefinedBehaviorSanitizer: reference binding to null pointer`, segfault in release builds) on `SELECT ... FROM <ReplacingMergeTree(version, is_deleted)> FINAL PREWHERE is_deleted = <expr> AND <other column expr>` when `query_plan_optimize_lazy_final = 1`. The lazy-FINAL non-intersecting reading step lost the `is_deleted` column from its output header because prewhere consumed it as an input without re-exposing it as an output. The downstream `addIsDeletedFilter` step then dereferenced a null `ActionsDAG::Node` pointer. [#104177](https://github.com/ClickHouse/ClickHouse/pull/104177) ([Groene AI](https://github.com/groeneai)).
* When calling system.failpoints table, it would use a failpoint, thus possibly disabling it. [#104237](https://github.com/ClickHouse/ClickHouse/pull/104237) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Fix `MemorySanitizer: use-of-uninitialized-value` in `detectLanguage*` functions when the input contains a UTF-8 character ending exactly at the buffer boundary. [#104257](https://github.com/ClickHouse/ClickHouse/pull/104257) ([Raúl Marín](https://github.com/Algunenano)).
* Fix a logical error (`Bad cast from type DB::CachedObjectStorage to DB::S3ObjectStorage`) that aborted argument parsing of data-lake table functions and engines (`icebergS3`, `deltaLakeS3`, etc.) when called with `SETTINGS disk = '...'` against a disk whose underlying object storage is wrapped by a decorator such as a filesystem cache. Closes [#89300](https://github.com/ClickHouse/ClickHouse/issues/89300). [#104258](https://github.com/ClickHouse/ClickHouse/pull/104258) ([Groene AI](https://github.com/groeneai)).
* Fix parsing of parenthesized subscript expressions on columns named `values`, for example `(values['a'])`, so they are no longer interpreted as SQL-standard `VALUES` table expressions. [#104312](https://github.com/ClickHouse/ClickHouse/pull/104312) ([Desel72](https://github.com/Desel72)).
* Fix a server abort/`LOGICAL_ERROR` in the filesystem cache background eviction thread (`SLRUFileCachePriority::collectEvictionInfo`) that could fire when `keep_free_space_size_ratio` or `keep_free_space_elements_ratio` was high enough to trigger eviction while all cache entries had already been promoted to the SLRU protected queue (probationary empty). [#104313](https://github.com/ClickHouse/ClickHouse/pull/104313) ([Groene AI](https://github.com/groeneai)).
* Fix exceptions (`NOT_FOUND_COLUMN_IN_BLOCK`, `LOGICAL_ERROR`, `AMBIGUOUS_COLUMN_NAME`) when using projections with UNION ALL views, window functions, or alias-column name collisions. Regression from [#88798](https://github.com/ClickHouse/ClickHouse/issues/88798). [#104317](https://github.com/ClickHouse/ClickHouse/pull/104317) ([Amos Bird](https://github.com/amosbird)).
* Fixes a possible underflow in parsing postgres arrays. [#104322](https://github.com/ClickHouse/ClickHouse/pull/104322) ([Grant Holly](https://github.com/grantholly-clickhouse)).
* Functions that return a non-`Nullable` type (such as `Array`, `Tuple`, or `Map`) now accept `Nullable` arguments. Affected functions include `extractAll`, `extractAllGroups`, `extractAllGroupsHorizontal`, `extractAllGroupsVertical`, `extractGroups`, `splitByChar`, `splitByString`, `splitByRegexp`, `splitByWhitespace`, `splitByNonAlpha`, and `alphaTokens`. `NULL` input rows produce the default value of the result type (e.g. an empty array) instead of raising "Nested type is not allowed inside Nullable type". [#104326](https://github.com/ClickHouse/ClickHouse/pull/104326) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix iceberg stats with partitioned table. This closes [#104321](https://github.com/ClickHouse/ClickHouse/issues/104321). [#104329](https://github.com/ClickHouse/ClickHouse/pull/104329) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix a fatal logical error at server startup on macOS (and similar jemalloc builds) where `Jemalloc::verifySetup` incorrectly reported a `jemalloc_enable_background_threads` mismatch because optional `background_thread` / `max_background_threads` mallctls are absent; verification is skipped when those mallctls are unavailable, and `getValue` no longer leaves the output uninitialized on failure. Closes [#102183](https://github.com/ClickHouse/ClickHouse/issues/102183). [#104330](https://github.com/ClickHouse/ClickHouse/pull/104330) ([SAYON DEEP](https://github.com/sayondeep)).
* Fix a correctness regression where `SELECT` queries with `max_rows_to_read_leaf` and `read_overflow_mode_leaf = 'throw'` could incorrectly throw `TOO_MANY_ROWS` even when a skip index would have reduced the read below the leaf cap. The symmetric non-leaf settings (`max_rows_to_read` / `read_overflow_mode`) were already handled. [#104331](https://github.com/ClickHouse/ClickHouse/pull/104331) ([Groene AI](https://github.com/groeneai)).
* `toUUID`, `toUUIDOrNull`, `toUUIDOrZero`, `toUUIDOrDefault`, `CAST` to `UUID` and `Nullable(UUID)`, `accurateCastOrNull` to `UUID`, and the input formats that parse a UUID from text (`Avro`, `MsgPack`, `JSONExtract`, ...) now reject strings that have the right length but contain non-hexadecimal characters. Previously such inputs were silently turned into a fabricated UUID by walking off the end of the hex digit lookup table; now `toUUID` throws `CANNOT_PARSE_UUID`, and the `Or*` variants return `NULL` / the zero UUID / the supplied default. [#104370](https://github.com/ClickHouse/ClickHouse/pull/104370) ([Groene AI](https://github.com/groeneai)).
* Fix `Bad cast` `LOGICAL_ERROR` in `caseWithExpression` (and SQL `CASE expr WHEN ... THEN ... ELSE ...`) when the THEN-only supertype and the (THENs + ELSE) supertype land in different `ColumnDecimal` storages -- for example THEN values `(UInt16, Int8)` with an ELSE of `Decimal(9, 2)`. Closes [#104335](https://github.com/ClickHouse/ClickHouse/issues/104335). [#104378](https://github.com/ClickHouse/ClickHouse/pull/104378) ([Groene AI](https://github.com/groeneai)).
* Internal failures reported via `logExceptionBeforeStart` (asynchronous insert flushes, materialized-view refreshes, parse errors raised during internal queries) now correctly increment the `FailedInternalQuery`, `FailedInternalSelectQuery`, and `FailedInternalInsertQuery` ProfileEvents alongside the user-visible `FailedQuery`, `FailedSelectQuery`, and `FailedInsertQuery` counters. Previously these internal counters stayed at zero for failures occurring before query execution started, undercounting a major class of internal failures. [#104399](https://github.com/ClickHouse/ClickHouse/pull/104399) ([Groene AI](https://github.com/groeneai)).
* Fix `Code: 36. BAD_ARGUMENTS Expected literal, got {name:Type}` thrown when a query parameter is used inside the `base_backup` setting of a `BACKUP` or `RESTORE` statement (e.g. `BACKUP ... SETTINGS base_backup = S3({backup_name:String}, ...)`). The regression was introduced in `26.1.5` by PR [#99205](https://github.com/ClickHouse/ClickHouse/issues/99205). Closes [#103324](https://github.com/ClickHouse/ClickHouse/issues/103324). [#104413](https://github.com/ClickHouse/ClickHouse/pull/104413) ([Groene AI](https://github.com/groeneai)).
* Fix a server abort in `IcebergLocal`/`IcebergS3` writes when `ALTER TABLE ... DROP COLUMN` is followed by an `INSERT` with `iceberg_metadata_staleness_ms` greater than zero. `ALTER` now invalidates the local Iceberg metadata files cache so subsequent reads and writes see the new schema. [#104419](https://github.com/ClickHouse/ClickHouse/pull/104419) ([Groene AI](https://github.com/groeneai)).
* Fix `DROP ROLE`, `DROP USER`, `DROP SETTINGS PROFILE`, `DROP ROW POLICY`, `DROP QUOTA` and `DROP MASKING POLICY` to remove references to the dropped entity from any other access entity that referenced it (e.g. a user's `DEFAULT ROLE` list, a settings profile's `TO` list, a row policy's grantees) and persist the cleanup to disk. Previously the in-memory state appeared correct because `SHOW CREATE` filters unknown UUIDs, but the on-disk `.sql` files retained dangling `ID('<dropped-uuid>')` entries and the references were resurrected on the next server restart, surfacing as `ACCESS_ENTITY_NOT_FOUND` errors during distributed query execution. [#104427](https://github.com/ClickHouse/ClickHouse/pull/104427) ([Groene AI](https://github.com/groeneai)).
* Fixed a server abort triggered by `azureBlobStorage`, `AzureBlobStorage`-engine, and DeltaLake-on-Azure with a connection string whose `BlobEndpoint` URL has an empty, non-numeric, or out-of-range port (e.g. `BlobEndpoint=http://host:abc/`). The server now returns a clean `BAD_ARGUMENTS` error instead of aborting in debug/sanitizer builds. [#104460](https://github.com/ClickHouse/ClickHouse/pull/104460) ([Groene AI](https://github.com/groeneai)).
* Allow an unquoted identifier as the user name in the `remote` and `remoteSecure` table functions, mirroring how the database and table arguments accept unquoted identifiers. Previously such a query failed with a misleading authentication error referring to the `default` user. [#104465](https://github.com/ClickHouse/ClickHouse/pull/104465) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `Logical error: Incorrect ASTSelectWithUnionQuery (modes: M, selects: N)` triggered when a SQL user-defined function body contains a parenthesized inner `UNION ALL` (e.g. `CREATE FUNCTION f AS x -> (SELECT 1 UNION ALL (SELECT 1 UNION ALL SELECT 1))`). [#104477](https://github.com/ClickHouse/ClickHouse/pull/104477) ([Groene AI](https://github.com/groeneai)).
* Fix `uniqThetaIntersect` returning the cardinality of the first argument instead of `0` when the second argument is an empty `uniqTheta` state -- for example the result of `uniqThetaMergeStateIf(s, predicate)` when the predicate excludes every row. [#104529](https://github.com/ClickHouse/ClickHouse/pull/104529) ([Groene AI](https://github.com/groeneai)).
* Fix `SHOW TABLES` and `system.tables` silently truncating the listing for `DataLakeCatalog` databases backed by Iceberg REST catalogs (`iceberg-rest`, `onelake`, `biglake`). When the catalog server paginates the list-tables or list-namespaces response (e.g. Microsoft Fabric / OneLake beyond \~50 tables per namespace), tables on later pages were silently invisible to `SHOW TABLES` and `system.tables`, even though they were queryable via direct `SELECT`. `RestCatalog` now follows the `next-page-token` continuation token defined by the Iceberg REST OpenAPI spec, matching the existing behavior of `PaimonRestCatalog` and `UnityCatalog`. [#104531](https://github.com/ClickHouse/ClickHouse/pull/104531) ([Groene AI](https://github.com/groeneai)).
* The `input` table function now infers its structure from the surrounding `INSERT` query's `FORMAT` clause when that format has a fixed schema (`LineAsString`, `RawBLOB`, `JSONAsString`, etc.), so users no longer have to repeat the structure as `input('line String')` for these formats. [#104532](https://github.com/ClickHouse/ClickHouse/issues/104532). [#104533](https://github.com/ClickHouse/ClickHouse/pull/104533) ([Groene AI](https://github.com/groeneai)).
* Updated datatype of fields in Iceberg history from `Int32` to `Int64`. Closes [#94176](https://github.com/ClickHouse/ClickHouse/issues/94176). [#104579](https://github.com/ClickHouse/ClickHouse/pull/104579) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fixed `Inconsistent AST formatting` `LOGICAL_ERROR` when parsing a function call where a lambda follows a comma, e.g. ``SELECT substring(x, `x` -> `x`)``. The parser used to silently merge the preceding arguments into the lambda's left-hand side, producing a single-argument call that could not be re-parsed back to the same AST. It now preserves the function's original arity. [#104626](https://github.com/ClickHouse/ClickHouse/pull/104626) ([Groene AI](https://github.com/groeneai)).
* `CHECK TABLE t` now prefers a `TEMPORARY` table over a permanent one with the same name when no database qualifier is given, matching the precedence already used by `SHOW CREATE TABLE`, `DESCRIBE TABLE`, `OPTIMIZE TABLE`, and `ALTER TABLE`. Previously `CHECK TABLE t` skipped temporary tables entirely, so it failed with `UNKNOWN_TABLE` on a temporary `Log` or `File` table even though those engines support `CHECK`. Follow-up to [#100966](https://github.com/ClickHouse/ClickHouse/pull/100966). [#104637](https://github.com/ClickHouse/ClickHouse/pull/104637) ([Groene AI](https://github.com/groeneai)).
* Fix Keeper termination and restart loop when `get /keeper/availability_zone` is sent with `quorum_reads=true` to a Keeper without `<placement>` configured. [#104663](https://github.com/ClickHouse/ClickHouse/pull/104663) ([myeongjun](https://github.com/myeongjjun)).
* Fix a TOCTOU data race in `FutureSetFromTuple::buildOrderedSetInplace` that results in a logical error. [#104673](https://github.com/ClickHouse/ClickHouse/pull/104673) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix several functions returning different results for the same input depending on whether arguments arrived as columns or constants: `bitRotateLeft` / `bitRotateRight` (boundary shift counts), `length(FixedString)` / `concatWithSeparator` with `LowCardinality(Nullable)` inputs, `roundDown` on NaN, and `rightUTF8` on invalid UTF-8. [#104710](https://github.com/ClickHouse/ClickHouse/pull/104710) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed `anyHeavy` returning a non-heavy value when the most frequent value was the column default and the data lived across multiple `MergeTree` parts (sparse-column read path). [#104712](https://github.com/ClickHouse/ClickHouse/pull/104712) ([Raúl Marín](https://github.com/Algunenano)).
* Fix several defects in setting-constraint handling: `MergeTreeSettings` constraints declared on a setting's canonical name could be bypassed by writing to an alias of that setting; the `disallowed_values` constraint check threw an exception on clamp paths (secondary queries, `ON CLUSTER` workers, `SQL SECURITY DEFINER` views) instead of silently dropping the change. [#104737](https://github.com/ClickHouse/ClickHouse/pull/104737) ([Raúl Marín](https://github.com/Algunenano)).
* Fix a `LOGICAL_ERROR` exception (`Metadata is not initialized`) raised by `OPTIMIZE TABLE`, `ALTER TABLE ... DELETE`, `ALTER TABLE ... ADD COLUMN` and other ALTER variants on a lazily-attached `Iceberg` / `IcebergLocal` / `DeltaLake` / `Hudi` table whose metadata had not been loaded yet (typical after a server restart, or after a previous metadata write failed and left a corrupted metadata file on disk). The operation now either proceeds normally if the metadata loads successfully, or surfaces the underlying load failure as a regular user-facing exception instead of aborting the server in debug / sanitizer builds. [#104738](https://github.com/ClickHouse/ClickHouse/pull/104738) ([Groene AI](https://github.com/groeneai)).
* Fix segfault due to a use-after-free bug in `AvroConfluentRowInputFormat`. [#104751](https://github.com/ClickHouse/ClickHouse/pull/104751) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Scalar variants of `numericIndexedVectorPointwiseMultiply`, `numericIndexedVectorPointwiseDivide`, `numericIndexedVectorPointwiseEqual`, and `numericIndexedVectorPointwiseNotEqual` now raise `INCORRECT_DATA` when called with a `UInt64` scalar above `Int64::max`. [#104784](https://github.com/ClickHouse/ClickHouse/pull/104784) ([FriendLey](https://github.com/FriendLey)).
* Fix a bug where manually overriding a setting via its alias name (e.g. `SET enable_analyzer = 1` instead of `SET allow_experimental_analyzer = 1`) after applying a `compatibility` setting could cause that override to be reverted by a subsequent change of the `compatibility` setting. [#104829](https://github.com/ClickHouse/ClickHouse/pull/104829) ([Raúl Marín](https://github.com/Algunenano)).
* Fix AWS logger being disabled after [https://github.com/ClickHouse/ClickHouse/commit/0e8ad4355c9d](https://github.com/ClickHouse/ClickHouse/commit/0e8ad4355c9d). [#104837](https://github.com/ClickHouse/ClickHouse/pull/104837) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix three more functions returning different results for the same input depending on whether arguments arrived as columns or constants: `transform` (and `caseWithExpression` through it) with a constant `Date`/`Date32`/`Enum`/`FixedString` default, comparison operators between a `String` and a constant `FixedString`, and `if`/`ifNull`/`nullIf` with a `FixedString` branch under a constant condition. [#104858](https://github.com/ClickHouse/ClickHouse/pull/104858) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `Bad cast from type DB::ColumnConst to DB::ColumnNullable` server abort during partition pruning for `MergeTree` tables when the partition expression contains a function chain that collapses to a single constant value (such as `floor(NULL, toRelativeYearNum(...))`). [#104861](https://github.com/ClickHouse/ClickHouse/pull/104861) ([Groene AI](https://github.com/groeneai)).
* Fix a `ThreadSanitizer` data race in the `ContextData` copy constructor: `table_function_results` was copied from the source object without acquiring `table_function_results_mutex`, so a concurrent `Context::executeTableFunction` writer could race against the unsynchronized read in the copy constructor. [#104879](https://github.com/ClickHouse/ClickHouse/pull/104879) ([Groene AI](https://github.com/groeneai)).
* Fix data part consistency checks for types with dynamic structure and detect corrupted columns\_substreams.txt. Resubmit of [https://github.com/ClickHouse/ClickHouse/pull/103858](https://github.com/ClickHouse/ClickHouse/pull/103858) with additional changes. [#104888](https://github.com/ClickHouse/ClickHouse/pull/104888) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix race between DROP and UNDROP in DatabaseCatalog. [#104915](https://github.com/ClickHouse/ClickHouse/pull/104915) ([Azat Khuzhin](https://github.com/azat)).
* Fix filesystem cache dynamic resize with partially downloaded segments, including restore accounting after failed eviction. [#104921](https://github.com/ClickHouse/ClickHouse/pull/104921) ([Antonio Andelic](https://github.com/antonio2368)).
* `DETACH TABLE` on a temporary table (without the `TEMPORARY` keyword) now correctly raises `SYNTAX_ERROR`, matching the behavior of `DETACH TEMPORARY TABLE`. Previously it silently set an internal `is_detached` flag and returned without error. To remove a temporary table, use `DROP TEMPORARY TABLE` or `DROP TABLE` (the latter resolves the temporary table via `Context::ResolveExternal`). Closes [#103475](https://github.com/ClickHouse/ClickHouse/issues/103475). [#104943](https://github.com/ClickHouse/ClickHouse/pull/104943) ([Groene AI](https://github.com/groeneai)).
* Make the `filesystem` table function honor `max_memory_usage` / `max_server_memory_usage` when loading file content. Previously, large or numerous parallel content reads could push past the limit without raising `MEMORY_LIMIT_EXCEEDED` and end up OOM-killed instead. [#104956](https://github.com/ClickHouse/ClickHouse/pull/104956) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a `LOGICAL_ERROR` thrown when filtering `system.detached_tables` by `uuid` (e.g. `SELECT count() FROM system.detached_tables WHERE uuid = '...'`). The query now returns the expected result instead of aborting the server. [#104979](https://github.com/ClickHouse/ClickHouse/pull/104979) ([Groene AI](https://github.com/groeneai)).
* `flattenTuple` no longer raises a `LOGICAL_ERROR` when called on a tuple whose nested structure contains only empty `Tuple()` leaves (e.g. `Tuple(c0 Array(Tuple()))` or `Tuple(c0 Tuple())`). Such inputs now produce a user-facing `ILLEGAL_TYPE_OF_ARGUMENT` exception explaining that the flatten result would be an empty tuple. [#104989](https://github.com/ClickHouse/ClickHouse/pull/104989) ([Groene AI](https://github.com/groeneai)).
* Fix a server abort and a silent-wrong-result bug when querying `loop(remote(...))` (or any `loop()` wrapping a storage that can defer aggregation) with `GROUP BY`. The outer planner used to add `MergingAggregatedStep` based on the inner storage's reported processing stage, but `LoopSource` always materialises its inner select with `QueryProcessingStage::Complete` and emits plain column chunks, so `MergingAggregatedTransform` tripped a `LOGICAL_ERROR` (`Chunk info was not set for chunk in MergingAggregatedTransform`) under `enable_parallel_replicas = 1` and silently dropped the outer aggregation otherwise. [#105001](https://github.com/ClickHouse/ClickHouse/pull/105001) ([Groene AI](https://github.com/groeneai)).
* `clickhouse-benchmark --reconnect` (bare, no value) was inadvertently broken in 25.4 by a change that turned `--reconnect` into an integer option, requiring a value. The bare form now works again and is equivalent to `--reconnect=1` (reconnect on every query). [#105006](https://github.com/ClickHouse/ClickHouse/pull/105006) ([Groene AI](https://github.com/groeneai)).
* Fixed malformed JSON output for column names ending with incomplete UTF-8 sequences. [#105012](https://github.com/ClickHouse/ClickHouse/pull/105012) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix silent data loss after `EXCHANGE TABLES` or `CREATE OR REPLACE TABLE` of a materialized view's source table. The `MV`'s source-view dependency edge is now kept on the original name so it continues to fire on inserts. Regression introduced by [#98779](https://github.com/ClickHouse/ClickHouse/issues/98779); restores the pre-regression behavior. [#105029](https://github.com/ClickHouse/ClickHouse/pull/105029) ([Sema Checherinda](https://github.com/CheSema)).
* Fix `CANNOT_COMPILE_CODE Could not find symbol __fixunsdfti` when JIT-compiling expressions that convert a `Float` to `UInt128`, such as `toUInt128(<Float64 expression>)`. The unsigned 128-bit float-to-int compiler-rt builtins were missing from the JIT symbol resolver. Closes [#105031](https://github.com/ClickHouse/ClickHouse/issues/105031). [#105048](https://github.com/ClickHouse/ClickHouse/pull/105048) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `clickhouse-local` not printing log messages from a failed query when `send_logs_level` is set. [#105067](https://github.com/ClickHouse/ClickHouse/pull/105067) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect results when the same parameterized view is referenced more than once in the same query with different argument values. Previously, the analyzer collapsed the calls into one, silently dropping all but the first filter. [#105170](https://github.com/ClickHouse/ClickHouse/pull/105170) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `TOTALS` row being rendered twice at the bottom of the result table in the `play.html` web UI. [#103803](https://github.com/ClickHouse/ClickHouse/pull/103803) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Reject non-finite vectors (`NaN`, `±Inf`) during vector search (either as searched vectors or as reference vectors); they previously caused undefined behavior in `usearch`. [#104079](https://github.com/ClickHouse/ClickHouse/pull/104079) ([Groene AI](https://github.com/groeneai)).
* PromQL: fix the aggregation operator for empty vectors. [#104425](https://github.com/ClickHouse/ClickHouse/pull/104425) ([Vitaly Baranov](https://github.com/vitlibar)).
* PromQL: fix error handling in the Prometheus query API. [#104741](https://github.com/ClickHouse/ClickHouse/pull/104741) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix a race in `MergeTreeTransaction::afterCommit` where, after a connection loss between writing the commit `CSN` to ZooKeeper and finalizing the transaction, the `COMMIT` response could reach the client before the new `creation_csn` / `removal_csn` became visible in `system.parts`. [#104708](https://github.com/ClickHouse/ClickHouse/pull/104708) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix exponential memory growth in the KQL parser when converting nested array indexing (`arr[arr[arr[...]]]`). [#105142](https://github.com/ClickHouse/ClickHouse/pull/105142) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect results for `RIGHT ANY JOIN` when the right table has multiple rows per key and the output block is split due to size limits. Closes [#99431](https://github.com/ClickHouse/ClickHouse/issues/99431). [#102064](https://github.com/ClickHouse/ClickHouse/pull/102064) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Check for stack overflow in `Avro` reader during nested-type deserialization. [#102417](https://github.com/ClickHouse/ClickHouse/pull/102417) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix duplicate rows in `system.completions` for `MergeTree` settings — each setting name appeared twice because both `getMergeTreeSettings` and `getReplicatedMergeTreeSettings` were dumped despite having identical setting names. Closes [#102013](https://github.com/ClickHouse/ClickHouse/issues/102013). [#102015](https://github.com/ClickHouse/ClickHouse/pull/102015) ([Groene AI](https://github.com/groeneai)).
* Fix `StorageObjectStorageQueue` (`S3Queue`, `AzureQueue`) blocking shutdown until partially-processed files were fully read from object storage. The source now aborts the read immediately on shutdown; deduplication ensures rows already streamed into the destination table before shutdown are not duplicated when the file is retried on next start. [#103126](https://github.com/ClickHouse/ClickHouse/pull/103126) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix multi-block inserts to the `Alias` table engine with `insert_deduplication_token` so that all blocks are kept. [#103246](https://github.com/ClickHouse/ClickHouse/pull/103246) ([Enric Calabuig](https://github.com/eclbg)).
* Fix `JSONHas` and `JSONExtractBool` on native `JSON` columns returning the extracted value (cast to `UInt8`) instead of `0`/`1`. [#103313](https://github.com/ClickHouse/ClickHouse/pull/103313) ([zxuhan7](https://github.com/zxuhan)).
* Protect the `CustomSeparated` input format against malformed or adversarial data that omits `format_custom_row_after_delimiter`. Header detection, schema inference, and variable-column rows previously accumulated fields unboundedly and could allocate many gigabytes of memory before failing. Reads now fail with `INCORRECT_DATA` once a single row contains more than 1,000,000 fields. [#103404](https://github.com/ClickHouse/ClickHouse/pull/103404) ([Groene AI](https://github.com/groeneai)).
* Fix `RESTORE` of replicated `MergeTree` tables so that restored part attachment uses `backup_restore_keeper_max_retries` instead of the regular insert Keeper retry budget. [#104610](https://github.com/ClickHouse/ClickHouse/pull/104610) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix wrong results from `WHERE p AND <LowCardinality(Nullable(int)) constant>` on `MergeTree` tables. Previously such queries returned zero rows because part pruning derived a `NULL` default from the `LowCardinality(Nullable(...))` type and synthesized a `notEquals(x, NULL)` guard, pruning every part. [#104767](https://github.com/ClickHouse/ClickHouse/pull/104767) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect aggregation result when grouping by a non-injective function of a column that is also the partition key (e.g. `PARTITION BY a` with `GROUP BY intDiv(a, 2)` or `a % 2`). Values from different partitions that mapped to the same group were not merged, producing duplicate group rows under `allow_aggregate_partitions_independently = 1`. [#104869](https://github.com/ClickHouse/ClickHouse/pull/104869) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix a race in `Keeper` snapshot transfer where a snapshot could be removed or moved while it was being sent to a recovering follower. [#104941](https://github.com/ClickHouse/ClickHouse/pull/104941) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix a silent wrong-result bug in `hilbertEncode` and `mortonEncode` where a non-constant `Tuple` first argument (range mask) used row 0's values to drive the bit-shift for every row. The functions now compute the per-row mask values, so the result no longer depends on the input being constant or on the block size. [#104992](https://github.com/ClickHouse/ClickHouse/pull/104992) ([Groene AI](https://github.com/groeneai)).
* Fix `clickhouse-local` silently ignoring user-level configuration (`profiles`, `users`, `quotas`, access-control settings) when the configuration file is auto-discovered from `./clickhouse-local.xml`, `~/.clickhouse-local/config.xml`, or `/etc/clickhouse-local/config.xml`. Previously these settings were applied only when `--config-file` was passed or `./config.xml` existed in the current directory; now all discovery paths behave consistently. [#105008](https://github.com/ClickHouse/ClickHouse/pull/105008) ([Groene AI](https://github.com/groeneai)).
* Fix `BFloat16` columns silently returning zero matches when compared against a string literal (e.g. `WHERE bf16_col = '49.9'`). [#105042](https://github.com/ClickHouse/ClickHouse/pull/105042) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `CLEAR COLUMN` and TTL handling during merges for `SummingMergeTree`, `AggregatingMergeTree`, and `CoalescingMergeTree` when merge-required columns are absent or expired. Closes [#101953](https://github.com/ClickHouse/ClickHouse/issues/101953). [#105203](https://github.com/ClickHouse/ClickHouse/pull/105203) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix a race between `DNSCacheUpdater::run` and `Context::reloadClusterConfig` by adding an explicit null-guard for `shared->clusters_config` before dereferencing it. [#105220](https://github.com/ClickHouse/ClickHouse/pull/105220) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fix `best_effort` date-time parsing for `toDateTime64` with `ms` and `ns` precision. [#105233](https://github.com/ClickHouse/ClickHouse/pull/105233) ([Kaviraj Kanagaraj](https://github.com/kavirajk)).
* Fix `OSIOWaitMicroseconds` reporting thread-lifetime I/O wait instead of per-query I/O wait. [#105246](https://github.com/ClickHouse/ClickHouse/pull/105246) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* `Hudi` table engine now raises `INCORRECT_DATA` (a regular query-level exception) instead of `LOGICAL_ERROR` when a parquet file in the table directory does not match the Hudi `[FileId]_[FileWriteToken]_[Timestamp].[extension]` naming convention. Previously such file names caused an exception in debug builds. [#105266](https://github.com/ClickHouse/ClickHouse/pull/105266) ([Groene AI](https://github.com/groeneai)).
* Fix deadlock in `ParallelFormattingOutputFormat` on schedule failure: when `scheduleFormatterThreadForUnitWithNumber` throws (e.g. `CANNOT_SCHEDULE_TASK`), the unit was left in `READY_TO_FORMAT` with no formatter thread to process it, leading to a hang. The schedule call is now wrapped in `try`/`catch` and any failure is routed through `onBackgroundException` so the collector exits cleanly. [#105275](https://github.com/ClickHouse/ClickHouse/pull/105275) ([Azat Khuzhin](https://github.com/azat)).
* Fix silent data loss in `Distributed` async inserts when recovering from an abnormal shutdown: if the last `.bin` file in a saved batch was intact but a middle one was corrupted, `DistributedAsyncInsertBatch::recoverBatch` would only validate the last file's header and then `sendBatch` would mark the entire batch — including the intact files — as broken, losing their rows. Each file's header is now validated individually so only the actually broken file is moved to `broken/` and the surviving rows reach the remote shard. [#105281](https://github.com/ClickHouse/ClickHouse/pull/105281) ([Groene AI](https://github.com/groeneai)).
* Fix a regression in `clickhouse extract-from-config --try`: when the config used `from_env` attributes and had no `include_from` element (or had one pointing to a missing file), all `from_env` substitutions were silently dropped and returned empty strings. This broke the Docker entrypoint port discovery in 26.2.5. Closes [#101704](https://github.com/ClickHouse/ClickHouse/issues/101704). [#105283](https://github.com/ClickHouse/ClickHouse/pull/105283) ([Groene AI](https://github.com/groeneai)).
* Fix `INSERT INTO` a `SQLite` table failing with a SQLite syntax error when the inserted value is an `Enum`, `JSON`, or `AggregateFunction` whose text representation contains a single quote. The `output_format_values_escape_quote_with_quote` setting is now honored by the corresponding serializations (previously only `String` and `FixedString` honored it). [#105285](https://github.com/ClickHouse/ClickHouse/pull/105285) ([Groene AI](https://github.com/groeneai)).
* Fix `Code: 44. ILLEGAL_COLUMN: Cannot add column ...: column with this name already exists` thrown by distributed queries with `allow_push_predicate_ast_for_distributed_subqueries = 1` (the default) when a `GLOBAL IN` tuple is matched against a subquery whose projection contains duplicate column names, e.g. `(x, y) GLOBAL IN (SELECT number, number FROM numbers(5))`. [#105290](https://github.com/ClickHouse/ClickHouse/pull/105290) ([Groene AI](https://github.com/groeneai)).
* Fix `reinterpret` to `Array(LowCardinality(...))` returning a confusing `NOT_IMPLEMENTED` error at runtime; it now returns `ILLEGAL_TYPE_OF_ARGUMENT` during type checking. [#105301](https://github.com/ClickHouse/ClickHouse/pull/105301) ([Raúl Marín](https://github.com/Algunenano)).
* `minMap`/`maxMap` (array form) and `minMappedArrays`/`maxMappedArrays` now treat `NaN` consistently with `ORDER BY`: `NaN` is treated as last (returned only when all values are `NaN`). Previously, results depended on the position of `NaN` in the data due to IEEE 754 unordered comparison semantics, and disagreed with the `Map`-argument form of `minMap`/`maxMap` that was fixed in [#100448](https://github.com/ClickHouse/ClickHouse/pull/100448). [#105331](https://github.com/ClickHouse/ClickHouse/pull/105331) ([Raúl Marín](https://github.com/Algunenano)).
* Fix a memory leak in the per-table `ColumnsDescription` cache for `MergeTree`-family tables with `Nested` columns. Entries were never evicted across `ALTER ADD COLUMN`/`DROP COLUMN` cycles when `share_nested_offsets = 1` (the default). [#105376](https://github.com/ClickHouse/ClickHouse/pull/105376) ([Groene AI](https://github.com/groeneai)).
* Fix `BAD_ARGUMENTS` exception "It's a bug! Only integer types are supported by `__bitWrapperFunc`" thrown when a `SELECT` with a `TYPE set(N)` skip index has a `WHERE` atom whose result type is `Float`, `BFloat16`, or any other non-integer type (for example `WHERE c0 + 0.1` or `WHERE log(c0)`). The skip index now falls back to the regular filter path in that case. [#105384](https://github.com/ClickHouse/ClickHouse/pull/105384) ([Groene AI](https://github.com/groeneai)).

<h4 id="265-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Stop using the system `compiler-rt` libraries and headers. Closes [#91475](https://github.com/ClickHouse/ClickHouse/issues/91475). [#102857](https://github.com/ClickHouse/ClickHouse/pull/102857) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Refresh the distroless Docker base image to fix OpenSSL CVEs in `libssl3t64`. [#103583](https://github.com/ClickHouse/ClickHouse/pull/103583) ([Rahul Nair](https://github.com/motsc)).
* Reliably receive the GPG key during releases by chaining multiple Ubuntu keyservers, instead of timing out on `keyserver.ubuntu.com`. [#103834](https://github.com/ClickHouse/ClickHouse/pull/103834) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Remove and forbid build-time `CMake` checks (`check_*`, `try_compile`, `try_run`). The compiler and toolchain are fixed, so feature detection at configure time is unnecessary and is now blocked project-wide; any version-specific behaviour must be gated on `CMAKE_CXX_COMPILER_VERSION` explicitly. [#103980](https://github.com/ClickHouse/ClickHouse/pull/103980) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Bump `libarchive` from 3.8.6 to 3.8.7. [#104047](https://github.com/ClickHouse/ClickHouse/pull/104047) ([Robert Schulze](https://github.com/rschu1ze)).
* Update `mongo-c-driver` to 2.3.0. [#104300](https://github.com/ClickHouse/ClickHouse/pull/104300) ([Raúl Marín](https://github.com/Algunenano)).
* Update LLVM dependencies for 22.x. [#104381](https://github.com/ClickHouse/ClickHouse/pull/104381) ([Joshua Carp](https://github.com/jmcarp)).
* Make the embedded-client and PTY descriptor classes build on macOS and FreeBSD by using portable POSIX `posix_openpt` / `grantpt` / `unlockpt` and removing Linux-only `#if` guards. [#104436](https://github.com/ClickHouse/ClickHouse/pull/104436) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Upgrade `librdkafka` to version 2.14.1. [#105222](https://github.com/ClickHouse/ClickHouse/pull/105222) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).

<h3 id="264">
  ClickHouse release 26.4, 2026-04-30. [Presentation](https://presentations.clickhouse.com/2026-release-26.4/), [Video](https://www.youtube.com/watch?v=9lSVy7k2EoI)
</h3>

<h4 id="264-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* The `IN` operator now uses exact value semantics for `Bool` type: only `0` and `1` values in the set match `Bool` values. Previously, numeric values greater than `255` in the `IN` set were incorrectly clamped to true when compared against `Bool`, so `SELECT CAST(1, 'Bool') IN (256)` returned 1. Now it correctly returns `0`. Closes [#92980](https://github.com/ClickHouse/ClickHouse/issues/92980). [#93115](https://github.com/ClickHouse/ClickHouse/pull/93115) ([Ashrith Bandla](https://github.com/ashrithb)).
* The H3 library has been updated to v4, which improves the precision of length, area, and other metric calculations. This change is backward incompatible because the new results differ from previous ones. [#100348](https://github.com/ClickHouse/ClickHouse/pull/100348) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Disallows using `SELECT` as a bareword identifier in a `WITH` expression list element. [#101059](https://github.com/ClickHouse/ClickHouse/pull/101059) ([Aruj Bansal](https://github.com/arujbansal)).
* This patch changes how the merge table will handle virtuals. If the underlying table contains `_table` or `_database`, these columns will be read from storage; otherwise, they will be filled after the read step using the expression step. [#101742](https://github.com/ClickHouse/ClickHouse/pull/101742) ([Mikhail Artemenko](https://github.com/Michicosun)).
* The `IN` operator now rejects lossy `Decimal` conversions inside composite types (`Tuple`, `Array`, `Map`) as well, making its behavior consistent with top-level scalar comparisons. Previously, precision checks were enforced only for top-level scalar values: for example, `CAST('33.3', 'Decimal64(1)') IN (33.33)` correctly returned `0`, but `CAST(['33.3'], 'Array(Decimal64(1))') IN ([33.33])` incorrectly returned `1` because the lossy conversion happened inside an `Array`. Now both cases correctly return `0`. [#101812](https://github.com/ClickHouse/ClickHouse/pull/101812) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Reduced default `http_max_fields` from 1,000,000 to 1,000 and `http_max_field_name_size` from 128 KB to 4 KB to limit pre-authentication memory usage by HTTP connections. Added `http_max_request_header_size` and `http_headers_read_timeout` settings. Users who rely on the previous higher limits can restore them via settings. [#103285](https://github.com/ClickHouse/ClickHouse/pull/103285) ([Sema Checherinda](https://github.com/CheSema)).

<h4 id="264-new-feature">
  New Feature
</h4>

* Add automatic spilling to hash and parallel hash joins by converting them to grace hash join when memory limit is reached. This behavior is controlled by `max_bytes_before_external_join`. [#97813](https://github.com/ClickHouse/ClickHouse/pull/97813) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Add Arrow Flight SQL support. [#91170](https://github.com/ClickHouse/ClickHouse/pull/91170) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Add incremental read support for `Paimon` table engines with Keeper-backed snapshot progress tracking, including targeted snapshot delta reads via `paimon_target_snapshot_id`, and extend test coverage for type mapping, partition pruning, and incremental read scenarios. [#93655](https://github.com/ClickHouse/ClickHouse/pull/93655) ([XiaoBinMu](https://github.com/Binnn-MX)).
* The `stem` function is now non-experimental (previously, setting `allow_experimental_nlp_functions` had to be enabled). [#102399](https://github.com/ClickHouse/ClickHouse/pull/102399) ([Jimmy Aguilar Mena](https://github.com/Ergus)). You can now stem all the words/tokens in columns `String`, `FixedString`, `Array([Fixed]String)`, `Nullable`, `LowCardinality` and `Const` easily with the `stem` function. [#99137](https://github.com/ClickHouse/ClickHouse/pull/99137) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Implement new behavior of `max_insert_block_size_rows`, `max_insert_block_size_bytes`, `min_insert_block_size_rows`, `min_insert_block_size_bytes` in squashing under compatibility setting `use_strict_insert_block_limits`. [#94207](https://github.com/ClickHouse/ClickHouse/pull/94207) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Add function `arrayAutocorrelation(arr [, max_lag])` that computes the normalized autocorrelation of a numeric array for each lag. Supports integer, float, and decimal array types. [#94776](https://github.com/ClickHouse/ClickHouse/pull/94776) ([Wenyu Chen](https://github.com/wenyuchen96)).
* A SQL function `obfuscateQuery`. Closes [#98010](https://github.com/ClickHouse/ClickHouse/issues/98010). [#98305](https://github.com/ClickHouse/ClickHouse/pull/98305) ([Xuewei Wang](https://github.com/Sallery-X)).
* Add support for Map and JSON/Object types as dictionary attributes. Now dictionaries can store and retrieve complex types including Map(String, String), Map(String, Array(String)), JSON, and Nullable(JSON) types in both FLAT and HASHED layouts. [#98627](https://github.com/ClickHouse/ClickHouse/pull/98627) ([yanglongwei](https://github.com/ylw510)).
* Added two new MergeTree settings — `replicated_fetches_min_part_level` and `replicated_fetches_min_part_level_timeout_seconds` — that allow replicas to skip fetching freshly-inserted (unmerged) parts from peers, reducing replication overhead during heavy ingestion. [#98625](https://github.com/ClickHouse/ClickHouse/pull/98625) ([tanner-bruce](https://github.com/tanner-bruce)).
* Add MergeTree skip index support for JSON columns using JSONAllPaths with bloom\_filter, tokenbf\_v1, ngrambf\_v1, and text (inverted) index types, enabling granule skipping based on the set of JSON paths present in each granule. [#98886](https://github.com/ClickHouse/ClickHouse/pull/98886) ([Pavel Kruglov](https://github.com/Avogar)).
* The `printf` function now supports non-constant format strings, allowing different format patterns per row based on column values. [#98991](https://github.com/ClickHouse/ClickHouse/pull/98991) ([Yash ](https://github.com/Onyx2406)).
* Add a new projection index, `commit_order`, that reorganizes data in insertion order. [#99004](https://github.com/ClickHouse/ClickHouse/pull/99004) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Add `highlight` function that wraps occurrences of search terms in a text string with HTML tags (default `<em>`/`</em>`). Supports ASCII case-insensitive matching, automatic merging of overlapping matches, and custom open/close tags. [#99131](https://github.com/ClickHouse/ClickHouse/pull/99131) ([Peng](https://github.com/fastio)).
* Implement quotas by normalized query hash to protect public ClickHouse services from abuse. 1. Support `NORMALIZED_QUERY_HASH` as a quota key type - separate quota buckets per unique normalized query, so `CREATE QUOTA q KEYED BY normalized_query_hash` tracks each distinct query independently. 2. Support `QUERIES_PER_NORMALIZED_HASH` as a quota resource type -- limits max executions of any single normalized query within an interval, so `MAX queries_per_normalized_hash = 100` prevents any one query pattern from running more than 100 times. [#99586](https://github.com/ClickHouse/ClickHouse/pull/99586) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Users can now write join queries using the `NATURAL JOIN` syntax, which automatically matches on all columns sharing the same name and deduplicates those columns in the result. [#99840](https://github.com/ClickHouse/ClickHouse/pull/99840) ([Peter Nguyen](https://github.com/petern48)).
* Support `SET TIME ZONE 'tz'` as alias for `SET session_timezone`. [#99883](https://github.com/ClickHouse/ClickHouse/pull/99883) ([phulv94](https://github.com/phulv94)).
* Added support for parameterized queries in the Web UI (`play.html`): query parameters like `{name:Type}` are detected and input fields are shown for filling in their values. [#100041](https://github.com/ClickHouse/ClickHouse/pull/100041) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support SQL standard `VALUES` clause as a table expression in `FROM`, e.g. `SELECT * FROM (VALUES (1, 'a'), (2, 'b')) AS t(id, val)`. [#100143](https://github.com/ClickHouse/ClickHouse/pull/100143) ([Desel72](https://github.com/Desel72)).
* Add PostgreSQL-compatible units to the `EXTRACT` operator: `EPOCH`, `DOW`, `DOY`, `ISODOW`, `ISOYEAR`, `WEEK`, `CENTURY`, `DECADE`, `MILLENNIUM`. Also fix `EXTRACT(WEEK FROM date)` which previously threw an error. [#100274](https://github.com/ClickHouse/ClickHouse/pull/100274) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added support for SQL-standard compound interval literals with `TO` range qualifiers, e.g. `INTERVAL '1:30' HOUR TO MINUTE`. Internally decomposed into sums of intervals. [#100453](https://github.com/ClickHouse/ClickHouse/pull/100453) ([Desel72](https://github.com/Desel72)).
* Add asynchronous metrics for kernel TCP receive and transmit buffer memory (`sk_rmem_alloc`, `sk_wmem_alloc`) of HTTP connection pool sockets, reported as p50/p75/p90/p95 percentiles and totals per connection group. [#100575](https://github.com/ClickHouse/ClickHouse/pull/100575) ([Sema Checherinda](https://github.com/CheSema)).
* Added a jemalloc profiling web UI for ClickHouse Keeper, available at `/jemalloc` on the HTTP control port. [#100606](https://github.com/ClickHouse/ClickHouse/pull/100606) ([murphy-4o](https://github.com/murphy-4o)).
* Implement command `SYSTEM FLUSH OBJECT STORAGE QUEUE db.table PATH 'x'` for ordered and unordered modes. [#100709](https://github.com/ClickHouse/ClickHouse/pull/100709) ([Bharat Nallan](https://github.com/bharatnc)).
* Added function `JSONAllValues` that returns all values from a `JSON` column as `Array(String)`, with values serialized in text representation and ordered by their path names. Added support of text index for `JSONAllValues` expression on `JSON` columns. When a text index is created on `JSONAllValues(json_column)`, it is automatically used to filter queries on `JSON` subcolumns (e.g., `json_column.key1 = 'value'`). [#100730](https://github.com/ClickHouse/ClickHouse/pull/100730) ([Anton Popov](https://github.com/CurtizJ)).
* Adds a new setting `input_format_column_name_matching_mode` which allows different case sensitivities for input formats. [#99346](https://github.com/ClickHouse/ClickHouse/pull/99346) ([manerone](https://github.com/Manerone)).
* Add `watch` command to `clickhouse-keeper-client` with watch support in `get`, `exists`, and `ls` commands. [#100834](https://github.com/ClickHouse/ClickHouse/pull/100834) ([Den Kalantaevskii](https://github.com/Diskein)).
* Added `getChildrenRecursive` (ListRecursive) request to ClickHouse Keeper and `lsr` command to `clickhouse-keeper-client`. This closes [#99916](https://github.com/ClickHouse/ClickHouse/issues/99916). [#100998](https://github.com/ClickHouse/ClickHouse/pull/100998) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Add new function `arrayTranspose` taking a two-dimensional array (matrix) and transposing it: `SELECT arrayTranspose([[1, 2, 3], [4, 5, 6]])`. [#101214](https://github.com/ClickHouse/ClickHouse/pull/101214) ([Vitaly Baranov](https://github.com/vitlibar)).
* `auto_statistics_types mergetree` setting defaults to `'minmax, uniq'` — minmax and uniq statistics are created automatically for all suitable columns in new tables - `materialize_statistics_on_insert` defaults to false — statistics are now built during merges rather than at insert time, reducing insert overhead. use `SET materialize_statistics_on_insert = 1` to restore the old behavior. [#101275](https://github.com/ClickHouse/ClickHouse/pull/101275) ([Han Fei](https://github.com/hanfei1991)).
* Add `prefer_dependency_replica` refresh setting for materialized view dependency chains to reduce missing data from cross-replica replication lag. [#101591](https://github.com/ClickHouse/ClickHouse/pull/101591) ([Seva Potapov](https://github.com/seva-potapov)).
* Adds a `hasPhrase` (alias `matchPhrase`) function for phrase search (continuous sequences of tokens). Search is brute-force, i.e. not supported by the text index yet. [#101997](https://github.com/ClickHouse/ClickHouse/pull/101997) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Add `s3_read_request_duration_microseconds` and `s3_read_request_bytes` histogram metrics to observe S3 GET request connection lifetime and bytes consumed, visible in `system.histogram_metrics` and the Prometheus endpoint. [#102058](https://github.com/ClickHouse/ClickHouse/pull/102058) ([Sema Checherinda](https://github.com/CheSema)).
* `Date` and `Date32` values can now be added to `Time` and `Time64` values using the `+` operator, producing a `DateTime` or `DateTime64` result. For example, `SELECT toDate('2024-01-15') + toTime('14:30:25')` returns `2024-01-15 14:30:25`. The result is computed in the session timezone, and out-of-range results are handled according to the `date_time_overflow_behavior` setting. Closes [#95914](https://github.com/ClickHouse/ClickHouse/issues/95914). [#102421](https://github.com/ClickHouse/ClickHouse/pull/102421) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* The text index is now GA and stays enabled regardless of the `compatibility` setting, preventing unexpected disabling during backup restores or when running in compatibility mode. [#101518](https://github.com/ClickHouse/ClickHouse/pull/101518) ([Nikita Fomichev](https://github.com/fm4v)).

<h4 id="264-experimental-feature">
  Experimental Feature
</h4>

* Add `ALTER TABLE ... EXECUTE remove_orphan_files` for Iceberg tables to identify and remove unreferenced files from object storage. [#99127](https://github.com/ClickHouse/ClickHouse/pull/99127) ([murphy-4o](https://github.com/murphy-4o)).
* Add `query_plan_optimize_join_order_randomize` setting that randomizes statistics used for join reordering, useful for testing. [#100643](https://github.com/ClickHouse/ClickHouse/pull/100643) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Add AI function support to ClickHouse, allowing users to call OpenAI and Anthropic endpoints using SQL. `aiGenerate` is included as the first such function. [#100831](https://github.com/ClickHouse/ClickHouse/pull/100831) ([George Larionov](https://github.com/george-larionov)).
* Add AI functions: `aiClassify`, `aiExtract`, and `aiTranslate` for utilizing LLM APIs in ClickHouse. [#100832](https://github.com/ClickHouse/ClickHouse/pull/100832) ([George Larionov](https://github.com/george-larionov)).
* Added `system.histogram_metric_log`, a new system table that periodically snapshots all histogram metrics (e.g. S3/Azure latencies, keeper request processing stages durations). Also, the `value` column of `system.histogram_metrics` changes to `Float64` as it's more flexible and compatible with the Prometheus data model. [#103046](https://github.com/ClickHouse/ClickHouse/pull/103046) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)). The table structure is likely to be changed in future releases.

<h4 id="264-performance-improvement">
  Performance Improvement
</h4>

* ClickHouse is now able to prune entire data parts in SELECT queries based on min/max statistics. [#94140](https://github.com/ClickHouse/ClickHouse/pull/94140) ([zoomxi](https://github.com/zoomxi)).
* Reduce lock contention during readonly operations on ReplicatedMergeTree tables with finished mutations. [#95771](https://github.com/ClickHouse/ClickHouse/pull/95771) ([Eduard Karacharov](https://github.com/korowa)).
* Respect `optimize_read_in_order` when reading projections. Closes [#89453](https://github.com/ClickHouse/ClickHouse/issues/89453). [#95885](https://github.com/ClickHouse/ClickHouse/pull/95885) ([Andrey Zvonov](https://github.com/zvonand)).
* Small set of improvements in Hash Join and Concurrent Hash Join. [#96663](https://github.com/ClickHouse/ClickHouse/pull/96663) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Optimize `DISTINCT` transform by disabling `LowCardinality` columns optimization when input data is almost distinct. [#97113](https://github.com/ClickHouse/ClickHouse/pull/97113) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Performance optimization for `LIKE` queries from [#97723](https://github.com/ClickHouse/ClickHouse/issues/97723). Now these queries can use text indices. [#98149](https://github.com/ClickHouse/ClickHouse/pull/98149) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Vectorized math functions (`exp`, `log`, `sigmoid`, `tanh`) are now accelerated on AArch64 (using NEON/SVE) and on FreeBSD/Darwin, where they previously used a slower scalar fallback. [#98230](https://github.com/ClickHouse/ClickHouse/pull/98230) ([Raúl Marín](https://github.com/Algunenano)).
* Queries filtering on `MergeTree` primary key columns with regexp alternations over literal strings, such as `^(abc-1|abc-2)`, can now use primary key pruning when the alternatives share a common prefix. [#98988](https://github.com/ClickHouse/ClickHouse/pull/98988) ([Yash ](https://github.com/Onyx2406)).
* Generalize `ORDER BY ... LIMIT` top-k dynamic filtering to support `Nullable`, `String`, and `COLLATE` types. [#99033](https://github.com/ClickHouse/ClickHouse/pull/99033) ([murphy-4o](https://github.com/murphy-4o)).
* Speedup hash join on `Int32` and `Int64` keys with small range by using a direct-index hash table. [#99275](https://github.com/ClickHouse/ClickHouse/pull/99275) ([Hechem Selmi](https://github.com/m-selmi)).
* Faster discontinuous queries for `LowCardinality` columns with a single dictionary. [#99285](https://github.com/ClickHouse/ClickHouse/pull/99285) ([Ivan Babrou](https://github.com/bobrik)).
* Speed up `var*Stable` and `stddev*Stable` functions for `Float64` columns by devirtualizing the inner loop. Note: this enables compiler optimizations (FMA/registers) that alter floating-point results at the ULP level. [#99460](https://github.com/ClickHouse/ClickHouse/pull/99460) ([Riyane El Qoqui](https://github.com/riyaneel)).
* Use optimised Firedancer base58 encode for inputs of 32/64 bytes (automatic for `base58Encode`). Allow using optimised base58 decode if decoded result is 32/64 bytes (explicit with `base58Decode('...', 32)` or alike). [#99461](https://github.com/ClickHouse/ClickHouse/pull/99461) ([Joanna Hulboj](https://github.com/jh0x)).
* Enable linker section-based optimizations (`-ffunction-sections`, `-fdata-sections`, `--icf=all`) to reduce binary size and improve instruction cache utilization. [#99474](https://github.com/ClickHouse/ClickHouse/pull/99474) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix negative scaling for short queries with aggregation on machines with many cores. When a query reads few marks, the pipeline no longer expands to `max_threads` after aggregation, avoiding overhead from mostly-empty streams. [#99493](https://github.com/ClickHouse/ClickHouse/pull/99493) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve the performance of queries with parallel replicas by correctly selecting the reading task size. [#99801](https://github.com/ClickHouse/ClickHouse/pull/99801) ([Nikita Taranov](https://github.com/nickitat)).
* Allow prefetching when reading a remote file through the userspace page cache. [#99919](https://github.com/ClickHouse/ClickHouse/pull/99919) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Avoid unnecessary computation of String `.size` subcolumn during subcolumns enumeration. [#99941](https://github.com/ClickHouse/ClickHouse/pull/99941) ([Pavel Kruglov](https://github.com/Avogar)).
* Make clickhouse-client's progress bar less jittery when working from a hotel with clusters with a very large number of replicas. [#100145](https://github.com/ClickHouse/ClickHouse/pull/100145) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Start `MemoryWorker` in `clickhouse-local` when page cache is enabled, so that the userspace page cache can be actually used. [#100306](https://github.com/ClickHouse/ClickHouse/pull/100306) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Optimize queries by pushing the `LIMIT` clause down into the `UNION ALL`. [#100364](https://github.com/ClickHouse/ClickHouse/pull/100364) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add JIT compilation support for `String` and `FixedString` column comparisons in `ORDER BY`, improving merge-phase sort performance by 6–17% for string-heavy sort keys. Co-authored with @lgbo-ustc. [#100577](https://github.com/ClickHouse/ClickHouse/pull/100577) ([Raúl Marín](https://github.com/Algunenano)).
* When `read_in_order_use_virtual_row` is enabled together with the new `read_in_order_use_virtual_row_per_block` setting, virtual row boundary information is now emitted after each block read from `MergeTree`, allowing the merge to reprioritize sources mid-stream for parts whose data is fully filtered out by `WHERE`/`PREWHERE`/`JOIN`. Close [#99945](https://github.com/ClickHouse/ClickHouse/issues/99945). [#100603](https://github.com/ClickHouse/ClickHouse/pull/100603) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Faster Float-to-String conversion for large integer values by extending the `itoa` fast path with dragonbox-compatible rounding. [#100649](https://github.com/ClickHouse/ClickHouse/pull/100649) ([Raúl Marín](https://github.com/Algunenano)).
* Replace `dragonbox` with `zmij` for 1.5x-3x faster Float-to-String conversion. [#100650](https://github.com/ClickHouse/ClickHouse/pull/100650) ([Raúl Marín](https://github.com/Algunenano)).
* Faster `Int128`/`UInt128` to string conversion by replacing software division with Barrett reduction and unrolling the conversion loop. [#100671](https://github.com/ClickHouse/ClickHouse/pull/100671) ([Raúl Marín](https://github.com/Algunenano)).
* Avoid spawning redundant threads in `uniqExact` parallel merge. [#100686](https://github.com/ClickHouse/ClickHouse/pull/100686) ([Jiebin Sun](https://github.com/jiebinn)).
* Add batch parallel merge for `uniqExact`. [#100687](https://github.com/ClickHouse/ClickHouse/pull/100687) ([Jiebin Sun](https://github.com/jiebinn)).
* Better parallelization of queries with simple views (with underlying `MergeTree` table) executed with parallel replicas. [#100815](https://github.com/ClickHouse/ClickHouse/pull/100815) ([Igor Nikonov](https://github.com/devcrafter)).
* Implements support of parallel replicas over simple views (including eligible `UNION ALL` views over `MergeTree` tables) when `parallel_replicas_allow_view_over_mergetree=1`. This allows to parallelize view's outer query instead of inner one which increases query parallelization across nodes. [#100958](https://github.com/ClickHouse/ClickHouse/pull/100958) ([Igor Nikonov](https://github.com/devcrafter)).
* Optimise reading in order of the primary key for `full_sorting_merge` when filters with `IN` are present in the query plan. [#101261](https://github.com/ClickHouse/ClickHouse/pull/101261) ([Nikita Taranov](https://github.com/nickitat)).
* Optimization allocations/deallocations by caching sampling settings instead of traverse all memory tracker hierarchy. [#101267](https://github.com/ClickHouse/ClickHouse/pull/101267) ([Azat Khuzhin](https://github.com/azat)).
* Fix significant INSERT performance regression when `deduplicate_insert = 'enable'` (default since 26.2) by deferring data hash computation from squashing to the sink and using batch column hashing via `updateHashWithValueRange`, reducing overhead from \~2.5s to \~0.5s for 5M rows with 22 columns. [#101494](https://github.com/ClickHouse/ClickHouse/pull/101494) ([Sema Checherinda](https://github.com/CheSema)).
* Reduce profiled lock overhead by using `try_lock` to avoid timing uncontended acquisitions and removing hold-time measurement. [#101502](https://github.com/ClickHouse/ClickHouse/pull/101502) ([Antonio Andelic](https://github.com/antonio2368)).
* Replace hand-written AVX-512 intrinsics in `arrayDotProduct` with platform-independent auto-vectorizable loops, adding AVX2 and ARM NEON support. [#101571](https://github.com/ClickHouse/ClickHouse/pull/101571) ([Peng](https://github.com/fastio)).
* Improve performance in `INSERT VALUES` for `Map`, `Array`, and `Tuple` columns when values are passed as escaped strings (e.g. `'{\'key\':1}'`), avoiding unnecessary fallback to the SQL expression parser. [#102119](https://github.com/ClickHouse/ClickHouse/pull/102119) ([Joanna Hulboj](https://github.com/jh0x)).
* Fixed excessive `RabbitMQ` table engine CPU usage. [#102711](https://github.com/ClickHouse/ClickHouse/pull/102711) ([Jaap Elst](https://github.com/jaapieaapie1)).
* The JOIN order optimizer now infers transitive equi-join predicates from existing join conditions. For example, given `A.x = B.x AND B.x = C.x`, the equivalence `A.x = C.x` is recognized, allowing the optimizer to consider direct joins between transitively-connected tables. This can improve plan quality for star and snowflake schemas where dimension tables connect through a shared fact table. The feature is controlled by the new `enable_join_transitive_predicates` setting (off by default). [#98479](https://github.com/ClickHouse/ClickHouse/pull/98479) ([Alexander Gololobov](https://github.com/davenger)).
* Optimize `TRUNCATE DATABASE TABLES LIKE` by pre-cancelling merges in parallel. [#98597](https://github.com/ClickHouse/ClickHouse/pull/98597) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Add monotonicity support for multiply, enabling primary key pruning for `key * constant` expressions. [#98983](https://github.com/ClickHouse/ClickHouse/pull/98983) ([Amos Bird](https://github.com/amosbird)).
* Cache dictionaries no longer take an exclusive lock in `hasKeys`; this reduces lock contention by using a shared lock for cache reads. [#100796](https://github.com/ClickHouse/ClickHouse/pull/100796) ([liuguangliang](https://github.com/sourcelliu)).
* Inline VIEW subquery in the query tree to allow more optimisations to be applied to the VIEW. [#100830](https://github.com/ClickHouse/ClickHouse/pull/100830) ([Dmitry Novik](https://github.com/novikd)).
* Optimize cache loading on server startup. [#101500](https://github.com/ClickHouse/ClickHouse/pull/101500) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Implement lazy column materialization for ReplacingMergeTree with FINAL in case the predicate is selective enough. [#101647](https://github.com/ClickHouse/ClickHouse/pull/101647) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Re-enable the `optimize_rewrite_array_exists_to_has` optimization (off by default since 23.10). It rewrites `arrayExists(x -> x = elem, arr)` into the much faster `has(arr, elem)` and now correctly skips the rewrite when the array element type and `elem` are not compatible for `has` (e.g. `Date` vs `String`), so previously breaking queries continue to work. Closes [#71431](https://github.com/ClickHouse/ClickHouse/issues/71431). [#100944](https://github.com/ClickHouse/ClickHouse/pull/100944) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="264-improvement">
  Improvement
</h4>

* Improved EXPLAIN PLAN pretty=1 output: print top-level query output columns, show join relation labels/symbols with estimated result rows and locality, and include per-step output columns for join/source steps. The changes cover Information Deficit part from [#98117](https://github.com/ClickHouse/ClickHouse/issues/98117). [#99462](https://github.com/ClickHouse/ClickHouse/pull/99462) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Add MergeTree table setting `share_nested_offsets` (default `true`). When set to `false`, Array columns with dotted names (e.g. `n.a`, `n.b`) are treated as independent columns instead of sharing offset files and validating equal array sizes as part of legacy `Nested` semantics. [#98416](https://github.com/ClickHouse/ClickHouse/pull/98416) ([Amos Bird](https://github.com/amosbird)).
* Users can now specify multiple authentication methods in users.xml/yaml configuration (in SQL it was always possible). [#91998](https://github.com/ClickHouse/ClickHouse/pull/91998) ([Flip-Liquid](https://github.com/Flip-Liquid)).
* Auto reload Raft inter-node connections which are using TLS. [#93455](https://github.com/ClickHouse/ClickHouse/pull/93455) ([Evgeny](https://github.com/evkuzin)).
* Extend `cast_keep_nullable` to work with Dynamic/JSON types. When set, casting NULL from types that can be Nullable will return NULL, otherwise NULL will throw `CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN` error. [#96504](https://github.com/ClickHouse/ClickHouse/pull/96504) ([Seva Potapov](https://github.com/seva-potapov)).
* Reduced the memory footprint from the internal data structures (`ISerialization` objects) by introducing an object pool. [#96563](https://github.com/ClickHouse/ClickHouse/pull/96563) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Add support of `password` and `identity` fields to keeper-client XML config. [#96800](https://github.com/ClickHouse/ClickHouse/pull/96800) ([Grigorii Sokolik](https://github.com/GSokol)).
* Improve `Iceberg` writes for the unity catalog. [#98162](https://github.com/ClickHouse/ClickHouse/pull/98162) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Add setting `finalize_projection_parts_synchronously` to allow synchronous finalization of projection parts during INSERT, reducing peak memory usage for tables with many projections while preserving existing async behavior by default. [#98228](https://github.com/ClickHouse/ClickHouse/pull/98228) ([Amos Bird](https://github.com/amosbird)).
* Add `projections_duration_ms` column to `system.part_log` that records per-projection merge/rebuild duration in milliseconds. [#98292](https://github.com/ClickHouse/ClickHouse/pull/98292) ([Amos Bird](https://github.com/amosbird)).
* Improve canceling queries using ExpressionTransform and NumbersRangedSource by KILL QUERY and cancel query (Ctrl+C) in clickhouse-client. [#98908](https://github.com/ClickHouse/ClickHouse/pull/98908) ([Roman Vasin](https://github.com/rvasin)).
* Replace the hardcoded `source_table_engines` list with a runtime lookup via `StorageFactory::getAllStorages()`. This adds access checks for some missing table engines and closes [#71544](https://github.com/ClickHouse/ClickHouse/issues/71544). [#98984](https://github.com/ClickHouse/ClickHouse/pull/98984) ([pufit](https://github.com/pufit)).
* Add a setting to control type mismatch behavior for Variant and Dynamic (throw or return null). [#99085](https://github.com/ClickHouse/ClickHouse/pull/99085) ([Bharat Nallan](https://github.com/bharatnc)).
* Improve `Iceberg` and Spark compatibility: fix inconsistent path handling caused by mixed usage of storage paths and metadata paths; enforce that `Iceberg` tables write down a table location that is either a URL or an absolute path; add a fallback for counting file sizes in `Azure` because some ClickHouse readers don't support byte counting after traversal; handle `version-hint.txt` in a manner compatible with Spark; introduce type-level abstractions that make it harder to mix up path types in the future; add tests for `Azure` and `Local` that verify cross-engine interoperability without intermediate uploading/downloading; fix usage of position deletes, which previously relied on path inference heuristics where that approach is inappropriate. [#99163](https://github.com/ClickHouse/ClickHouse/pull/99163) ([Daniil Ivanik](https://github.com/divanik)). [#100420](https://github.com/ClickHouse/ClickHouse/pull/100420) ([Daniil Ivanik](https://github.com/divanik)).
* Fix possible race condition in `IPartitionStrategy::cached_result` introduced in [https://github.com/ClickHouse/ClickHouse/pull/92844](https://github.com/ClickHouse/ClickHouse/pull/92844). [#99400](https://github.com/ClickHouse/ClickHouse/pull/99400) ([Arthur Passos](https://github.com/arthurpassos)).
* Users can now write ClickHouse Interval datatypes in the Arrow Format. [#99519](https://github.com/ClickHouse/ClickHouse/pull/99519) ([Peter Nguyen](https://github.com/petern48)).
* Adds native support for importing and exporting `UUID` data types in `Arrow` and `Parquet` formats. Users can now directly query and transfer UUID data between ClickHouse and other data tools without requiring manual string conversions or workarounds. Automated logical inference for top-level UUIDs, and support for explicit schema hint for nested UUIDs. [#99521](https://github.com/ClickHouse/ClickHouse/pull/99521) ([Ivan](https://github.com/ivanmantova)).
* Support `7z` archives on object storage. Closes [#70968](https://github.com/ClickHouse/ClickHouse/issues/70968). [#99600](https://github.com/ClickHouse/ClickHouse/pull/99600) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `ObjectStorageListedObjects`, `ObjectStorageGlobFilteredObjects`, `ObjectStoragePredicateFilteredObjects`, and `ObjectStorageReadObjects` ProfileEvents for introspection of object storage (`S3`, `Azure`, etc.) file listing and reading pipeline. [#99778](https://github.com/ClickHouse/ClickHouse/pull/99778) ([Sema Checherinda](https://github.com/CheSema)).
* Fix `merge` table function failing with `UNKNOWN_IDENTIFIER` error when querying columns not present in all underlying distributed/remote tables. [#99833](https://github.com/ClickHouse/ClickHouse/pull/99833) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Now we include commit time in total mutation execution time metric for ReplicatedMergeTree. It was lost after [#96376](https://github.com/ClickHouse/ClickHouse/issues/96376). [#99936](https://github.com/ClickHouse/ClickHouse/pull/99936) ([alesapin](https://github.com/alesapin)).
* Add a write-ahead log for blob objects pending removal in `MetadataStorageFromDisk`, improving durability and consistency between metadata and remote object storage when objects are deleted. [#100019](https://github.com/ClickHouse/ClickHouse/pull/100019) ([Maksim Kita](https://github.com/kitaisreal)).
* Disable AI SQL generation (`??` command) in the embedded client (SSH and WebSocket protocols) to prevent access to the server's environment variables. [#100290](https://github.com/ClickHouse/ClickHouse/pull/100290) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Change the interface for Iceberg inserts with the catalog. Deprecate settings: `storage_catalog_type`, `storage_aws_access_key_id`, etc. [#100334](https://github.com/ClickHouse/ClickHouse/pull/100334) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Render tabs as 4 spaces when pasting into clickhouse-client. Closes [#100405](https://github.com/ClickHouse/ClickHouse/issues/100405). [#100416](https://github.com/ClickHouse/ClickHouse/pull/100416) ([Raúl Marín](https://github.com/Algunenano)).
* Avoid scanning the whole remote data lake catalog for “Maybe you meant …” table hints when `show_data_lake_catalogs_in_system_tables` is disabled. [#100452](https://github.com/ClickHouse/ClickHouse/pull/100452) ([Alsu Giliazova](https://github.com/alsugiliazova)).
* Apply `distributed_index_analysis_min_indexes_bytes_to_activate` after partition pruning. [#100477](https://github.com/ClickHouse/ClickHouse/pull/100477) ([Azat Khuzhin](https://github.com/azat)).
* Fix assertion failure in Parquet bloom filter push down when using empty IN/NOT IN clauses. [#100543](https://github.com/ClickHouse/ClickHouse/pull/100543) ([zoomxi](https://github.com/zoomxi)).
* MinMax column statistics now store the minimum and maximum values as Field (typed) instead of Float64. The serialized format includes the column type name alongside the values. The statistics file version is bumped to V2; files written by older versions require re-materialization (ALTER TABLE … MATERIALIZE STATISTICS ALL). fix [#53140](https://github.com/ClickHouse/clickhouse-private/issues/53140). [#100605](https://github.com/ClickHouse/ClickHouse/pull/100605) ([Han Fei](https://github.com/hanfei1991)).
* Update `cppkafka` to include fix for Consumer close deadlock. [#100612](https://github.com/ClickHouse/ClickHouse/pull/100612) ([Azat Khuzhin](https://github.com/azat)).
* Object information used for parsing data files in Iceberg now contains the number of file rows and file size in bytes parsed from manifest file. [#100645](https://github.com/ClickHouse/ClickHouse/pull/100645) ([Daniil Ivanik](https://github.com/divanik)).
* Add `use_separate_cache_arena` configuration parameter to be able to control separation of the cache memory arena. [#100664](https://github.com/ClickHouse/ClickHouse/pull/100664) ([Seva Potapov](https://github.com/seva-potapov)).
* Adds native support for importing Apache Arrow's `StringView` and `BinaryView` data types into ClickHouse `String` columns, improving compatibility for Arrow-based ingestion. [#100762](https://github.com/ClickHouse/ClickHouse/pull/100762) ([Ivan](https://github.com/ivanmantova)).
* A few Keeper server settings are now hot-reloaded if config file is changed at runtime: max\_requests\_batch\_size, max\_requests\_batch\_bytes\_size, max\_request\_size, quorum\_reads. [#100773](https://github.com/ClickHouse/ClickHouse/pull/100773) ([Michael Kolupaev](https://github.com/al13n321)).
* Increment profile events `MemoryAllocatedWithoutCheck/MemoryAllocatedWithoutCheckBytes` in release build. [#100899](https://github.com/ClickHouse/ClickHouse/pull/100899) ([Pavel Kruglov](https://github.com/Avogar)).
* Cgroupv2 memory tracking now excludes `slab_reclaimable` from kernel memory, giving a more accurate measure of non-reclaimable memory usage. [#100901](https://github.com/ClickHouse/ClickHouse/pull/100901) ([Antonio Andelic](https://github.com/antonio2368)).
* `use_partition_pruning = 0` now also disables `MinMax` index pruning and count optimization on partition key columns, in addition to disabling pruning based on partition keys. [#100904](https://github.com/ClickHouse/ClickHouse/pull/100904) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* `pretty=1` in `EXPLAIN [PLAN]` now prints expressions in a human readable format. [#100927](https://github.com/ClickHouse/ClickHouse/pull/100927) ([Kirill Kopnev](https://github.com/Fgrtue)).
* `accurateCastOrNull` and `accurateCastOrDefault` now support `Tuple` target types, including nested `Tuples` with `Nullable` elements. Previously these functions rejected `Tuple` targets because `Tuple` could not be inside `Nullable`. Closes [#100820](https://github.com/ClickHouse/ClickHouse/issues/100820). [#100942](https://github.com/ClickHouse/ClickHouse/pull/100942) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix chart duplication in Play UI when switching between light and dark themes. [#101058](https://github.com/ClickHouse/ClickHouse/pull/101058) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Update chdig to [v26.3.1](https://github.com/azat/chdig/releases/tag/v26.3.1) (perfetto UI, sparklines to summary for CPU/Memory/Merges/Queries), system.warnings, regexp search in logs). [#101092](https://github.com/ClickHouse/ClickHouse/pull/101092) ([Azat Khuzhin](https://github.com/azat)). Update chdig to [v26.4.3](https://github.com/azat/chdig/releases/tag/v26.4.3) (perfetto improvements, fixes for sharing via pastila.nl, flamegraph diffs, change settings in realtime). [#103145](https://github.com/ClickHouse/ClickHouse/pull/103145) ([Azat Khuzhin](https://github.com/azat)).
* You can now have a trailing comma in the `WITH` clause before a `SELECT` query. [#101093](https://github.com/ClickHouse/ClickHouse/pull/101093) ([Aruj Bansal](https://github.com/arujbansal)).
* Add `compress_per_column_in_compact_parts` MergeTree setting to control how compressed blocks are organized within Compact parts. When `true` (default, preserving current behavior), each column starts a new compressed block, allowing selective decompression. When `false`, all columns within a granule are packed into the same compressed block, improving compression ratio and read performance for workloads that always read all columns. [#101114](https://github.com/ClickHouse/ClickHouse/pull/101114) ([Amos Bird](https://github.com/amosbird)).
* Show table info balloon in Play UI only when hovering over the table name, not the entire row. [#101118](https://github.com/ClickHouse/ClickHouse/pull/101118) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add engine-specific icons and improve table list UX in the Play UI sidebar. [#101134](https://github.com/ClickHouse/ClickHouse/pull/101134) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support `Nullable(Tuple)` for `Arrow`, `ArrowStream`, `ORC`, legacy `Parquet` formats. [#101272](https://github.com/ClickHouse/ClickHouse/pull/101272) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Display TOTALS row as a table footer in the web UI (play.html). [#101286](https://github.com/ClickHouse/ClickHouse/pull/101286) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support multi-query mode in the web UI (`play.html`): run multiple queries at once with parallel execution of `SELECT`-like queries and per-query result display. [#101290](https://github.com/ClickHouse/ClickHouse/pull/101290) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix column resize in play.html web UI after the result table was refactored into a web component. [#101295](https://github.com/ClickHouse/ClickHouse/pull/101295) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add ability limit amount of jemalloc profile flushes on MEMORY\_LIMIT\_EXCEEDED per time interval. [#101396](https://github.com/ClickHouse/ClickHouse/pull/101396) ([Azat Khuzhin](https://github.com/azat)).
* Added keeper settings `nuraft_streaming_mode` (by default `false`), `nuraft_max_log_gap_in_stream`, `nuraft_max_bytes_in_flight_in_stream`. Closes [#90743](https://github.com/ClickHouse/ClickHouse/issues/90743). [#101427](https://github.com/ClickHouse/ClickHouse/pull/101427) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Added `CGroupMemoryUsedWithoutPageCache` async metric that reports cgroup memory usage excluding both the kernel OS page cache and the ClickHouse userspace page cache, mirroring `MemoryResidentWithoutPageCache`. Also clarified the `CGroupMemoryUsed` metric description. [#101513](https://github.com/ClickHouse/ClickHouse/pull/101513) ([Francesco Ciocchetti](https://github.com/primeroz)).
* Add parser-level syntactic sugar for the SQL standard `OVERLAY` function syntax. The `overlay` function already exists; this adds support for the keyword-based form using `PLACING`, `FROM`, and `FOR` as separators. [#101681](https://github.com/ClickHouse/ClickHouse/pull/101681) ([Desel72](https://github.com/Desel72)).
* Added column alias `INDEX_LENGTH` to system table `information_schema.tables`, analogous to existing uppercase aliases in this table. [#101705](https://github.com/ClickHouse/ClickHouse/pull/101705) ([Robert Schulze](https://github.com/rschu1ze)).
* System table `information_schema.tables` now ignores inactive table parts. This makes the shown table size values more realistic. [#101706](https://github.com/ClickHouse/ClickHouse/pull/101706) ([Robert Schulze](https://github.com/rschu1ze)).
* The `ngrams` function now rejects invalid ngram lengths. Example: `SELECT ngrams('abc', 0)` now returns an error. [#101922](https://github.com/ClickHouse/ClickHouse/pull/101922) ([Robert Schulze](https://github.com/rschu1ze)).
* A follow-up for [#91820](https://github.com/ClickHouse/ClickHouse/issues/91820) and [#90837](https://github.com/ClickHouse/ClickHouse/issues/90837): filter unsupported algorithms from the error message; run FIPS-specific tests in FIPS builds. [#102067](https://github.com/ClickHouse/ClickHouse/pull/102067) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Limit cell height to three lines in the Web UI (`play.html`), with expandable cells on click. [#102154](https://github.com/ClickHouse/ClickHouse/pull/102154) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added new option that allows to force (virtual/path) style for S3 endpoints. Resolves [#82019](https://github.com/ClickHouse/ClickHouse/issues/82019); [#76007](https://github.com/ClickHouse/ClickHouse/issues/76007) Continue of [https://github.com/ClickHouse/ClickHouse/pull/83168](https://github.com/ClickHouse/ClickHouse/pull/83168). [#102378](https://github.com/ClickHouse/ClickHouse/pull/102378) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* The `restore_replace_external_engines_to_null` setting now also skips restoring databases with external engines (e.g. `DataLakeCatalog`, `MySQL`, `PostgreSQL`, `S3`) instead of failing or initiating external connections. [#102400](https://github.com/ClickHouse/ClickHouse/pull/102400) ([Nikita Fomichev](https://github.com/fm4v)).
* Add text index analysis support for the `hasPhrase` function via the `HINT` mode. [#102438](https://github.com/ClickHouse/ClickHouse/pull/102438) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Treat STATISTICS as read-only in ColumnDependency to fix LOGICAL\_ERROR during MATERIALIZE STATISTICS ALL. [#102627](https://github.com/ClickHouse/ClickHouse/pull/102627) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Create and populate `system.asynchronous_metric_log` in keeper-as-server mode. [#102664](https://github.com/ClickHouse/ClickHouse/pull/102664) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add `default_system_log_flush_policy.skip_alias_columns` config option to allow omitting ALIAS columns from system log tables, fixing S3-backed system logs that reject ALIAS columns. [#102669](https://github.com/ClickHouse/ClickHouse/pull/102669) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Don't enable auto statistics for system tables. They rarely have chance to use them. [#102862](https://github.com/ClickHouse/ClickHouse/pull/102862) ([Han Fei](https://github.com/hanfei1991)).
* Support `array` tokenizer for the LIKE optimization. [#102880](https://github.com/ClickHouse/ClickHouse/pull/102880) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Send MemoryAllocatedWithoutCheck even in release builds. [#103064](https://github.com/ClickHouse/ClickHouse/pull/103064) ([Azat Khuzhin](https://github.com/azat)).
* Expose per-thread untracked\_memory in system.stack\_trace. [#103065](https://github.com/ClickHouse/ClickHouse/pull/103065) ([Azat Khuzhin](https://github.com/azat)).

<h4 id="264-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Fix `Block structure mismatch in stream` error caused by unnecessary columns returned from Lazy materialization. Fixes [#95191](https://github.com/ClickHouse/ClickHouse/issues/95191). [#96682](https://github.com/ClickHouse/ClickHouse/pull/96682) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix a logical error with data masking policy query with `ON CLUSTER`. [#97594](https://github.com/ClickHouse/ClickHouse/pull/97594) ([Bharat Nallan](https://github.com/bharatnc)).
* Fix a bug when using Unity catalog on top of GCS. [#98456](https://github.com/ClickHouse/ClickHouse/pull/98456) ([Melvyn Peignon](https://github.com/melvynator)).
* `DataLakeCatalog` now respects the server's `http_forbid_headers` configuration when validating the `auth_header` setting. [#98827](https://github.com/ClickHouse/ClickHouse/pull/98827) ([Michael Anastasakis](https://github.com/michael-anastasakis)).
* Fix N+1 `HeadObject` calls for S3 brace-expansion globs. [#99219](https://github.com/ClickHouse/ClickHouse/pull/99219) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Validate setting changes in create queries when the engine itself also supports settings. [#99279](https://github.com/ClickHouse/ClickHouse/pull/99279) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fixed `ALTER TABLE UPDATE/DELETE` failing with `Missing columns` error when a table has a MATERIALIZED column whose expression depends on an EPHEMERAL column. [#99281](https://github.com/ClickHouse/ClickHouse/pull/99281) ([Yash ](https://github.com/Onyx2406)).
* Credentials in JDBC, ODBC, and NATS connection strings are now masked in query logs and `SHOW CREATE` output, preventing accidental exposure of sensitive information. For URI-style connection strings (e.g. `{scheme}://{user}:{password}@{host}`), only the password portion is masked while the rest remains visible for easier debugging. The `nats_token` setting is now also masked. [#99344](https://github.com/ClickHouse/ClickHouse/pull/99344) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix parseDateTimeBestEffort incorrectly parsing words starting with month prefixes in DD-month-YYYY format. Closes [#99345](https://github.com/ClickHouse/ClickHouse/issues/99345#event-23517658314). [#99350](https://github.com/ClickHouse/ClickHouse/pull/99350) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix ignoring of TABLE\_UUID\_MISMATCH for non analyzer. [#99380](https://github.com/ClickHouse/ClickHouse/pull/99380) ([Azat Khuzhin](https://github.com/azat)).
* Fix a bug where explicit settings sent alongside `compatibility` in the same request could be silently ignored when their value matched the server default. [#99402](https://github.com/ClickHouse/ClickHouse/pull/99402) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fixes cases where numbers with leading zeros in hive partitioning path were causing errors. Fixes [#98801](https://github.com/ClickHouse/ClickHouse/issues/98801). [#99458](https://github.com/ClickHouse/ClickHouse/pull/99458) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix heap-use-after-free when a table is dropped concurrently with a running read query (19 occurrences in CI over the last 90 days). [#99483](https://github.com/ClickHouse/ClickHouse/pull/99483) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed a bug in Keeper where a read request could get stuck (causing session to time out) if a different unrelated session on the same server was closed at just the wrong moment. [#99484](https://github.com/ClickHouse/ClickHouse/pull/99484) ([Michael Kolupaev](https://github.com/al13n321)).
* Validate column structure before applying patches. [#99531](https://github.com/ClickHouse/ClickHouse/pull/99531) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix vertical merge `rows_sources` assertion failure when `SYSTEM STOP/START MERGES` toggles rapidly during merge of table with `Dynamic` columns. [#99532](https://github.com/ClickHouse/ClickHouse/pull/99532) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect partition pruning for `toWeek()` that caused queries with `WHERE toWeek(date, mode) = N` to return empty results for weeks 49-52 on tables partitioned by `toYYYYMM(date)`. [#99542](https://github.com/ClickHouse/ClickHouse/pull/99542) ([Takumi Hara](https://github.com/takumihara)).
* Fix exception in functions operating on ColumnReplicated with unreferenced rows produced by JOIN. [#99564](https://github.com/ClickHouse/ClickHouse/pull/99564) ([Hechem Selmi](https://github.com/m-selmi)).
* Fix `CLEAR COLUMN` not rebuilding projections and not reevaluation materialized columns that depend on the cleared column, which could cause exceptions or data corruption during subsequent merges. [#99565](https://github.com/ClickHouse/ClickHouse/pull/99565) ([Desel72](https://github.com/Desel72)).
* Fixed an exception (`Bad get: has Tuple, actual type String`) in `ConditionSelectivityEstimator` when a query uses IN with a single scalar query parameter (e.g. `WHERE col IN ({p:String})`) on a table that has column statistics and `use_statistics` is enabled. [#99614](https://github.com/ClickHouse/ClickHouse/pull/99614) ([Ilya Yatsishin](https://github.com/qoega)).
* Part with unknown projections should not be marked as lost forever. [#99623](https://github.com/ClickHouse/ClickHouse/pull/99623) ([Sema Checherinda](https://github.com/CheSema)).
* Fix a rare logical error exception during vertical merge when `SYSTEM STOP MERGES` and `SYSTEM START MERGES` are executed concurrently. [#99628](https://github.com/ClickHouse/ClickHouse/pull/99628) ([Desel72](https://github.com/Desel72)).
* Fix dangling reference in injectRequiredColumns causing crash during merge. [#99679](https://github.com/ClickHouse/ClickHouse/pull/99679) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix undefined behavior in Avro format reader when reading numeric values that overflow the target column type. Now queries fail on overflows instead of silently producing incorrect values. [#99697](https://github.com/ClickHouse/ClickHouse/pull/99697) ([asyablue22](https://github.com/asyablue22)).
* Fix parsing of shell-style quotes in arguments for the `executable` table function. [#99794](https://github.com/ClickHouse/ClickHouse/pull/99794) ([Nikita Semenov](https://github.com/leftmain)).
* Fix false-positive abort in `NativeReader` when deserializing a Native format stream with a row-count mismatch: changed from `LOGICAL_ERROR` to `INCORRECT_DATA` so the error is handled as a data error rather than triggering `abort()` in sanitizer/debug builds. [#99822](https://github.com/ClickHouse/ClickHouse/pull/99822) ([Rahul Nair](https://github.com/motsc)).
* Fix process abort in `Tuple` column deserialization when the serialization kind in the binary stream is `DETACHED`. [#99823](https://github.com/ClickHouse/ClickHouse/pull/99823) ([Rahul Nair](https://github.com/motsc)).
* Fix false `LOGICAL_ERROR` exception during filesystem cache dynamic resize due to a race condition in SLRU sub-queue promotion. [#99850](https://github.com/ClickHouse/ClickHouse/pull/99850) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix async insert queries reporting zero `written_rows`, `read_rows`, and `result_rows` in `query_log` and client output. [#99879](https://github.com/ClickHouse/ClickHouse/pull/99879) ([Sema Checherinda](https://github.com/CheSema)).
* Fix exception "Bad cast from type X to Y" in `KILL QUERY` when the internal query against system tables returns columns wrapped in `ColumnConst`. [#99881](https://github.com/ClickHouse/ClickHouse/pull/99881) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error with correlated subquery within untuple argument. [#99917](https://github.com/ClickHouse/ClickHouse/pull/99917) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixes an exception when calling `right`, `rightUTF8`, or other substring functions with a length of INT64\_MIN (-9223372036854775808), which previously caused undefined behavior due to integer overflow. The functions now correctly report an ARGUMENT\_OUT\_OF\_BOUND error. [#99934](https://github.com/ClickHouse/ClickHouse/pull/99934) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Now ClickHouse should properly handle spark-style tables (where we have full absolute path for each file or relative path to common table path). Fixes [#92348](https://github.com/ClickHouse/ClickHouse/issues/92348). [#99935](https://github.com/ClickHouse/ClickHouse/pull/99935) ([alesapin](https://github.com/alesapin)).
* Fix "Inconsistent AST formatting" exception for `ALTER TABLE ... MODIFY QUERY` with nested subqueries containing `SETTINGS` when the `ALTER` itself also has `SETTINGS`. [#99938](https://github.com/ClickHouse/ClickHouse/pull/99938) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Revert [#97114](https://github.com/ClickHouse/ClickHouse/issues/97114) "Move join step row estimation before check for 1 child" due to suspected performance regression. [#99957](https://github.com/ClickHouse/ClickHouse/pull/99957) ([Alexander Gololobov](https://github.com/davenger)).
* Fixes a bug where ClickHouse could skip files if the `Content-Length` header was missing in their HEAD request response (for example, because of decompressive transcoding in GCS). [#99971](https://github.com/ClickHouse/ClickHouse/pull/99971) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix assertion failure (exception in debug builds, incorrect results in release builds) when multiplying `NumericIndexedVector` aggregate states by an even integer constant, caused by self-XOR on aliased Roaring bitmaps in `pointwiseAddInplace`. [#99976](https://github.com/ClickHouse/ClickHouse/pull/99976) ([Desel72](https://github.com/Desel72)).
* Prevent `Unexpected return type` exception in legacy filter pushdown through chained `JOIN USING` when key types change after join conversions. [#99999](https://github.com/ClickHouse/ClickHouse/pull/99999) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception "Unexpected node type for table expression ... Actual IDENTIFIER" when a scalar subquery is used inside an unresolved table function argument, e.g. `SELECT * FROM remote('localhost', view(SELECT 2 AS x), concat(x, (SELECT 1)))`. [#100014](https://github.com/ClickHouse/ClickHouse/pull/100014) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `INSERT` with `VALUES` failing when the data was followed by a trailing SQL comment (`--` or `/* */`) on the next line. The comment is now skipped instead of being parsed as another row. [#100016](https://github.com/ClickHouse/ClickHouse/pull/100016) ([Pratima Patel](https://github.com/pratimapatel2008)).
* Fix exception in `arrayRemove` when comparing tuples with NULL components. [#100017](https://github.com/ClickHouse/ClickHouse/pull/100017) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix cross-user data leak in `system.asynchronous_inserts`: any user with `SELECT` on the table could see pending async insert entries belonging to other users. Entries are now filtered by the current user, unless the user has the `SHOW_USERS` privilege. [#100024](https://github.com/ClickHouse/ClickHouse/pull/100024) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fixes case where Time64 to UInt64 cast could clamp values to 24 hours. [#100025](https://github.com/ClickHouse/ClickHouse/pull/100025) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix local server crash when CREATE DICTIONARY has a definition with list value containing non-existing function. [#100036](https://github.com/ClickHouse/ClickHouse/pull/100036) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix `CSV`, `MsgPack` format not being able to parse `Nullable(Tuple)` properly. Closes [#99753](https://github.com/ClickHouse/ClickHouse/issues/99753). [#100038](https://github.com/ClickHouse/ClickHouse/pull/100038) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `CREATE VIEW` failing with `UNKNOWN_IDENTIFIER` when using a WITH function-expression alias (e.g. `tuple(...)`) as the right-hand side of `IN`. [#100042](https://github.com/ClickHouse/ClickHouse/pull/100042) ([Peng](https://github.com/fastio)).
* Fix timeseries aggregate functions (e.g. `timeSeriesResampleToGridWithStaleness`) failing with `ILLEGAL_TYPE_OF_ARGUMENT` when used with `initializeAggregation` or `AggregatingMergeTree` under parallel replicas. [#100053](https://github.com/ClickHouse/ClickHouse/pull/100053) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Make correctly processing negative values inside NumericIndexedVectorDataBSI. [#100086](https://github.com/ClickHouse/ClickHouse/pull/100086) ([Daniil Ivanik](https://github.com/divanik)).
* Fix `accurateCastOrDefault` and `to*OrDefault` functions not preserving Const column type for constant inputs. [#100132](https://github.com/ClickHouse/ClickHouse/pull/100132) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Omitted query parameters with `LowCardinality(Nullable(T))` type now correctly default to NULL, same as `Nullable(T)`. [#100144](https://github.com/ClickHouse/ClickHouse/pull/100144) ([Denys Melnyk](https://github.com/germiBest)).
* Fix use-of-uninitialized-value in StringSearcher.h. [#100225](https://github.com/ClickHouse/ClickHouse/pull/100225) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Allow cancellation of scalar subqueries and other analysis-time pipelines via Ctrl+C. Previously, pressing Ctrl+C during a long-running scalar subquery had no effect until the subquery completed. Also fix the progress bar and JSON statistics to correctly report rows read during scalar subquery execution, both in `clickhouse-client` and `clickhouse-local`. Co-authored with @YjyJeff. [#100230](https://github.com/ClickHouse/ClickHouse/pull/100230) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a `LOGICAL_ERROR` exception in queries involving `Dynamic` columns with cross joins and runtime filters, caused by `ColumnVariant::filter` sharing variant column pointers instead of cloning them in the `hasOnlyNulls` optimization path. Closes [https://github.com/ClickHouse/ClickHouse/pull/100147](https://github.com/ClickHouse/ClickHouse/pull/100147). [#100234](https://github.com/ClickHouse/ClickHouse/pull/100234) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed array of variant bug which may reinterpret data type upon calling `arrayFirst`/`arrayLast` function. For example, previously `Array(Variant(Date, Bool))` is converted to `Bool` when the actual underlying variant type is `Date`. [#100255](https://github.com/ClickHouse/ClickHouse/pull/100255) ([timothygk](https://github.com/timothygk)).
* A few minor changes to functions: h3 functions now validate boundaries better; readWKB checks the size limits (a new setting, `max_wkb_geometry_elements`); random generator functions limit the maximum iterations in their computations. A follow-up for [#93543](https://github.com/ClickHouse/ClickHouse/issues/93543). [#100270](https://github.com/ClickHouse/ClickHouse/pull/100270) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an issue where cutURLParameter could incorrectly skip parameters when they appeared as substrings of other parameters. [#100280](https://github.com/ClickHouse/ClickHouse/pull/100280) ([Nikita Semenov](https://github.com/leftmain)).
* Fix exception when Iceberg metadata file path setting contains a null byte. [#100283](https://github.com/ClickHouse/ClickHouse/pull/100283) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed the quadratic number of run queries when `distributed_index_analysis` is used with predicates containing `IN` subqueries. [#100287](https://github.com/ClickHouse/ClickHouse/pull/100287) ([Anton Popov](https://github.com/CurtizJ)).
* Fix "Block structure mismatch" exception when using `GROUP BY ... WITH TOTALS HAVING` combined with `UNION DISTINCT` and nullable expressions. [#100293](https://github.com/ClickHouse/ClickHouse/pull/100293) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR exception in `estimateCompressionRatio` when `block_size_bytes` parameter is extremely large. [#100298](https://github.com/ClickHouse/ClickHouse/pull/100298) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Inconsistent AST formatting" exception in debug builds when using `GROUP BY CUBE(...) WITH ROLLUP` or similar combinations. [#100376](https://github.com/ClickHouse/ClickHouse/pull/100376) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when creating a view with column aliases and `SELECT *` or `EXCEPT`/`INTERSECT` queries. [#100386](https://github.com/ClickHouse/ClickHouse/pull/100386) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `DROP TABLE` hanging indefinitely on Kafka engine tables when consumers are stuck in a rebalance after a heartbeat error. [#100388](https://github.com/ClickHouse/ClickHouse/pull/100388) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `ReadBuffer is canceled. Can't read from it.` exception in backup/restore operations using zip archives. [#100400](https://github.com/ClickHouse/ClickHouse/pull/100400) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `TOO_MANY_ROWS` exception for `SELECT count()` queries with `max_rows_to_read` / `force_primary_key` when data is split across multiple parts with non-aligned granule boundaries. [#100408](https://github.com/ClickHouse/ClickHouse/pull/100408) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `system.completions` to correctly filter databases, tables, and columns by access rights in all grant combinations: per-table, per-db, and per-column revoke. [#100432](https://github.com/ClickHouse/ClickHouse/pull/100432) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix SEGFAULT in NuRaft due to race condition. [#100444](https://github.com/ClickHouse/ClickHouse/pull/100444) ([Pablo Marcos](https://github.com/pamarcos)).
* `min`/`max`/`argMin`/`argMax` now treat NaN consistently with `ORDER BY`: NaN is always skipped (returned only when all values are NaN). Previously, results depended on NaN position in the data due to IEEE 754 unordered comparison semantics. [#100448](https://github.com/ClickHouse/ClickHouse/pull/100448) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a copy-paste bug where `delta_lake_snapshot_end_version` set without `delta_lake_snapshot_start_version` was silently ignored instead of producing a `BAD_ARGUMENTS` error. [#100454](https://github.com/ClickHouse/ClickHouse/pull/100454) ([Mohammad Lareb Zafar](https://github.com/zlareb1)).
* `StorageRabbitMQ::shutdown` is not idempotent (it unconditionally accesses weak pointers and then destroys the corresponding shared pointers), but is now called twice: once in `StreamingStorageRegistry` and then in `DatabaseCatalog`. This fix makes the method idempotent and adds defensive null checks. [#100455](https://github.com/ClickHouse/ClickHouse/pull/100455) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix `LOGICAL_ERROR` exception when using `accurateCastOrNull` with `QBit` target type. [#100470](https://github.com/ClickHouse/ClickHouse/pull/100470) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix LOGICAL\_ERROR exception "Stream ... not found" when inserting into a table with nested `Array(JSON)` columns in wide parts with `optimize_on_insert=0`. [#100475](https://github.com/ClickHouse/ClickHouse/pull/100475) ([Pavel Kruglov](https://github.com/Avogar)).
* Validate file entry paths in backup metadata to reject path traversal, absolute paths, and empty names during `RESTORE`. [#100483](https://github.com/ClickHouse/ClickHouse/pull/100483) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix `LIMIT m OFFSET n WITH TIES` syntax not working. This syntax is equivalent to `LIMIT n, m WITH TIES` which already worked. [#100491](https://github.com/ClickHouse/ClickHouse/pull/100491) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix exception "No set is registered for key" when using `IN` with `Nullable(Tuple)` columns that have named fields and `LowCardinality` elements. [#100523](https://github.com/ClickHouse/ClickHouse/pull/100523) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix heap-buffer-overflow in usearch `sorted_buffer_gt::insert()` that could crash or silently corrupt memory during vector similarity search. [#100537](https://github.com/ClickHouse/ClickHouse/pull/100537) ([Dustin Healy](https://github.com/dustinhealy)).
* Fix `EXECUTE AS` ignoring `FORMAT` and `INTO OUTFILE` clauses specified in the query. [#100538](https://github.com/ClickHouse/ClickHouse/pull/100538) ([pufit](https://github.com/pufit)).
* Fix inconsistent AST formatting for SAMPLE with query-level OFFSET. Closes [#100576](https://github.com/ClickHouse/ClickHouse/issues/100576). [#100579](https://github.com/ClickHouse/ClickHouse/pull/100579) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix polaris catalog with azure. Since 25.12 this catalog with azure started to add bucket at the beginning of the path. For example `abfss://polaris-polaris@<some_url>.windows.net/polaris-polaris/<other-path>` instead of `abfss://polaris-polaris@<some_url>.windows.net/<other-path>`. This PR cuts bucket in the path. [#100583](https://github.com/ClickHouse/ClickHouse/pull/100583) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix type mismatch exception in transform when default column is const on some blocks. Closes [#100574](https://github.com/ClickHouse/ClickHouse/issues/100574). [#100616](https://github.com/ClickHouse/ClickHouse/pull/100616) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixes NOT\_FOUND\_COLUMN\_IN\_BLOCK cases where the projection SELECT part has columns that do not exist in the original SELECT part of the query. Closes [#100194](https://github.com/ClickHouse/ClickHouse/issues/100194). [#100623](https://github.com/ClickHouse/ClickHouse/pull/100623) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Validate Npy format shape dimensions against file size and overflow limits to prevent denial of service from crafted `.npy` files with unreasonably large dimensions. Also reject empty shapes and cap per-row memory to 2 GiB. [#100625](https://github.com/ClickHouse/ClickHouse/pull/100625) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `session_timezone` being ignored when parsing `DateTime` values during async inserts (TCP) and all inserts over HTTP. [#100647](https://github.com/ClickHouse/ClickHouse/pull/100647) ([Sema Checherinda](https://github.com/CheSema)).
* Allow passing sharding key to `cluster()` and `clusterAllReplicas()` table functions when using a table function as the source (e.g. `cluster('name', view(...), sharding_key)`). [#100665](https://github.com/ClickHouse/ClickHouse/pull/100665) ([Sergey Veletskiy](https://github.com/velom)).
* Fix server crash (assertion failure) when using parametric aggregate functions with Array combinator and NULL arguments, such as `quantileIfArrayArray(0.5)([[NULL]], [[1]])`. [#100679](https://github.com/ClickHouse/ClickHouse/pull/100679) ([nerve-bot](https://github.com/nerve-bot)).
* Fix exception when computing common supertype for empty and non-empty tuples with `use_variant_as_common_type` enabled. [#100699](https://github.com/ClickHouse/ClickHouse/pull/100699) ([Antonio Andelic](https://github.com/antonio2368)).
* Server no longer fails to start when an Azure blob storage disk is configured but the endpoint is temporarily unreachable (e.g. DNS failure). [#100701](https://github.com/ClickHouse/ClickHouse/pull/100701) ([Raúl Marín](https://github.com/Algunenano)).
* Fix undefined behavior in `positiveModulo` when the unsigned divisor does not fit in the signed result type. [#100705](https://github.com/ClickHouse/ClickHouse/pull/100705) ([Raúl Marín](https://github.com/Algunenano)).
* Fix server crash (logical error "Unexpected return type from \_\_topKFilter") when `use_top_k_dynamic_filtering` is enabled and the `ORDER BY` column has `Dynamic` or `Variant` type. [#100742](https://github.com/ClickHouse/ClickHouse/pull/100742) ([Groene AI](https://github.com/groeneai)).
* Fix server crash when using `has()` function with PREWHERE/WHERE on a Tuple key containing LowCardinality elements. [#100760](https://github.com/ClickHouse/ClickHouse/pull/100760) ([Groene AI](https://github.com/groeneai)).
* Fix `file_offset_of_buffer_end <= getFileSize()` assertion failure (exception in debug builds) when reading from `Log` or `StripeLog` tables on S3 object storage with concurrent writes. [#100763](https://github.com/ClickHouse/ClickHouse/pull/100763) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix an exception in the statistics selectivity estimator when a WHERE clause contains a function expression (e.g. toDecimal64(col, 3)) on a table with statistics enabled. The estimator now skips such predicates instead of attempting an invalid type cast. [#100764](https://github.com/ClickHouse/ClickHouse/pull/100764) ([Han Fei](https://github.com/hanfei1991)).
* Fixes a rare case where join with reordering can produce a wrong result. [#100790](https://github.com/ClickHouse/ClickHouse/pull/100790) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix incorrect `AggregateFunction` argument types in optimized trivial count, which caused `NUMBER_OF_ARGUMENTS_DOESNT_MATCH` exception when querying expressions like `count(v0 + v1)` on distributed tables. [#100794](https://github.com/ClickHouse/ClickHouse/pull/100794) ([YjyJeff](https://github.com/YjyJeff)).
* Some catalogs can show some secrets in the `SETTINGS` section of `select * from system.databases` query result. This PR prevents such behavior. [#100800](https://github.com/ClickHouse/ClickHouse/pull/100800) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix undefined behavior (signed integer overflow) in `toStartOfInterval` when using Week, Quarter, or Year intervals with an origin argument and extreme interval values. [#100817](https://github.com/ClickHouse/ClickHouse/pull/100817) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `If`, `Distinct`, `DistinctIf`, `IfState ` aggregate function combinators with `Tuple` return type and one or more `Nullable` argument not being able to read older serialized states after introduction of `Nullable(Tuple)`. Closes [#98917](https://github.com/ClickHouse/ClickHouse/issues/98917). [#100826](https://github.com/ClickHouse/ClickHouse/pull/100826) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix segfault in s3Cluster and distributed queries due to connection pool use-after-free. [#100837](https://github.com/ClickHouse/ClickHouse/pull/100837) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix null pointer dereference segfault when loading dictionaries during server shutdown. `Context::getUserDefinedSQLObjectsStorage` (dereferences `user_defined_sql_objects_storage`) is called by dictionary threads concurrently with the main thread calling `Context::shutdown` (sets `user_defined_sql_objects_storage` to null). We need to make sure we disable future updates in the dictionaries loader, kill the currently running dictionary queries and join the dictionary loading threads - all before running `Context::shutdown`. Similar to what we do with normal queries. [#100839](https://github.com/ClickHouse/ClickHouse/pull/100839) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix buffer overflow in `ULIDStringToDateTime` when input contains non-ASCII bytes. [#100843](https://github.com/ClickHouse/ClickHouse/pull/100843) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix crash (`LOGICAL_ERROR`) when querying a `Merge` table (or `merge()` table function) that wraps multiple tables including a `Distributed` table, with `distributed_group_by_no_merge=1` enabled. [#100859](https://github.com/ClickHouse/ClickHouse/pull/100859) ([Groene AI](https://github.com/groeneai)).
* Cast\_keep\_nullable when enabled will not throw when casting dynamic null to variant. [#100864](https://github.com/ClickHouse/ClickHouse/pull/100864) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix `clickhouse-keeper-client` `get`, `exists`, and `ls` commands printing duplicate `watch_id` error messages to stdout instead of stderr. [#100893](https://github.com/ClickHouse/ClickHouse/pull/100893) ([Mohammad Lareb Zafar](https://github.com/zlareb1)).
* Fix exception in `intDiv`/`intDivOrZero` on arrays of nullable tuples, e.g. `SELECT intDiv([divide((1, 2), ... AND NULL)], 2)`. [#100895](https://github.com/ClickHouse/ClickHouse/pull/100895) ([Raúl Marín](https://github.com/Algunenano)).
* Evaluate engine arguments for `StorageAlias` before storing the definition, so that expressions like `currentDatabase()` are resolved to literals before being saved to the database. [#100902](https://github.com/ClickHouse/ClickHouse/pull/100902) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fix `processAndOptimizeTextIndexFunctions` when `query_plan_merge_expressions = 0`, where `ExpressionStep` is directly above `ReadFromMergeTree`. Fixes [#100879](https://github.com/ClickHouse/ClickHouse/issues/100879). [#100909](https://github.com/ClickHouse/ClickHouse/pull/100909) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Update replxx to include fix for out-of-bounds access in do\_complete\_line. [#100925](https://github.com/ClickHouse/ClickHouse/pull/100925) ([Azat Khuzhin](https://github.com/azat)).
* Fix wrong results when JOIN with shard-by-PK optimization uses query condition cache and some parts are filtered out by cached conditions. [#100926](https://github.com/ClickHouse/ClickHouse/pull/100926) ([Groene AI](https://github.com/groeneai)).
* Fix `divide` and `intDiv` returning `ILLEGAL_DIVISION` when used in filter expressions during index analysis in some cases. [#100928](https://github.com/ClickHouse/ClickHouse/pull/100928) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed "Target table doesn't exist" errors for materialized views with inner tables during async startup, caused by incorrect startup dependency ordering. [#100946](https://github.com/ClickHouse/ClickHouse/pull/100946) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fix undefined behavior (signed integer overflow) in parseDateTimeBestEffort when parsing datetime strings with more than 18 fractional-second digits. [#100948](https://github.com/ClickHouse/ClickHouse/pull/100948) ([Vasily Chekalkin](https://github.com/bacek)).
* Fixed a crash when using a text search index with an `IN` clause containing a tuple subquery, e.g. `WHERE (id, str) IN (SELECT (id, str) FROM ...)`, or when the number of columns in the subquery does not match the tuple on the left side of `IN`. [#100959](https://github.com/ClickHouse/ClickHouse/pull/100959) ([Anton Popov](https://github.com/CurtizJ)).
* Fixed crash when building a polygon dictionary from a `MergeTree` table that uses sparse columns serialization. [#100964](https://github.com/ClickHouse/ClickHouse/pull/100964) ([Anton Popov](https://github.com/CurtizJ)).
* Fix logical error "Invalid action query tree node" when using `INTERSECT ALL` / `UNION ALL` with constant-folded expressions. [#100977](https://github.com/ClickHouse/ClickHouse/pull/100977) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `sumCountOrDefault` aggregate function with one or more `Nullable` argument not being able to read older serialized states after introduction of `Nullable(Tuple)`. Closes [#100882](https://github.com/ClickHouse/ClickHouse/issues/100882). [#101021](https://github.com/ClickHouse/ClickHouse/pull/101021) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix crash (`Logical error: isConst/isSparse/isReplicated assertTypeEquality`) in merge algorithms when lazy column replication (`enable_lazy_columns_replication`) produces `ColumnReplicated` columns that flow into merge-sort pipelines with late-arriving inputs. [#101036](https://github.com/ClickHouse/ClickHouse/pull/101036) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect `UNKNOWN_IDENTIFIER` error when the same alias is used for multiple expressions in `SELECT`; the correct `MULTIPLE_EXPRESSIONS_FOR_ALIAS` error is now reported. [#101040](https://github.com/ClickHouse/ClickHouse/pull/101040) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix ALIAS columns with `DateTime`/`DateTime64` types not applying timezone conversion when the declared timezone differs from the expression timezone. [#101043](https://github.com/ClickHouse/ClickHouse/pull/101043) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix row policies not being recorded in `query_log` for views, subqueries, and `INSERT ... SELECT`. Even though row policies were applied during query planning, they were not propagated from sub-planners to the parent planner for logging. Row policies (for logging only) are now kept in `QueryAccessInfo` so that both planners and sub-planners can populate them. [#101044](https://github.com/ClickHouse/ClickHouse/pull/101044) ([Narasimha Pakeer](https://github.com/npakeer)).
* Fix exception in `DirectJoinMergeTreeEntity` when pipeline blocks contain `ColumnConst` columns that are merged with regular columns. [#101046](https://github.com/ClickHouse/ClickHouse/pull/101046) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix spurious space in CTE column alias formatting (`WITH t (a, b)` → `WITH t(a, b)`). [#101049](https://github.com/ClickHouse/ClickHouse/pull/101049) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `remote`/`cluster` table functions failing with nested table functions like `merge` when the analyzer is enabled. [#101055](https://github.com/ClickHouse/ClickHouse/pull/101055) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `OFFSET` being applied twice in distributed queries when `prefer_localhost_replica=1`, producing fewer rows than expected. [#101071](https://github.com/ClickHouse/ClickHouse/pull/101071) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix crash when using the `Regexp` format with an invalid regular expression in `format_regexp` setting. [#101074](https://github.com/ClickHouse/ClickHouse/pull/101074) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix "Illegal type Decimal64 of start parameter" error for timeseries aggregate functions when using `serialize_query_plan=1` with parallel replicas. [#101083](https://github.com/ClickHouse/ClickHouse/pull/101083) ([Groene AI](https://github.com/groeneai)).
* Fix exception in `optimizeLazyMaterialization` when a projection with PREWHERE is used with `ORDER BY ... LIMIT`. [#101115](https://github.com/ClickHouse/ClickHouse/pull/101115) ([Anton Popov](https://github.com/CurtizJ)).
* Fix server crash (SIGABRT) when using aggregate functions with the internal-only `Null` combinator (e.g. `sumNull`, `avgNull`) and `aggregate_functions_null_for_empty = 1` setting enabled. [#101147](https://github.com/ClickHouse/ClickHouse/pull/101147) ([Groene AI](https://github.com/groeneai)).
* Fix a use-after-free in the filesystem cache write path that could cause reads from freed memory when logging completed file segments (detected by MemorySanitizer in BuzzHouse). [#101161](https://github.com/ClickHouse/ClickHouse/pull/101161) ([Groene AI](https://github.com/groeneai)).
* Fix server crash with "Trying to attach external table to a ready set without explicit elements" when distributed index analysis encounters a GLOBAL IN predicate whose set was built without explicit elements. [#101178](https://github.com/ClickHouse/ClickHouse/pull/101178) ([Groene AI](https://github.com/groeneai)).
* Fix `MAX`/`MIN` aggregate functions on `Decimal` columns returning incorrect results when JIT compilation is enabled (after the compilation threshold is reached). [#101203](https://github.com/ClickHouse/ClickHouse/pull/101203) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `minmax_count_projection` and trivial `COUNT(*)` optimizations being permanently disabled after a lightweight delete, even after all parts with a mask of lightweight delete were merged away. [#101212](https://github.com/ClickHouse/ClickHouse/pull/101212) ([Anton Popov](https://github.com/CurtizJ)).
* Fix a case which can lead to `Having zero bytes, ...` logical error from cache arising from a remote object being overwritten in between `list` and `read` which previously resulted in a stale object metadata. [#101219](https://github.com/ClickHouse/ClickHouse/pull/101219) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix server crash (LOGICAL\_ERROR: Bad cast from ColumnVector to ColumnLowCardinality) when querying a MergeTree table with `ORDER BY CAST(lc_column, 'Type')` where `lc_column` has a LowCardinality type. [#101220](https://github.com/ClickHouse/ClickHouse/pull/101220) ([Groene AI](https://github.com/groeneai)).
* Fix cleanup of stale processing nodes in `S3Queue`. [#101230](https://github.com/ClickHouse/ClickHouse/pull/101230) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix UB in mergeTreeAnalyzeIndexes() in case of invalid optimizations argument. [#101253](https://github.com/ClickHouse/ClickHouse/pull/101253) ([Azat Khuzhin](https://github.com/azat)).
* Fix `Logical error: 'partitions_count > 0'` exception when performing consecutive `ALTER TABLE UPDATE` on a partitioned Iceberg table. [#101278](https://github.com/ClickHouse/ClickHouse/pull/101278) ([Desel72](https://github.com/Desel72)).
* Fix wrong query results when a large integer constant (e.g. 256, 2147483648) is used as a boolean predicate in a WHERE clause with AND on MergeTree tables. For example, `SELECT count() FROM t WHERE (2147483648 > b) AND 2147483648` would incorrectly return 0 instead of matching all rows. [#101287](https://github.com/ClickHouse/ClickHouse/pull/101287) ([Groene AI](https://github.com/groeneai)).
* Fix insert-select from delta lake cluster with replicated merge tree. [#101299](https://github.com/ClickHouse/ClickHouse/pull/101299) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fixed crash with "Logical error: Reading from materialized CTE before materialization" when a scalar subquery references a chain of dependent materialized CTEs. [#101305](https://github.com/ClickHouse/ClickHouse/pull/101305) ([Groene AI](https://github.com/groeneai)).
* Fix data race on `storage_id` in `IStorage::getDependentViewsByColumn`. [#101385](https://github.com/ClickHouse/ClickHouse/pull/101385) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fix BACKUP FROM SNAPSHOT AST formatting and cloning. [#101405](https://github.com/ClickHouse/ClickHouse/pull/101405) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix LOGICAL\_ERROR crash "Current component is empty" when querying `system.part_moves_between_shards` with `enforce_keeper_component_tracking` enabled. [#101462](https://github.com/ClickHouse/ClickHouse/pull/101462) ([Groene AI](https://github.com/groeneai)).
* Fix segmentation fault in DataTypeDynamic::create() when the fuzzer generates a malformed Dynamic type AST. [#101464](https://github.com/ClickHouse/ClickHouse/pull/101464) ([Groene AI](https://github.com/groeneai)).
* Throw an error when `delta_lake_snapshot_version` or CDF version settings are used without DeltaKernel enabled, instead of silently returning wrong data. [#101489](https://github.com/ClickHouse/ClickHouse/pull/101489) ([Desel72](https://github.com/Desel72)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` exception when using ARRAY JOIN with JOIN USING and `analyzer_compatibility_join_using_top_level_identifier` setting enabled. Close [#101240](https://github.com/ClickHouse/ClickHouse/issues/101240). [#101507](https://github.com/ClickHouse/ClickHouse/pull/101507) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix Iceberg INSERT retry loop failing when the table was created with `iceberg_metadata_file_path` and the target metadata version already exists. [#101548](https://github.com/ClickHouse/ClickHouse/pull/101548) ([Groene AI](https://github.com/groeneai)).
* Strip Nullable from result column in arrayIntersect and related functions to avoid serialization/deserialization mismatch. [#101569](https://github.com/ClickHouse/ClickHouse/pull/101569) ([George Larionov](https://github.com/george-larionov)).
* Fix server crash (LOGICAL\_ERROR) when SELECT-ing from a materialized view backed by an IcebergLocal table engine. [#101577](https://github.com/ClickHouse/ClickHouse/pull/101577) ([Groene AI](https://github.com/groeneai)).
* Fix incorrect error message when calling `intExp10` with NaN argument — it said `intExp2` instead of `intExp10`. [#101582](https://github.com/ClickHouse/ClickHouse/pull/101582) ([Krishna Chaitanya](https://github.com/Krishnachaitanyakc)).
* Fix `allow_statistics=0` not blocking `ALTER TABLE ADD STATISTICS` and `ALTER TABLE DROP STATISTICS` after refactoring in [#100288](https://github.com/ClickHouse/ClickHouse/issues/100288). [#101585](https://github.com/ClickHouse/ClickHouse/pull/101585) ([Krishna Chaitanya](https://github.com/Krishnachaitanyakc)).
* Fix `KeeperMap` `CREATE TABLE` failing with "Cannot create metadata for table" when leftover ZooKeeper nodes from a pre-25.1 partial drop are missing the `drop_lock_version` node. [#101623](https://github.com/ClickHouse/ClickHouse/pull/101623) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix possible logical error during reading Map subcolumns. Closes [#100769](https://github.com/ClickHouse/ClickHouse/issues/100769). Closes [#101336](https://github.com/ClickHouse/ClickHouse/issues/101336). [#101641](https://github.com/ClickHouse/ClickHouse/pull/101641) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix exact subcolumn match priority over prefix match in `getSubcolumnData` to avoid possible crash. Closes [#101271](https://github.com/ClickHouse/ClickHouse/issues/101271). [#101645](https://github.com/ClickHouse/ClickHouse/pull/101645) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix crash (LOGICAL\_ERROR: "ColumnUnique can't contain null values") when comparing a `LowCardinality` column with a `Variant` NULL constant while `use_variant_default_implementation_for_comparisons` is disabled. [#101690](https://github.com/ClickHouse/ClickHouse/pull/101690) ([Groene AI](https://github.com/groeneai)).
* What: Added empty-stream guard to Bzip2ReadBuffer so it returns EOF instead of throwing UNEXPECTED\_END\_OF\_FILE when the inner stream is empty. [#101691](https://github.com/ClickHouse/ClickHouse/pull/101691) ([ClickGap AI Bot](https://github.com/clickgapai)).
* What: Fixed the inverted description text for the `alterable` column in `system.s3_queue_settings` and `system.azure_queue_settings` — swapped `0` and `1` meanings to match the actual code behavior. [#101703](https://github.com/ClickHouse/ClickHouse/pull/101703) ([ClickGap AI Bot](https://github.com/clickgapai)).
* Fix positiveModulo(tuple, number) incorrectly dispatching to division instead of modulo. [#101709](https://github.com/ClickHouse/ClickHouse/pull/101709) ([ClickGap AI Bot](https://github.com/clickgapai)).
* Fixes a crash when `thread_pool_size` is configured on a cache-wrapped disk. Previously, `FileCacheSettings::loadFromConfig()` rejected `thread_pool_size` as an unknown setting, preventing the server from starting. The setting is a valid `IDisk` parameter that controls the number of threads used for disk-to-disk copy operations during background part moves. [#101712](https://github.com/ClickHouse/ClickHouse/pull/101712) ([Francisco](https://github.com/Milias)).
* Fix `RANGE_HASHED` dictionary creation silently accepting a non-existent `MAX` range attribute and using the wrong type configuration when min and max range attributes had different types. The bug was a copy-paste error in `buildRangeConfiguration` that looked up `min_attr_name` instead of `max_attr_name` for the max attribute. [#101732](https://github.com/ClickHouse/ClickHouse/pull/101732) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix use-after-free crash in CPU lease scheduler when the wait timer outlives the worker thread whose `ProfileEvents::Counters` it references. [#101761](https://github.com/ClickHouse/ClickHouse/pull/101761) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixes bug in arrayLevenshteinDistanceWeighted and arraySimilarity functions. Closes [#101725](https://github.com/ClickHouse/ClickHouse/issues/101725). [#101767](https://github.com/ClickHouse/ClickHouse/pull/101767) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* Fix Prometheus Query API ignoring POST form bodies. [#101794](https://github.com/ClickHouse/ClickHouse/pull/101794) ([James Cunningham](https://github.com/JTCunning)).
* Fix exception escaping from S3 `Client::~Client` destructor causing server termination. [#101798](https://github.com/ClickHouse/ClickHouse/pull/101798) ([Gagan Dhakrey](https://github.com/gagandhakrey)).
* Fix use-after-scope in parallel deserialization of `Object` type dynamic paths, which could cause crashes when reading tables with many dynamic paths. [#101823](https://github.com/ClickHouse/ClickHouse/pull/101823) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed incorrect output in function `formatDateTime` with formatter`%W` with certain (non-default) formatting settings. [#101847](https://github.com/ClickHouse/ClickHouse/pull/101847) ([Robert Schulze](https://github.com/rschu1ze)).
* Fix `shouldPatchFunction` false negative in `SYSTEM INSTRUMENT ADD` when the search string first appears inside a template argument of the demangled symbol name. [#101885](https://github.com/ClickHouse/ClickHouse/pull/101885) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix UDF registry loss when ZooKeeper session expires during periodic refresh — all user-defined functions could become unavailable until a full refresh succeeds. [#101891](https://github.com/ClickHouse/ClickHouse/pull/101891) ([Nikita Fomichev](https://github.com/fm4v)).
* Fixed `system.codecs` description for `AES_256_GCM_SIV` to report `AES-256` instead of `AES-128`. [#101917](https://github.com/ClickHouse/ClickHouse/pull/101917) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix using wrong extremes in min-max index created on JSON column leading to wrong query result. Closes [#101700](https://github.com/ClickHouse/ClickHouse/issues/101700). [#101918](https://github.com/ClickHouse/ClickHouse/pull/101918) ([Pavel Kruglov](https://github.com/Avogar)).
* The `splitByString` tokenizer now rejects empty separator strings. [#101928](https://github.com/ClickHouse/ClickHouse/pull/101928) ([Robert Schulze](https://github.com/rschu1ze)).
* Fix `materialize_skip_indexes_on_merge=false` not suppressing text (full-text) indexes during merge. Previously, only non-text skip indexes (minmax, set, bloom\_filter) were suppressed; text indexes continued to be built, wasting CPU and I/O. [#101932](https://github.com/ClickHouse/ClickHouse/pull/101932) ([Groene AI](https://github.com/groeneai)).
* The `sparseGrams` tokenizer generated longer tokens than the provided max length (this was due to a hard-coded `+2` in the implementation). [#101934](https://github.com/ClickHouse/ClickHouse/pull/101934) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Fix SIGSEGV in `MergeTreeDataPartWriterWide::cancel` when a stream constructor throws during `addStreams`, leaving a null entry in `column_streams`. [#101936](https://github.com/ClickHouse/ClickHouse/pull/101936) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixes an exception when querying Merge or Distributed tables with a full-text index and combined filter conditions that mix `has*Tokens` with LIKE, while `query_plan_direct_read_from_text_index` is enabled. [#101939](https://github.com/ClickHouse/ClickHouse/pull/101939) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix undefined behaviour when parsing native protocol query packets with invalid `QueryProcessingStage` values. [#101972](https://github.com/ClickHouse/ClickHouse/pull/101972) ([Raúl Marín](https://github.com/Algunenano)).
* Close TCP connection when an exception occurs during initial query parsing to prevent reading garbage from a desynchronized stream. [#101989](https://github.com/ClickHouse/ClickHouse/pull/101989) ([Raúl Marín](https://github.com/Algunenano)).
* Fix SLRU race bug in filesystem cache 26.1+, which can lead to space reservation logical error. In debug build it can also lead to failed assert: `'Previous state is Evicting, but expected state to be Active while setting Evicting flag for 2c1e3484ecdc6b78a8978fa5b17c5097:0:339 (state: Evicting)'.`. [#101991](https://github.com/ClickHouse/ClickHouse/pull/101991) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix exception when casting a string with trailing data to empty `Tuple()` type. [#102011](https://github.com/ClickHouse/ClickHouse/pull/102011) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixes incorrect row ordering in queries that use ORDER BY with the grace\_hash join algorithm. Affected queries could return results in the wrong order, producing silently incorrect output. [#102036](https://github.com/ClickHouse/ClickHouse/pull/102036) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fixes a LOGICAL ERROR (Unexpected size of index type) that could occur in RIGHT JOIN and FULL JOIN queries when the `max_bytes_in_join` setting was configured. [#102042](https://github.com/ClickHouse/ClickHouse/pull/102042) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fixes cases where Time with negative values was returning wrong result on comparison with DateTime. Closes [#101670](https://github.com/ClickHouse/ClickHouse/issues/101670). [#102056](https://github.com/ClickHouse/ClickHouse/pull/102056) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix crash in UDF refresh caused by `ZooKeeperRetriesControl` retrying on a stale (expired) ZooKeeper session without renewing it. [#102059](https://github.com/ClickHouse/ClickHouse/pull/102059) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix missing spaces when formatting unlock snapshot. close [https://github.com/clickhouse/clickhouse/issues/101723](https://github.com/clickhouse/clickhouse/issues/101723). [#102063](https://github.com/ClickHouse/ClickHouse/pull/102063) ([Han Fei](https://github.com/hanfei1991)).
* Fix crash (SIGSEGV) when querying a view with a WHERE clause and the inner query produces columns with different types than the view metadata (e.g. Nullable from LEFT JOIN with `join_use_nulls`). [#102085](https://github.com/ClickHouse/ClickHouse/pull/102085) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix `VectorSimilarityIndexCache` entries never being evicted after part removal due to mismatched cache keys. [#102152](https://github.com/ClickHouse/ClickHouse/pull/102152) ([Seva Potapov](https://github.com/seva-potapov)).
* NACK broken messages when using rabbitmq storage. [#102157](https://github.com/ClickHouse/ClickHouse/pull/102157) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix logical error when parsing incorrect empty tuple string. [#102289](https://github.com/ClickHouse/ClickHouse/pull/102289) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix incorrect aggregation results (duplicate rows) when using `optimize_aggregation_in_order=1` with GROUP BY columns ordered differently from the table's sorting key. [#102299](https://github.com/ClickHouse/ClickHouse/pull/102299) ([Groene AI](https://github.com/groeneai)).
* Fix crash in `IcebergLocal` `ALTER TABLE ... UPDATE` when using Avro format, caused by `LowCardinality`/`Nullable` wrapper types not being unwrapped before serialization. [#102337](https://github.com/ClickHouse/ClickHouse/pull/102337) ([Desel72](https://github.com/Desel72)).
* Fixed a segmentation fault in mutations on materialized columns without an expression. Closes [#102185](https://github.com/ClickHouse/ClickHouse/issues/102185). [#102342](https://github.com/ClickHouse/ClickHouse/pull/102342) ([zoomxi](https://github.com/zoomxi)).
* Coalescing merge tree fix for array type. This closes [#89509](https://github.com/ClickHouse/ClickHouse/issues/89509). [#102384](https://github.com/ClickHouse/ClickHouse/pull/102384) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix segfault (or LOGICAL\_ERROR in debug builds) when reading Parquet files with bloom filter push down enabled and WHERE clause equality/inequality conditions. The crash occurred due to an out-of-bounds memory access in the Parquet prefetcher's bloom filter data retrieval, and could also cause non-deterministic wrong query results. [#102385](https://github.com/ClickHouse/ClickHouse/pull/102385) ([Groene AI](https://github.com/groeneai)).
* Fix `LOGICAL_ERROR` abort during SLRU filesystem cache dynamic resize caused by shared eviction statistics across sub-queues and incorrect recovery path for failed candidates. [#102396](https://github.com/ClickHouse/ClickHouse/pull/102396) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix failure to initialize on a fresh replica Alias tables without a target table in the Database Replicated. Closes [#101320](https://github.com/ClickHouse/ClickHouse/issues/101320). [#102397](https://github.com/ClickHouse/ClickHouse/pull/102397) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fix out-of-bounds read in string search functions (`countSubstrings`, `position`, etc.) when searching for a needle consisting entirely of null bytes. [#102401](https://github.com/ClickHouse/ClickHouse/pull/102401) ([Raúl Marín](https://github.com/Algunenano)).
* Full text index settings (`enable_full_text_index`, `allow_experimental_full_text_index`, `use_skip_indexes_on_data_read`) are no longer disabled when the `compatibility` setting points to a version older than 26.1. Previously this could prevent `SharedDatabaseCatalog` from creating tables with text indexes. [#102422](https://github.com/ClickHouse/ClickHouse/pull/102422) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix out of bounds read in `printf` with trailing `%`. [#102472](https://github.com/ClickHouse/ClickHouse/pull/102472) ([Raúl Marín](https://github.com/Algunenano)).
* Fixes a chassert exception `ReadBuffer is canceled` in debug builds in AsynchronousMetrics, caused by rewind not resetting the buffer cancellation flag. [#102524](https://github.com/ClickHouse/ClickHouse/pull/102524) ([Yuri Fedoseev](https://github.com/yurifedoseev)).
* Fixed `hasToken` / `hasTokenOrNull` with separator-only needles (e.g. `'()'`, `'!!!'`) on columns with a text index: previously the index silently skipped all granules instead of throwing `BAD_ARGUMENTS` (for `hasToken`) or returning `NULL` (for `hasTokenOrNull`). [#102544](https://github.com/ClickHouse/ClickHouse/pull/102544) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix OOMs on huge multi requests in the keeper. For OpenTelemetry tracing, we unconditionally allocate >1 KiB for OpenTelemetry spans in `ZooKeeperRequest` objects - meaning, for really huge multi requests, we try to allocate >10 GiB extra memory. To fix this, we now keep shared data in static memory and use `std::unique_ptr` over `std::optional` in `ZooKeeperOpentelemetrySpans`. [#102586](https://github.com/ClickHouse/ClickHouse/pull/102586) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix `NamedCollection` CurrentMetric being inflated by `CREATE NAMED COLLECTION IF NOT EXISTS` on existing collections, and not being initialized for collections loaded from config or SQL storage at startup. Closes [#102507](https://github.com/ClickHouse/ClickHouse/issues/102507). [#102598](https://github.com/ClickHouse/ClickHouse/pull/102598) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix exception in `getStructureOfRemoteTable` when local shard returns empty columns due to concurrent DDL. [#102604](https://github.com/ClickHouse/ClickHouse/pull/102604) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception when multiple concurrent `CREATE TABLE IF NOT EXISTS` queries target the same `S3Queue` table on a Shared database. [#102610](https://github.com/ClickHouse/ClickHouse/pull/102610) ([Nikita Taranov](https://github.com/nickitat)).
* Fix LOGICAL\_ERROR crash "Unexpected number of rows in column subchunk" in native Parquet V3 reader when reading nullable columns with a WHERE filter. [#102628](https://github.com/ClickHouse/ClickHouse/pull/102628) ([Groene AI](https://github.com/groeneai)).
* Fix `AzureWriteMicroseconds` profile event description saying "read" instead of "write". [#102639](https://github.com/ClickHouse/ClickHouse/pull/102639) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Bug with row policy that gives 'Not found column in block' exception in some special cases. [#102648](https://github.com/ClickHouse/ClickHouse/pull/102648) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed a server exception in ClusterDiscovery when a static cluster (defined in config) temporarily had no live nodes. [#102661](https://github.com/ClickHouse/ClickHouse/pull/102661) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix wrong date data type inference in case of overflow after timezone adjustment. Closes [#102601](https://github.com/ClickHouse/ClickHouse/issues/102601). [#102674](https://github.com/ClickHouse/ClickHouse/pull/102674) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `SYSTEM WAIT VIEW` hanging forever when the refreshable materialized view is dropped while the wait is in progress. [#102681](https://github.com/ClickHouse/ClickHouse/pull/102681) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fix CASE with Dynamic expression returning ELSE for all rows. Closes [#102511](https://github.com/ClickHouse/ClickHouse/issues/102511). [#102684](https://github.com/ClickHouse/ClickHouse/pull/102684) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix flattened Dynamic type serialization with binary encoded data types. Closes [#101911](https://github.com/ClickHouse/ClickHouse/issues/101911). [#102692](https://github.com/ClickHouse/ClickHouse/pull/102692) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix format\_schema\_source='query' silently ignoring multi-row results. Closes [#101905](https://github.com/ClickHouse/ClickHouse/issues/101905). [#102698](https://github.com/ClickHouse/ClickHouse/pull/102698) ([Pavel Kruglov](https://github.com/Avogar)).
* Report actual exit code via SSH client instead of mapping all errors to `1`. Closes [#101741](https://github.com/ClickHouse/ClickHouse/issues/101741). [#102700](https://github.com/ClickHouse/ClickHouse/pull/102700) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix losing HTTP headers for dynamic/predefined query handlers. Closes [#101846](https://github.com/ClickHouse/ClickHouse/issues/101846). [#102706](https://github.com/ClickHouse/ClickHouse/pull/102706) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Apply Poisson sampling correction to collapsed jemalloc heap profiles to match jeprof output. Previously the collapsed format underestimated actual allocation sizes by not accounting for the sampling probability. [#102759](https://github.com/ClickHouse/ClickHouse/pull/102759) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix the crash in the function `hasPhrase` with a `NULL` argument. [#102802](https://github.com/ClickHouse/ClickHouse/pull/102802) ([Nikita Taranov](https://github.com/nickitat)).
* Fix server crash (SIGSEGV) when reading Avro files with recursive schemas containing cyclic symbolic type references. Now such schemas are detected and rejected with a clear error message instead of crashing. [#102853](https://github.com/ClickHouse/ClickHouse/pull/102853) ([Groene AI](https://github.com/groeneai)).
* Fix server crash (LOGICAL\_ERROR assertion) when a function on a `Variant` column hits a memory limit or other non-type-conversion exception during result casting in `FunctionVariantAdaptor`. The exception is now propagated correctly instead of being misclassified as an internal error. [#102855](https://github.com/ClickHouse/ClickHouse/pull/102855) ([Groene AI](https://github.com/groeneai)).
* Fix server crash in debug/sanitizer builds when `std::length_error` is thrown during schema inference (e.g., from extreme `input_format_msgpack_number_of_columns` values or malformed input data). [#102859](https://github.com/ClickHouse/ClickHouse/pull/102859) ([Groene AI](https://github.com/groeneai)).
* Make null representation in serialization of replicated and sparse columns respect settings (e.g. format\_tsv\_null\_representation). [#102888](https://github.com/ClickHouse/ClickHouse/pull/102888) ([Hechem Selmi](https://github.com/m-selmi)).
* Backported in [#103499](https://github.com/ClickHouse/ClickHouse/issues/103499): Fix S3 requests failing with `ios_base::clear: unspecified iostream_category error` instead of being retried, caused by Poco `BufferedStreamBuf::flushBuffer` not handling short writes from the socket layer. [#102894](https://github.com/ClickHouse/ClickHouse/pull/102894) ([Sema Checherinda](https://github.com/CheSema)).
* Fix `minmax_count_projection` and trivial `COUNT(*)` optimizations being permanently disabled after a lightweight delete, even after all parts with a mask of lightweight delete were merged away. [#102900](https://github.com/ClickHouse/ClickHouse/pull/102900) ([Anton Popov](https://github.com/CurtizJ)).
* Fix random crashes in jemalloc due to LTO. [#102913](https://github.com/ClickHouse/ClickHouse/pull/102913) ([Azat Khuzhin](https://github.com/azat)).
* Optimize row policy OR-chains to IN in the new analyzer. [#102915](https://github.com/ClickHouse/ClickHouse/pull/102915) ([Azat Khuzhin](https://github.com/azat)).
* Fix jemalloc metadata corruption caused by page cache freeing with wrong alignment that may lead to crashes. [#102918](https://github.com/ClickHouse/ClickHouse/pull/102918) ([Azat Khuzhin](https://github.com/azat)).
* Plain INSERTs without materialized views no longer request excessive ConcurrencyControl slots and threads (`max_threads` instead of `max_insert_threads`), preventing CC slot starvation and thread count blowup on clusters with high INSERT throughput. [#102961](https://github.com/ClickHouse/ClickHouse/pull/102961) ([Sema Checherinda](https://github.com/CheSema)).
* Reintroduce ArrowMemoryPool to allow throwing MEMORY\_LIMIT\_EXCEEDED to avoid kernel OOM. [#102999](https://github.com/ClickHouse/ClickHouse/pull/102999) ([Azat Khuzhin](https://github.com/azat)).
* Fix `cast_string_to_date_time_mode` being ignored for `CAST` to `Nullable(DateTime)`. Closes [#101840](https://github.com/ClickHouse/ClickHouse/issues/101840). [#103035](https://github.com/ClickHouse/ClickHouse/pull/103035) ([Pavel Kruglov](https://github.com/Avogar)).
* Added support for `ALIAS` columns in text index direct read optimization. [#103037](https://github.com/ClickHouse/ClickHouse/pull/103037) ([Anton Popov](https://github.com/CurtizJ)).
* Backported in [#103454](https://github.com/ClickHouse/ClickHouse/issues/103454): Fix `SELECT DISTINCT` silently returning incomplete results when an aggregate projection matched the query and some parts of the table had no projection data (e.g. the projection was added on a table that already held data, and `MATERIALIZE PROJECTION` was not run). Closes [#102951](https://github.com/ClickHouse/ClickHouse/issues/102951). [#103052](https://github.com/ClickHouse/ClickHouse/pull/103052) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix wrong results returned by `WHERE x AND toNullable(N)` on `MergeTree` tables when `N` is an integer wider than `UInt8` (e.g. `256`, `65535`, `2147483648`, or any negative integer). The filter incorrectly discarded all rows because `splitFilterNodeForAllowedInputs` used a `NULL` zero when converting the `Nullable` remainder of a reduced `AND` to boolean, turning the comparison into `NULL` under three-valued logic. [#103077](https://github.com/ClickHouse/ClickHouse/pull/103077) ([Groene AI](https://github.com/groeneai)).
* Fixed incorrect argument type reported in error messages of string search functions (e.g. `locate`, `position`) when arguments are passed in swapped order (`locate(needle, haystack)` with `function_locate_has_mysql_compatible_argument_order = 1`). [#103102](https://github.com/ClickHouse/ClickHouse/pull/103102) ([Alex Kuleshov](https://github.com/0xAX)).
* Fix waitForPause hanging indefinitely when disableFailPoint is called with no thread paused at the failpoint. [#103119](https://github.com/ClickHouse/ClickHouse/pull/103119) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Cap pre-auth TCP Hello packet strings to 64 KB and add `handshake_timeout_milliseconds` server setting to limit total handshake time, preventing unauthenticated clients from consuming excessive memory or holding threads indefinitely. [#103284](https://github.com/ClickHouse/ClickHouse/pull/103284) ([Sema Checherinda](https://github.com/CheSema)).
* Fix Parquet ColumnIndex stats min\_value > max\_value for String columns. [#103334](https://github.com/ClickHouse/ClickHouse/pull/103334) ([Saurabh Kumar Ojha](https://github.com/saurabhojha)).
* Check for malformed flattened Dynamic data in Native format. [#103392](https://github.com/ClickHouse/ClickHouse/pull/103392) ([Pavel Kruglov](https://github.com/Avogar)).
* Populate `_time` column from `url` table function. [#103437](https://github.com/ClickHouse/ClickHouse/pull/103437) ([Nikita Taranov](https://github.com/nickitat)).
* Fix SVE detection using SVE instructions when unavailable. [#103568](https://github.com/ClickHouse/ClickHouse/pull/103568) ([Raúl Marín](https://github.com/Algunenano)).

<h4 id="264-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Libstemmer (Snowball) dependency now uses newer version v3.0.1. [#99256](https://github.com/ClickHouse/ClickHouse/pull/99256) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Randomize settings in clickhouse-test: `use_skip_indexes_for_top_k`, `use_top_k_dynamic_filtering`, `query_plan_max_limit_for_top_k_optimization`. [#91782](https://github.com/ClickHouse/ClickHouse/pull/91782) ([Nikita Fomichev](https://github.com/fm4v)).
* Implement a stress test for functions, checking the soundness of their various properties. [#93543](https://github.com/ClickHouse/ClickHouse/pull/93543) ([Michael Kolupaev](https://github.com/al13n321)).
* Provide own CMake configuration for `llvm-project` instead of importing upstream one. [#97453](https://github.com/ClickHouse/ClickHouse/pull/97453) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Randomize more `optimize_*` settings in the test infrastructure to improve coverage of query optimization passes. [#97547](https://github.com/ClickHouse/ClickHouse/pull/97547) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Use Rust toolchain nightly-2026-03-22. [#98602](https://github.com/ClickHouse/ClickHouse/pull/98602) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `wasmtime` v42.0.1. [#98603](https://github.com/ClickHouse/ClickHouse/pull/98603) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `llvm-project` 22.1.1. [#98882](https://github.com/ClickHouse/ClickHouse/pull/98882) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Replace `SANITIZE_COVERAGE` (custom sanitizer callbacks, symbol-level granularity) with LLVM source-based coverage (`WITH_COVERAGE`, `-fprofile-instr-generate -fcoverage-mapping`) for the nightly per-test coverage pipeline. The server now reads its own coverage mapping from ELF sections at startup and collects `(file, line_start, line_end)` tuples per test via a new `SYSTEM SET COVERAGE TEST 'name'` command. Test selection in targeted CI checks uses line-range queries against a new `checks_coverage_lines` CIDB table and ranks candidate tests by how many changed diff lines they cover. [#99513](https://github.com/ClickHouse/ClickHouse/pull/99513) ([Nikita Fomichev](https://github.com/fm4v)).
* Fix llvm-libc link error with -O0 build. [#100023](https://github.com/ClickHouse/ClickHouse/pull/100023) ([Zheguang Zhao](https://github.com/zheguang)).
* Fixed two error messages on container startup in case the configuration did not contain the `logger.log` and `logger.errorlog` settings (e.g. when all log messages are supposed to go to STDOUT/STDERR). [#100239](https://github.com/ClickHouse/ClickHouse/pull/100239) ([Simon](https://github.com/simonhammes)).
* Prefer `ld64.lld` over Apple's `ld` (cctools-port ld64) for macOS builds. This should significantly reduce Darwin link times, as cctools-port's ld64 is very slow with `-ffunction-sections` and `-dead_strip`. Falls back to `ld` if `ld64.lld` is not available. [#100275](https://github.com/ClickHouse/ClickHouse/pull/100275) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Tests to ensure that directories do not register any secrets (REST + Glue). [#100307](https://github.com/ClickHouse/ClickHouse/pull/100307) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Repeat recently modified tests with different randomized settings. [#100385](https://github.com/ClickHouse/ClickHouse/pull/100385) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Track `#embed` file dependencies in CMake and enable ccache depend mode for correct rebuilds. [#100411](https://github.com/ClickHouse/ClickHouse/pull/100411) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add correctness tests for TPC-H queries. [#100580](https://github.com/ClickHouse/ClickHouse/pull/100580) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Use `aws-sdk-cpp` 1.11.771. [#100582](https://github.com/ClickHouse/ClickHouse/pull/100582) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Allow performance test XMLs to reference external SQL query files and settings via file attribute. [#100747](https://github.com/ClickHouse/ClickHouse/pull/100747) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix compilation with `-march=x86-64-v4` by adding missing `TargetSpecific.h` include in `LowerUpperImpl.h`. [#100932](https://github.com/ClickHouse/ClickHouse/pull/100932) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix build on gentoo by adding --no-default-config to cxxflags. [#100973](https://github.com/ClickHouse/ClickHouse/pull/100973) ([Isak Ellmer](https://github.com/spinojara)).
* Added `utils/auto-bisect/` — a shell-based bisection framework that downloads pre-built CI binaries and runs a user-supplied test script to find the first commit that introduced a regression, without requiring a local build. [#100989](https://github.com/ClickHouse/ClickHouse/pull/100989) ([Nikita Fomichev](https://github.com/fm4v)).
* Disable ThinLTO by default in CMake so that local developer builds no longer implicitly enable it. CI release builds are unaffected since they explicitly pass `-DENABLE_THINLTO=1`. [#101041](https://github.com/ClickHouse/ClickHouse/pull/101041) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add TPC-DS SF1 benchmark to performance tests. [#101209](https://github.com/ClickHouse/ClickHouse/pull/101209) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Added stateless tests for MergeTree lightweight deletes covering: `has_lightweight_delete` flag lifecycle, `COUNT(*)` correctness with `optimize_trivial_count_query`, `MATERIALIZED`/`DEFAULT` column integrity, `ReplicatedMergeTree` flag recovery, `read_in_order` with deleted rows, multiple delete/merge cycles, `_row_exists` column hiding, predicate variety, and `ALTER DELETE` RBAC enforcement. [#101792](https://github.com/ClickHouse/ClickHouse/pull/101792) ([Nikita Fomichev](https://github.com/fm4v)).
* Distroless Docker images are now published with ubuntu and alpine variants for tagged releases. [#101941](https://github.com/ClickHouse/ClickHouse/pull/101941) ([Rahul Nair](https://github.com/motsc)).
* Stack traces now show clean bare relative paths (e.g. `src/Common/Exception.cpp`) instead of paths polluted with the build directory (e.g. `./ci/tmp/fast_build/./src/Common/Exception.cpp`). [#102000](https://github.com/ClickHouse/ClickHouse/pull/102000) ([Raúl Marín](https://github.com/Algunenano)).
* Add a CI style check that rejects files larger than 5 MB committed to the repository, with a whitelist for existing legitimate test data. Remove unused 14 MB `zookeeper_log.parquet`. [#102080](https://github.com/ClickHouse/ClickHouse/pull/102080) ([Raúl Marín](https://github.com/Algunenano)).
* Remove \~400 unused `#include` directives from headers to reduce compilation times. [#102585](https://github.com/ClickHouse/ClickHouse/pull/102585) ([Raúl Marín](https://github.com/Algunenano)).
* Use `wasmtime` v43.0.1. [#102603](https://github.com/ClickHouse/ClickHouse/pull/102603) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `openssl` 3.5.6. [#102606](https://github.com/ClickHouse/ClickHouse/pull/102606) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `xz` 5.8.3. [#102607](https://github.com/ClickHouse/ClickHouse/pull/102607) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Upgrade distroless Docker image base from Debian 12 (glibc 2.36, OpenSSL 3.0) to Debian 13 (glibc 2.41, OpenSSL 3.5), reducing CVE surface to zero reachable vulnerabilities. [#101678](https://github.com/ClickHouse/ClickHouse/pull/101678) ([Rahul Nair](https://github.com/motsc)).

<h3 id="263">
  ClickHouse release 26.3 LTS, 2026-03-26. [Presentation](https://presentations.clickhouse.com/), [Video](https://www.youtube.com/watch?v=_bY0ucNB1lQ)
</h3>

<h4 id="263-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* Downgrading after upgrading may cause data loss. Propagate data types serialization versions to nested data types. For example, String serialization version `with_size_stream` previously was applied only on top-level String columns and Tuple elements. Now it's applied to any String type inside any nested type like `Array`/`Map`/`Variant`/`JSON`/etc. This behaviour is controlled by MergeTree setting `propagate_types_serialization_versions_to_nested_types` that is now enabled by default. After this change, newly created data parts cannot be read by older versions, but old parts can be read on new version with no problems. **Upgrade is safe, but downgrade is not — if you need to roll back after upgrading to 26.3, data written by 26.3 in columns with nested types will be unreadable!** See [#101429](https://github.com/ClickHouse/ClickHouse/issues/101429) for details. [#94859](https://github.com/ClickHouse/ClickHouse/pull/94859) ([Pavel Kruglov](https://github.com/Avogar)).
* Remove the `hypothesis` skip index type. It was an obscure, experimental feature with limited practical use. Creating tables with `INDEX ... TYPE hypothesis` will now produce an error. [#96874](https://github.com/ClickHouse/ClickHouse/pull/96874) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove the experimental `detectProgrammingLanguage` function. [#99567](https://github.com/ClickHouse/ClickHouse/pull/99567) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `NOT` operator precedence to match the SQL standard: `NOT` now binds looser than `IS NULL`, `BETWEEN`, `LIKE`, and arithmetic operators. For example, `NOT (x) IS NULL` is now parsed as `NOT (x IS NULL)` instead of `(NOT x) IS NULL`. This may change the result of queries that relied on the previous (non-standard) behavior. [#97680](https://github.com/ClickHouse/ClickHouse/pull/97680) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Corrects the metadata of normal projections so that projections with multi-column sorting keys are properly recognized. Builds on top of [#90429](https://github.com/ClickHouse/ClickHouse/issues/90429). [#91352](https://github.com/ClickHouse/ClickHouse/pull/91352) ([Amos Bird](https://github.com/amosbird)).
* Fixed skip index files not respecting replace\_long\_file\_name\_to\_hash setting, causing "File name too long" errors and broken index reads for indices with long names. Skip index filenames are now hashed when they exceed max\_file\_name\_length, similar to column files. This is backward compatible (new servers read old parts), but downgrading (or old servers during a rolling upgrade) may cause long-named indices to be ignored. [#97128](https://github.com/ClickHouse/ClickHouse/pull/97128) ([Raúl Marín](https://github.com/Algunenano)).
* Turn on async insert by default. ClickHouse will be batching all small inserts by default now. This setting is set under compatibility. If you set `compatibility=<version less than 26.2>` then default value would be the previous one, `false`. You can turn off/on async inserts at several levels: in the config in users profiles, for the session, for the query, or for the MergeTree table. [#97590](https://github.com/ClickHouse/ClickHouse/pull/97590) ([Sema Checherinda](https://github.com/CheSema)).
* Change the default value of `mysql_datatypes_support_level` from empty to `decimal,datetime64,date2Date32`, enabling proper mapping of MySQL `DATE` to `Date32`, `DECIMAL`/`NUMERIC` to `Decimal`, and `DATETIME`/`TIMESTAMP` with precision to `DateTime64` by default. Previously, MySQL `DATE` columns were mapped to `Date` which cannot represent dates before 1970-01-01, causing data corruption. [#97716](https://github.com/ClickHouse/ClickHouse/pull/97716) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Accept array of part names instead of regexp for `mergeTreeAnalyzeIndexes{,UUID}` since regexp is slow (*Experimental feature*). [#98474](https://github.com/ClickHouse/ClickHouse/pull/98474) ([Azat Khuzhin](https://github.com/azat)).
* Change default `stderr_reaction` from `throw` to `log_last` for executable UDFs. UDFs that write warnings to stderr no longer fail when exit code is 0. Exit code exceptions now include stderr content. [#99232](https://github.com/ClickHouse/ClickHouse/pull/99232) ([Xu Jia](https://github.com/XuJia0210)).

<h4 id="263-new-feature">
  New Feature
</h4>

* Added bucketed serialization for Map columns in MergeTree (`map_serialization_version = 'with_buckets'`). Keys are split into hash-based buckets so that reading a single key (`m['key']`) only reads one bucket instead of the entire column, providing 2-49x speedup for single-key lookups depending on map size. The number of buckets and the bucketing strategy can be controlled by new MergeTree settings: `map_serialization_version`, `max_buckets_in_map`, `map_buckets_strategy`, `map_buckets_coefficient`, and `map_buckets_min_avg_size`. [#99200](https://github.com/ClickHouse/ClickHouse/pull/99200) ([Pavel Kruglov](https://github.com/Avogar)).
* Support materialized CTE. Allow evaluating CTEs only once during query execution and store their results in temporary tables. Closes [#53449](https://github.com/ClickHouse/ClickHouse/issues/53449). [#94849](https://github.com/ClickHouse/ClickHouse/pull/94849) ([Dmitry Novik](https://github.com/novikd)).
* Allow certain SQL-standard functions without parentheses for compatibility, such as `NOW`. Closes [#52102](https://github.com/ClickHouse/ClickHouse/issues/52102). [#95949](https://github.com/ClickHouse/ClickHouse/pull/95949) ([Aly Kafoury](https://github.com/AlyHKafoury)).
* You can now use the natural sort key function as `naturalSortKey(s)`. [#90322](https://github.com/ClickHouse/ClickHouse/pull/90322) ([Nazarii Piontko](https://github.com/nazarii-piontko)).
* You can now use native JSON/Object input for JSONExtract functions. Closes [#88370](https://github.com/ClickHouse/ClickHouse/issues/88370). [#96711](https://github.com/ClickHouse/ClickHouse/pull/96711) ([Fisnik Kastrati](https://github.com/fkastrati)).
* If a query parameter has `Nullable` type and is not specified, we will assume that its value is `NULL`. [#93869](https://github.com/ClickHouse/ClickHouse/pull/93869) ([Vikash Kumar](https://github.com/vikashkumar2020)).
* Support auxiliary ZooKeeper for `Replicated` database. [#95590](https://github.com/ClickHouse/ClickHouse/pull/95590) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Support `has` function for JSON type to check path existence, similar to Map. [#96927](https://github.com/ClickHouse/ClickHouse/pull/96927) ([DQ](https://github.com/il9ue)).
* Added the `mergeTreeTextIndex(database, table, index)` table function, which allows reading data directly from a text index. This function can be used for introspection or for performing aggregations on top of text index data. [#97003](https://github.com/ClickHouse/ClickHouse/pull/97003) ([Anton Popov](https://github.com/CurtizJ)).
* Add `table_readonly` MergeTree setting to mark tables as read-only, preventing inserts and modifications. [#97652](https://github.com/ClickHouse/ClickHouse/pull/97652) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add new setting `use_partition_pruning` and alias `use_partition_key`. Set it to `false` to disable partition pruning based on the partition key. [#97888](https://github.com/ClickHouse/ClickHouse/pull/97888) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Implements `ALTER TABLE ... EXECUTE expire_snapshots('<timestamp>')` for Iceberg tables. [#97904](https://github.com/ClickHouse/ClickHouse/pull/97904) ([murphy-4o](https://github.com/murphy-4o)). [#99130](https://github.com/ClickHouse/ClickHouse/pull/99130)
* Allow each `type=http` entry in `<protocols>` to specify a custom `<handlers>` key pointing to a separate `<http_handlers_*>` config section, enabling different HTTP routing rules per port. [#98414](https://github.com/ClickHouse/ClickHouse/pull/98414) ([Amos Bird](https://github.com/amosbird)).
* Add `pretty=1` option to `EXPLAIN` for tree-style indented output and `compact=1` to collapse `Expression` steps, making query plans more readable. [#98500](https://github.com/ClickHouse/ClickHouse/pull/98500) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Add `restore_access_entities_with_current_grants` server setting. When enabled, restored users/roles from backups have their grants limited to what the restoring user is allowed to grant (same semantics as `GRANT CURRENT GRANTS`), instead of failing with `ACCESS_DENIED`. [#98795](https://github.com/ClickHouse/ClickHouse/pull/98795) ([pufit](https://github.com/pufit)).
* Add `caseFoldUTF8` and `removeDiacriticsUTF8` functions for Unicode case folding and diacritical mark removal. [#98973](https://github.com/ClickHouse/ClickHouse/pull/98973) ([George Larionov](https://github.com/george-larionov)).
* Add `normalizeUTF8NFKCCasefold` string function for NFKC\_Casefold Unicode normalization, which combines NFKC normalization with case folding. [#99276](https://github.com/ClickHouse/ClickHouse/pull/99276) ([George Larionov](https://github.com/george-larionov)).
* Add `unicode_word` tokenizer for full-text indexes and the `tokens` function. It splits text using Unicode word boundary rules: ASCII words are formed with connector characters (underscore, colon, dot, single quote), while non-ASCII Unicode characters become single-character tokens. Note: 26.3 accepts this tokenizer only under the name `unicode_word`; it was renamed to `asciiCJK` in 26.4. [#99357](https://github.com/ClickHouse/ClickHouse/pull/99357) ([Amos Bird](https://github.com/amosbird)).
* Added `max_skip_unavailable_shards_num` and `max_skip_unavailable_shards_ratio` settings to limit how many shards can be silently skipped when `skip_unavailable_shards` is enabled. If the number or ratio of unavailable shards exceeds the configured threshold, an exception is thrown instead of returning silently incomplete results. [#99369](https://github.com/ClickHouse/ClickHouse/pull/99369) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Users can now use `SOME` keyword for subquery expressions. It behaves identically to `ANY`. [#99842](https://github.com/ClickHouse/ClickHouse/pull/99842) ([Artem Kytkin](https://github.com/Vinceent)).
* Add `output_format_trim_fixed_string` setting to strip trailing null bytes from `FixedString` values in text output formats. [#97558](https://github.com/ClickHouse/ClickHouse/pull/97558) ([NeedmeFordev](https://github.com/spider-yamet)).
* Support parenthesized table join expressions in FROM clause, e.g. `SELECT * FROM (t1 CROSS JOIN t2)`. [#97650](https://github.com/ClickHouse/ClickHouse/pull/97650) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Implement function `toDaysInMonth`: it returns the number of days in the month of the specified date. [#99227](https://github.com/ClickHouse/ClickHouse/pull/99227) ([Vitaly Baranov](https://github.com/vitlibar)).

<h4 id="263-experimental-feature">
  Experimental Feature
</h4>

* Add experimental support for WebAssembly-based user-defined functions (UDFs), allowing custom function logic to be implemented in WebAssembly and executed within ClickHouse. Special thanks to [Alexey Smirnov](https://github.com/lioshik) for contributing the Wasmtime backend support. [#88747](https://github.com/ClickHouse/ClickHouse/pull/88747) ([Vladimir Cherkasov](https://github.com/vdimir)). Incremental improvements for WASM UDF support. [#99373](https://github.com/ClickHouse/ClickHouse/pull/99373) ([Vasily Chekalkin](https://github.com/bacek)).
* Add support for external SQL dialects using `polyglot` library. [#99496](https://github.com/ClickHouse/ClickHouse/pull/99496) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `ALP` floating-point compression codec (without ALP\_rd fallback for non-compressible doubles). [#91362](https://github.com/ClickHouse/ClickHouse/pull/91362) ([Nazarii Piontko](https://github.com/nazarii-piontko)).
* Add experimental lazy type hints for `JSON` columns. When enabled via `allow_experimental_json_lazy_type_hints`, `ALTER TABLE ... MODIFY COLUMN json JSON(path TypeName)` that only adds or modifies type hints completes instantly as a metadata-only operation, without rewriting historical data. Type hints are applied at query time for old parts and materialized during INSERTs and background merges. [#97412](https://github.com/ClickHouse/ClickHouse/pull/97412) ([tanner-bruce](https://github.com/tanner-bruce)).
* Enable parallel reads from YTsaurus table engine. [#97343](https://github.com/ClickHouse/ClickHouse/pull/97343) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).

<h4 id="263-performance-improvement">
  Performance Improvement
</h4>

* Improve the performance of data lakes. In previous versions, reading from object storage didn't resize the pipeline to the number of processing threads. This gives orders of magnitude improvements (\~40x) on multi-core machines. [#99548](https://github.com/ClickHouse/ClickHouse/pull/99548) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Now, the relationship between `enable_parallel_replicas` and `automatic_parallel_replicas_mode` is as follows. A query can use parallel replicas only if `enable_parallel_replicas > 0`. Additionally, if `automatic_parallel_replicas_mode=1`, the decision whether to use parallel replicas is made during planning based on the previously collected statistics. If `automatic_parallel_replicas_mode=0`, parallel replicas will be used for all supported queries regardless of any statistics. One notable exemption is distributed insert-select with parallel replicas: in this case, queries will always be executed as if `automatic_parallel_replicas_mode=0`. [#97517](https://github.com/ClickHouse/ClickHouse/pull/97517) ([Nikita Taranov](https://github.com/nickitat)).
* Allow partition pruning when the predicate contains any comparison operator (`=`, `<`, `>`, `!=`) and the partition key is wrapped in a deterministic function chain (e.g. `PARTITION BY x` and predicates like `cityHash64(x) % 5 > 2`, `toYYYYMM(x) < 2026`, `toYYYYMM(x) = 2026`, or `toYYYYMM(x) != 2026` will all use the partition key for pruning). Closes [#28800](https://github.com/ClickHouse/ClickHouse/issues/28800). [#98432](https://github.com/ClickHouse/ClickHouse/pull/98432) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Allow read-in-order optimization and primary-key pruning when the `CAST` target type is `Nullable` and the conversion is monotonic; for example, with `PRIMARY KEY x`, ClickHouse can use read-in-order optimization for `ORDER BY x::Nullable(UInt64)` and can apply primary-key pruning for predicates such as `WHERE x::Nullable(UInt64) > 500000`. [#98482](https://github.com/ClickHouse/ClickHouse/pull/98482) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Allow index pruning and filter pushdown when an integral column is compared with a float literal; for example, predicates like `WHERE x < 10.5` can now use the primary key for pruning, and filters such as `prime < 1e9` or `number < 1e5` are now pushed down for the `primes()` and `numbers()` table functions instead of causing unbounded execution. Closes [#85167](https://github.com/ClickHouse/ClickHouse/issues/85167). [#98516](https://github.com/ClickHouse/ClickHouse/pull/98516) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Added a new SLRU cache for Parquet metadata to improve read performance by removing the need to re-download files just to read metadata. [#98140](https://github.com/ClickHouse/ClickHouse/pull/98140) ([Grant Holly](https://github.com/grantholly-clickhouse)).
* Support swapping sides of ANTI, SEMI and FULL joins based on optimizer statistics. [#97498](https://github.com/ClickHouse/ClickHouse/pull/97498) ([Hechem Selmi](https://github.com/m-selmi)).
* Optimize granules skipping for `pointInPolygon` for large polygons and fix `pointInPolygon` index analysis throwing during primary key pruning. [#91633](https://github.com/ClickHouse/ClickHouse/pull/91633) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Improve performance of `levenshteinDistance` function. [#94543](https://github.com/ClickHouse/ClickHouse/pull/94543) ([Joanna Hulboj](https://github.com/jh0x)).
* Optimize batch decimal type conversions by avoiding per-element function calls. [#95923](https://github.com/ClickHouse/ClickHouse/pull/95923) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Iceberg tables now support asynchronous metadata prefetching via `iceberg_metadata_async_prefetch_period_ms` table setting, which periodically pre-populates the metadata cache. Additionally, the `iceberg_metadata_staleness_ms` query setting allows SELECT queries to use cached metadata if it is fresher than the specified staleness, eliminating calls to the Iceberg catalog during request processing. [#96191](https://github.com/ClickHouse/ClickHouse/pull/96191) ([Arsen Muk](https://github.com/arsenmuk)).
* `S3Queue` ordered mode uses S3 ListObjectsV2 StartAfter to avoid re-listing full prefix history, reducing ListObjects calls. [#96370](https://github.com/ClickHouse/ClickHouse/pull/96370) ([Venkata  Vineel ](https://github.com/vyalamar)).
* Lower memory usage for inserts deduplication. In general the original block is needed for deduplication, but for sync insert we could omit it and save the memory for good. [#96661](https://github.com/ClickHouse/ClickHouse/pull/96661) ([Sema Checherinda](https://github.com/CheSema)).
* Use an arch-specific value for cache line size instead of a hardcoded value of 64. [#97357](https://github.com/ClickHouse/ClickHouse/pull/97357) ([Nikita Taranov](https://github.com/nickitat)).
* Slightly optimized reading from the text index dictionary, improving the overall performance of text index analysis. [#97519](https://github.com/ClickHouse/ClickHouse/pull/97519) ([Anton Popov](https://github.com/CurtizJ)).
* Speed up `LZ4` decompression of 16 byte blocks in ARM. [#97774](https://github.com/ClickHouse/ClickHouse/pull/97774) ([Raúl Marín](https://github.com/Algunenano)).
* Refactor tokenization to a new high-performance interface, replacing the old iterator-style API to support SIMD and stateful tokenizers. Part of [#90268](https://github.com/ClickHouse/ClickHouse/issues/90268). [#97871](https://github.com/ClickHouse/ClickHouse/pull/97871) ([Amos Bird](https://github.com/amosbird)).
* Improved performance of text index analysis for queries with combined conditions involving both indexed and non-indexed columns. Previously, early exit optimization during index analysis was incorrectly disabled in such cases. [#98096](https://github.com/ClickHouse/ClickHouse/pull/98096) ([Anton Popov](https://github.com/CurtizJ)).
* Improve the performance of queries with constant expressions that generate very long arrays or maps. [#98287](https://github.com/ClickHouse/ClickHouse/pull/98287) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix key condition analysis for `DateTime64` primary keys compared with integer constants, which previously resulted in no granule pruning. [#98410](https://github.com/ClickHouse/ClickHouse/pull/98410) ([Amos Bird](https://github.com/amosbird)).
* The setting `optimize_syntax_fuse_functions` is enabled by default. [#98424](https://github.com/ClickHouse/ClickHouse/pull/98424) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Optimize `avgWeighted` aggregate function by using local accumulators instead of per-row store-forwarding through aggregate state, improving performance by up to 27% for Nullable inputs. [#98793](https://github.com/ClickHouse/ClickHouse/pull/98793) ([Antonio Andelic](https://github.com/antonio2368)).
* Improves performance and reduces memory usage for parallel window functions in certain scenarios, and for `arrayFold` workloads with large arrays. This can also reduce page-fault pressure and improve stability under tight memory limits for affected queries. [#98892](https://github.com/ClickHouse/ClickHouse/pull/98892) ([filimonov](https://github.com/filimonov)).
* Improve performance of sorted merges. [#99013](https://github.com/ClickHouse/ClickHouse/pull/99013) ([Artem Zuikov](https://github.com/4ertus2)).
* Optimize `INTERSECT ALL` and `EXCEPT ALL`. [#99097](https://github.com/ClickHouse/ClickHouse/pull/99097) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Support the `read_in_order_use_virtual_row` optimization for reverse-order reads. [#99198](https://github.com/ClickHouse/ClickHouse/pull/99198) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Reduce cache contention in `RIGHT` and `FULL` JOINs by checking if JoinUsedFlags is set before writing. [#99274](https://github.com/ClickHouse/ClickHouse/pull/99274) ([Hechem Selmi](https://github.com/m-selmi)).
* Optimize `PrefetchingHelper::calcPrefetchLookAhead` by replacing floating-point math with pure integer arithmetic, improving instruction cache layout and reducing cycle overhead during aggregation loops. [#99327](https://github.com/ClickHouse/ClickHouse/pull/99327) ([Riyane El Qoqui](https://github.com/riyaneel)).
* Reduce memory consumption of Keeper by replacing `absl::flat_hash_set` with `CompactChildrenSet` for storing node children. The new container stores 0–1 children inline without heap allocation, which covers the majority of Keeper nodes. This reduces `KeeperMemNode` size from 144 to 128 bytes. [#99860](https://github.com/ClickHouse/ClickHouse/pull/99860) ([Antonio Andelic](https://github.com/antonio2368)).
* Aggregate projections are now correctly supported in views. Fixes [#32753](https://github.com/ClickHouse/ClickHouse/issues/32753). [#88798](https://github.com/ClickHouse/ClickHouse/pull/88798) ([Amos Bird](https://github.com/amosbird)).
* Support OUTER to INNER join conversion optimization with `join_use_nulls`. Closes [#90978](https://github.com/ClickHouse/ClickHouse/issues/90978). [#95968](https://github.com/ClickHouse/ClickHouse/pull/95968) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Improve subcolumns reading by correct sizes calculation before reading. It reduces memory usage and speeds up the subcolumns reading. [#96251](https://github.com/ClickHouse/ClickHouse/pull/96251) ([Pavel Kruglov](https://github.com/Avogar)).
* Make mark, uncompressed and page caches to use separate jemalloc arena to avoid memory fragmentation when short lived allocations, i.e., for queries and requests are mixed with longer lived allocations for caches. [#96812](https://github.com/ClickHouse/ClickHouse/pull/96812) ([Seva Potapov](https://github.com/seva-potapov)). [#98812](https://github.com/ClickHouse/ClickHouse/pull/98812). [#99021](https://github.com/ClickHouse/ClickHouse/pull/99021)
* Tables with `DELETE TTL` rules can now use the vertical merge algorithm. [#97332](https://github.com/ClickHouse/ClickHouse/pull/97332) ([murphy-4o](https://github.com/murphy-4o)).
* Apply data skipping indexes during distributed index analysis. [#97767](https://github.com/ClickHouse/ClickHouse/pull/97767) ([Azat Khuzhin](https://github.com/azat)).
* Marks of secondary indexes are now prewarmed when the `prewarm_mark_cache` setting is enabled (loaded into the index mark cache during data part fetches and table startup). [#97772](https://github.com/ClickHouse/ClickHouse/pull/97772) ([Anton Popov](https://github.com/CurtizJ)).
* Reduced locking during access control. [#97894](https://github.com/ClickHouse/ClickHouse/pull/97894) ([Nikita Taranov](https://github.com/nickitat)).
* When apply\_row\_policy\_after\_final or apply\_prewhere\_after\_final is enabled, compound AND conditions in row policies and PREWHERE are now decomposed to extract sorting-key atoms for primary key index analysis. Previously, if a deferred filter contained a mix of sorting-key and non-sorting-key predicates (e.g. x > 1 AND y != 'foo'), the entire expression was excluded from index analysis. Now sorting-key atoms (like x > 1) are extracted and used for granule pruning, even from nested AND expressions. [#98513](https://github.com/ClickHouse/ClickHouse/pull/98513) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Reduce lock contention in MergeTreeBackgroundExecutor by making task resources release without acquiring the lock. Closes [#93620](https://github.com/ClickHouse/ClickHouse/issues/93620). [#98604](https://github.com/ClickHouse/ClickHouse/pull/98604) ([Dmitry Novik](https://github.com/novikd)).
* Fix excessive memory usage (\~514 MiB) during format auto-detection when reading non-Arrow data (e.g. JSON from `url` or `file` without explicit format), caused by the ArrowStream reader misinterpreting the first bytes as a huge metadata length. [#98893](https://github.com/ClickHouse/ClickHouse/pull/98893) ([Konstantin Bogdanov](https://github.com/thevar1able)).

<h4 id="263-improvement">
  Improvement
</h4>

* Makes it possible to parse GeoParquet files that contain different Geo type in the same column. [#97851](https://github.com/ClickHouse/ClickHouse/pull/97851) ([Mark Needham](https://github.com/mneedham)).
* Introduce `tokensForLikePattern` SQL function that tokenizes LIKE patterns while respecting wildcard semantics: `%` and `_` are treated as wildcards, escaped wildcards (`\%`, `\_`) are treated as literals, and tokens adjacent to unescaped wildcards are discarded. [#97872](https://github.com/ClickHouse/ClickHouse/pull/97872) ([Amos Bird](https://github.com/amosbird)).
* Add a `{_schema_hash}` placeholder for the S3 table engine that inserts a hash of the table's column definitions into the S3 path. [#98265](https://github.com/ClickHouse/ClickHouse/pull/98265) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* `SymbolIndex`, `addressToSymbol`, `system.symbols`, and `buildId` now work on macOS by parsing Mach-O symbol tables. [#99014](https://github.com/ClickHouse/ClickHouse/pull/99014) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `system.stack_trace` table now works on macOS, allowing introspection of all server thread stack traces. [#98982](https://github.com/ClickHouse/ClickHouse/pull/98982) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add per-server LDAP config option `<follow_referrals>` (default `false`) to control whether the LDAP client follows referrals. Disabling referral chasing avoids timeouts and hangs when searching from an Active Directory domain-root base DN. Referral-related log messages are moved from `warn` to `trace`. [#96765](https://github.com/ClickHouse/ClickHouse/pull/96765) ([paf91](https://github.com/paf91)).
* We now track any data skipping indices that were used during query execution in the query\_log table in a new column named `skip_indices`. Fixes [#78676](https://github.com/ClickHouse/ClickHouse/issues/78676). Original author @pheepa. [#87862](https://github.com/ClickHouse/ClickHouse/pull/87862) ([Grant Holly](https://github.com/grantholly-clickhouse)).
* ACCESS\_DENIED hints no longer reveal column names unless the user can show all required columns; database/table names remain visible in the hint. [#91067](https://github.com/ClickHouse/ClickHouse/pull/91067) ([filimonov](https://github.com/filimonov)).
* Add a dedicated cleanup thread for MergeTree to prevent cleanup delays under heavy merge load. This resolves [#86181](https://github.com/ClickHouse/ClickHouse/issues/86181). [#91574](https://github.com/ClickHouse/ClickHouse/pull/91574) ([Amos Bird](https://github.com/amosbird)).
* Reload cluster config if IPs of local server’s hostname changed, instead of IPs of any host. Fixes [#81215](https://github.com/ClickHouse/ClickHouse/issues/81215), [#70156](https://github.com/ClickHouse/ClickHouse/issues/70156) and [#65268](https://github.com/ClickHouse/ClickHouse/issues/65268). [#93726](https://github.com/ClickHouse/ClickHouse/pull/93726) ([Zhigao Hong](https://github.com/zghong)).
* Allow optimize\_aggregators\_of\_group\_by\_keys to correctly optimize aggregate functions in GROUPING SETS queries. [#93935](https://github.com/ClickHouse/ClickHouse/pull/93935) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Keeper-bench: report errors in metrics and generate json metrics file for --input-request-log mode. [#95748](https://github.com/ClickHouse/ClickHouse/pull/95748) ([Mohammad Lareb Zafar](https://github.com/zlareb1)).
* Add new clause ROLE to CREATE USER. [#97074](https://github.com/ClickHouse/ClickHouse/pull/97074) ([Vitaly Baranov](https://github.com/vitlibar)).
* You can now set internal\_replication settings for a cluster created by the Replicated database. [#97228](https://github.com/ClickHouse/ClickHouse/pull/97228) ([Pervakov Grigorii](https://github.com/GrigoryPervakov)).
* New setting `allow_nullable_tuple_in_extracted_subcolumns` controls whether extracted `Tuple(...)` subcolumns from `Tuple`, `Variant`, `Dynamic` and `JSON` are returned as `Nullable(Tuple(...))` (`NULL` for missing rows) or as `Tuple(...)` (default tuple values for missing rows). Disabled by default, this setting can only be changed by restarting the server. [#97299](https://github.com/ClickHouse/ClickHouse/pull/97299) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Add information about deferred filters as a separate item to EXPLAIN query output (when using Row Policies/PREWHERE with FINAL). Related: [#91065](https://github.com/ClickHouse/ClickHouse/pull/91065). [#97374](https://github.com/ClickHouse/ClickHouse/pull/97374) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Enable `type_json_allow_duplicated_key_with_literal_and_nested_object` by default. It allows to avoid errors about duplicated keys during parsing of JSONs like `{"a" : 42, "a" : {"b" : 42}}` that can be formatted by ClickHouse from original JSON data `{"a" : 42, "a.b" : 42}`. [#97423](https://github.com/ClickHouse/ClickHouse/pull/97423) ([Pavel Kruglov](https://github.com/Avogar)).
* Keeper improvement: `find_super_nodes` is a very useful command for debugging unexpected growth in the node count in Keeper. Unfortunately, if there are multiple super nodes, it's almost impossible to find more than one, because the command gets stuck forever traversing the children of the first encountered super node. This PR forbids traversing the children of super nodes. [#97819](https://github.com/ClickHouse/ClickHouse/pull/97819) ([pufit](https://github.com/pufit)).
* Initial completion support for `clickhouse-keeper-client`. [#97828](https://github.com/ClickHouse/ClickHouse/pull/97828) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Flush async logging buffers in case of crash. [#97836](https://github.com/ClickHouse/ClickHouse/pull/97836) ([Azat Khuzhin](https://github.com/azat)).
* Enable the impersonate feature by default (see [EXECUTE AS target\_user](https://clickhouse.com/docs/sql-reference/statements/execute_as)). [#97870](https://github.com/ClickHouse/ClickHouse/pull/97870) ([Vitaly Baranov](https://github.com/vitlibar)).
* Improve canceling queries with SQLite table engine by KILL QUERY and cancel query (Ctrl+C) in clickhouse-client. [#97944](https://github.com/ClickHouse/ClickHouse/pull/97944) ([Roman Vasin](https://github.com/rvasin)).
* Add server setting `jemalloc_profiler_sampling_rate` to control jemalloc's `lg_prof_sample` and expose it as `jemalloc.prof.lg_sample` asynchronous metric. [#97945](https://github.com/ClickHouse/ClickHouse/pull/97945) ([Antonio Andelic](https://github.com/antonio2368)).
* Support weights in concurrent bounded queue implementation. [#97962](https://github.com/ClickHouse/ClickHouse/pull/97962) ([Daniil Ivanik](https://github.com/divanik)).
* Add sslmode to the allowed keys for PostgreSQL dictionary sources. Previously, sslmode was not in the dictionary\_allowed\_keys allowlist in PostgreSQLDictionarySource.cpp, making it impossible to configure SSL mode for PostgreSQL dictionary connections. This prevented dictionaries from connecting to PostgreSQL servers that require SSL (e.g., AWS RDS, which enforces SSL by default), as the connection would fail TLS negotiation and the server would reject the unencrypted fallback. [#98014](https://github.com/ClickHouse/ClickHouse/pull/98014) ([mcalfin](https://github.com/mcalfin)).
* Show a clear "no such file" error when passing a non-existent file path to `clickhouse` or `clickhouse-local`, instead of a confusing generic message. [#98048](https://github.com/ClickHouse/ClickHouse/pull/98048) ([Raúl Marín](https://github.com/Algunenano)).
* Text indexes can now be built on top of `Nullable([Fixed]String)` and `Array(Nullable([Fixed]String))` columns. [#98118](https://github.com/ClickHouse/ClickHouse/pull/98118) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Avoid dropping named collections that are dependencies of dictionary sources. [#98127](https://github.com/ClickHouse/ClickHouse/pull/98127) ([Pablo Marcos](https://github.com/pamarcos)).
* Enable `grace_hash` join algorithm for queries with totals. [#98144](https://github.com/ClickHouse/ClickHouse/pull/98144) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Cancel background merges early in DROP DATABASE for ordinary shared merge tree. [#98161](https://github.com/ClickHouse/ClickHouse/pull/98161) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Improve canceling queries with MongoDB and MySQL by KILL QUERY and cancel query (Ctrl+C) in clickhouse-client. [#98187](https://github.com/ClickHouse/ClickHouse/pull/98187) ([Roman Vasin](https://github.com/rvasin)).
* Remove NetlinkMetricsProvider and use procfs exclusively for per-thread taskstats metric collection. Netlink-based collection is problematic in containerized environments and has worse tail latency under contention. [#98229](https://github.com/ClickHouse/ClickHouse/pull/98229) ([Amos Bird](https://github.com/amosbird)).
* Refactor Iceberg manifest file handling to fix issues with manifest file caching. [#98231](https://github.com/ClickHouse/ClickHouse/pull/98231) ([Daniil Ivanik](https://github.com/divanik)).
* Now we take into account cases where the sorting key of the table can be an expression like `toDate(time)`, and can make the decisions about not-deferring expressions like this if they are part of filters. [#98237](https://github.com/ClickHouse/ClickHouse/pull/98237) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Add a new `MaxAllocatedEphemeralLockSequentialNumber` metric for the maximum sequential number allocated for ephemeral lock znodes in ZooKeeper. [#98243](https://github.com/ClickHouse/ClickHouse/pull/98243) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Update clickstack to version 2.20.0. [#98252](https://github.com/ClickHouse/ClickHouse/pull/98252) ([Aaron Knudtson](https://github.com/knudtty)).
* Added a new profile event `KeeperRequestTotalWithSubrequests` that counts each subrequest within a multi-request individually, providing better visibility into the actual Keeper workload. The existing `KeeperRequestTotal` event continues to count each multi-request as a single request. [#98348](https://github.com/ClickHouse/ClickHouse/pull/98348) ([Antonio Andelic](https://github.com/antonio2368)).
* `SYSTEM RELOAD DICTIONARIES` now reloads dictionaries in topological order so that dictionaries sourcing from other dictionaries see fresh data after reload. [#98356](https://github.com/ClickHouse/ClickHouse/pull/98356) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Restart the statistics cache after changing the MergeTree setting. [#98520](https://github.com/ClickHouse/ClickHouse/pull/98520) ([Han Fei](https://github.com/hanfei1991)).
* Only "alive" replicas (that are connectable) participate in distributed index analysis. [#98521](https://github.com/ClickHouse/ClickHouse/pull/98521) ([Azat Khuzhin](https://github.com/azat)).
* Add a setting `access_control_improvements.disallow_config_defined_profiles_for_sql_defined_users` (disabled/allowed by default) that disallows using config-defined settings profiles (except for the `default` profile) for SQL-defined users. [#98662](https://github.com/ClickHouse/ClickHouse/pull/98662) ([Alexander Tokmakov](https://github.com/tavplubix)).
* Cap the number of nodes used in the automatic parallel replicas heuristic to the actual number of nodes in the cluster (instead of only the `max_parallel_replicas` setting). [#98668](https://github.com/ClickHouse/ClickHouse/pull/98668) ([Nikita Taranov](https://github.com/nickitat)).
* Implement hedged requests and asynchronous reading for distributed index analysis. [#98724](https://github.com/ClickHouse/ClickHouse/pull/98724) ([Azat Khuzhin](https://github.com/azat)).
* Deserialization of binary `AggregateFunction` states now requires consuming the full input. If extra redundant trailing bytes are present, ClickHouse throws an exception instead of accepting malformed state data. [#98786](https://github.com/ClickHouse/ClickHouse/pull/98786) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Make TRUNCATE DATABASE respond to query cancellation. [#98828](https://github.com/ClickHouse/ClickHouse/pull/98828) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Improve `keeper-bench` with request pipelining, warmup period, per-operation stats, reproducible seeds, and better error handling. [#98906](https://github.com/ClickHouse/ClickHouse/pull/98906) ([Antonio Andelic](https://github.com/antonio2368)).
* Support SAMPLE clause in distributed index analysis. [#98931](https://github.com/ClickHouse/ClickHouse/pull/98931) ([Azat Khuzhin](https://github.com/azat)).
* Show chart title in dashboard even when query returns empty result or encounters an error. [#98975](https://github.com/ClickHouse/ClickHouse/pull/98975) ([Yash ](https://github.com/Onyx2406)).
* Analyzer error messages no longer dump all columns of a table (which could produce 150KB+ exceptions). Column lists are now capped at 10 entries. [#99002](https://github.com/ClickHouse/ClickHouse/pull/99002) ([Yash ](https://github.com/Onyx2406)).
* Properly return column stats from sub-queries with joins so that parent query can use them for join reordering. [#99096](https://github.com/ClickHouse/ClickHouse/pull/99096) ([Alexander Gololobov](https://github.com/davenger)).
* Mark ZooKeeper session as expired immediately when finalization starts, instead of waiting for the send thread to exit. This allows other threads to establish a new session without delay. [#99102](https://github.com/ClickHouse/ClickHouse/pull/99102) ([Raúl Marín](https://github.com/Algunenano)).
* Use more math functions from LLVM-libc: `exp`, `exp2`, `expm1`, `fabs`, `fabsl`, `floor`, `fmodl`, `log`, `log2`, `logf`, `pow`, `scalbn`, `scalbnl`, `copysignl`, `nan`, `nanf`, `nanl`, and the `explogxf` shared constants. [#99118](https://github.com/ClickHouse/ClickHouse/pull/99118) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Reduce memory usage and fix potential duplicate output in `system.jemalloc_profile_text` collapsed format. [#99121](https://github.com/ClickHouse/ClickHouse/pull/99121) ([Antonio Andelic](https://github.com/antonio2368)).
* Add `is_subrequest` column to `system.aggregated_zookeeper_log` to separate standalone requests from sub-requests inside Multi/MultiRead requests. Previously, sub-requests were aggregated into the same buckets as standalone requests, and since each sub-operation was logged with the total multi-request duration, the average latency became misleading. Sub-requests now have zero latency. [#99169](https://github.com/ClickHouse/ClickHouse/pull/99169) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Allow `ALTER TABLE MODIFY COLUMN x TTL ...` command without specifying column type. [#99208](https://github.com/ClickHouse/ClickHouse/pull/99208) ([Nikolay Degterinsky](https://github.com/evillique)).
* Skip stale Keeper requests for sessions that have already disconnected, avoiding unnecessary Raft round-trips. The number of tracked finished sessions is capped by the `max_finished_sessions_cache_size` coordination setting. [#99246](https://github.com/ClickHouse/ClickHouse/pull/99246) ([Antonio Andelic](https://github.com/antonio2368)).
* Support text index built on `mapValues(map)` with `IN` operator. [#99286](https://github.com/ClickHouse/ClickHouse/pull/99286) ([Anton Popov](https://github.com/CurtizJ)).
* Shell-like completion support in clickhouse keeper-client (handle completions of arguments in quotes, i.e. `'foo ba'`, handle escaped arguments, i.e. `foo\ ba`, make `ls` print quoted nodes, if they have whitespaces). [#99312](https://github.com/ClickHouse/ClickHouse/pull/99312) ([Azat Khuzhin](https://github.com/azat)).
* Prevent Keeper `mntr` command from getting stuck because of lock contention. [#99472](https://github.com/ClickHouse/ClickHouse/pull/99472) ([Antonio Andelic](https://github.com/antonio2368)).
* Reduce lock contention in Keeper dispatcher by invoking callbacks and dispatching read requests outside mutex scope, and add profiled lock guards for observability. [#99751](https://github.com/ClickHouse/ClickHouse/pull/99751) ([Antonio Andelic](https://github.com/antonio2368)).
* Tolerate missing padding at the end of the last block of parquet files. [#99857](https://github.com/ClickHouse/ClickHouse/pull/99857) ([Seva Potapov](https://github.com/seva-potapov)).

<h4 id="263-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Fixes how an Alias table target is saved as a DDL dependency when not fully qualified: it's now saved with the Alias table database instead of the session database. [#95175](https://github.com/ClickHouse/ClickHouse/pull/95175) ([Enric Calabuig](https://github.com/eclbg)).
* Fix wrong result or exception during reading subcolumns of ALIAS columns. [#95408](https://github.com/ClickHouse/ClickHouse/pull/95408) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix missing column when non-standard identifier alias in JOIN with old analyzer. Fixes [#25594](https://github.com/ClickHouse/ClickHouse/issues/25594), [#47288](https://github.com/ClickHouse/ClickHouse/issues/47288) and [#53263](https://github.com/ClickHouse/ClickHouse/issues/53263). [#95679](https://github.com/ClickHouse/ClickHouse/pull/95679) ([Zhigao Hong](https://github.com/zghong)).
* Fixes a crash in Kusto dialect functions `bin()`, `bin_at()`, `extract()`, and `indexof()` when empty arguments are provided. [#95736](https://github.com/ClickHouse/ClickHouse/pull/95736) ([NeedmeFordev](https://github.com/spider-yamet)).
* Forbids mounting local\_object\_storage (which is used by datalakes above local filesystem and maybe by LocalDisk) anywhere apart from user\_files\_path in clickhouse-client. [#96201](https://github.com/ClickHouse/ClickHouse/pull/96201) ([Daniil Ivanik](https://github.com/divanik)).
* In `DeltaLake` table engine fix logical race on snapshot version change, remove redundant heavy snapshot reloads. [#96226](https://github.com/ClickHouse/ClickHouse/pull/96226) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix logical error on attaching a part in MergeTree if there were several chained renames between detaching and attaching. [#96351](https://github.com/ClickHouse/ClickHouse/pull/96351) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a bug where explicit settings sent alongside `compatibility` in the same request could be silently ignored when their value matched the server default. [#97078](https://github.com/ClickHouse/ClickHouse/pull/97078) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix the client reporting `NETWORK_ERROR` instead of the actual parsing error (with the correct row number) when an INSERT with parallel parsing encounters invalid data. [#97339](https://github.com/ClickHouse/ClickHouse/pull/97339) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `sumCount` aggregate function not being able to read older serialized states after introduction of `Nullable(Tuple)`. Closes [#97370](https://github.com/ClickHouse/ClickHouse/issues/97370). [#97502](https://github.com/ClickHouse/ClickHouse/pull/97502) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix exception in tuple comparison involving `Nothing` type elements (e.g., comparing with `NULL` tuple elements) when used with `GROUPING SETS` and `ORDER BY`. [#97509](https://github.com/ClickHouse/ClickHouse/pull/97509) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix non-deterministic `uncompressed_hash` computation for Compact MergeTree parts when multiple compression codecs are used, which could cause incorrect deduplication behavior. [#97522](https://github.com/ClickHouse/ClickHouse/pull/97522) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error about missing stream during INSERT SELECT with JSON and buckets in shared data. Closes [#97331](https://github.com/ClickHouse/ClickHouse/issues/97331). [#97523](https://github.com/ClickHouse/ClickHouse/pull/97523) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `MEMORY_LIMIT_EXCEEDED` exceptions being incorrectly reported as `CORRUPTED_DATA` during SummingMergeTree and CoalescingMergeTree merges. [#97537](https://github.com/ClickHouse/ClickHouse/pull/97537) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix "Context has expired" exception for correlated subqueries containing table functions like `url()`. [#97544](https://github.com/ClickHouse/ClickHouse/pull/97544) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exceptions and incorrect behavior in `optimize_syntax_fuse_functions` with aggregate projections, Date types, and column name preservation. [#97545](https://github.com/ClickHouse/ClickHouse/pull/97545) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove incorrect `replaceRegexpOne` to `extract` query rewrite that produced wrong results when the regexp didn't match; also fix exception when `replaceRegexpOne` is used with `GROUP BY ... WITH CUBE` and `group_by_use_nulls=1`. [#97546](https://github.com/ClickHouse/ClickHouse/pull/97546) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `DROP DATABASE` with `database_atomic_wait_for_drop_and_detach_synchronously` hanging indefinitely when the query is killed. [#97586](https://github.com/ClickHouse/ClickHouse/pull/97586) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `KILL QUERY` not being able to terminate queries stuck in `WITH FILL` generation, dictionary loading via `dictGet`, or `ALTER DELETE` with `mutations_sync=1` on `ReplicatedMergeTree`. [#97589](https://github.com/ClickHouse/ClickHouse/pull/97589) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `loop` table function was calling `inner_storage->read()` directly, bypassing the interpreter layer where row policies, column-level grants, and other security checks are applied. This allowed a user restricted by row policies to read all rows via `loop(table)` even when a direct SELECT returned zero rows. [#97682](https://github.com/ClickHouse/ClickHouse/pull/97682) ([pufit](https://github.com/pufit)).
* Fixes incorrect partition pruning in cases of using pre-epoch DateTime64 with `toDate()` function. [#97746](https://github.com/ClickHouse/ClickHouse/pull/97746) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* After this patch, `hasPartitionId` will return false if another partition with a higher partition ID exists in the data part set. [#97748](https://github.com/ClickHouse/ClickHouse/pull/97748) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix possible crashes during reading of empty granules in advanced shared data in JSON. Closes [#97563](https://github.com/ClickHouse/ClickHouse/issues/97563). [#97778](https://github.com/ClickHouse/ClickHouse/pull/97778) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `Cannot schedule a file` `LOGICAL_ERROR` on `INSERT` into `Distributed` due to race between `DROP` and `INSERT`. [#97822](https://github.com/ClickHouse/ClickHouse/pull/97822) ([Azat Khuzhin](https://github.com/azat)).
* Fixed ClickHouse server crash/assert in call to `mapContainsKey/mapContainsKeyLike` with `tokenbf_v1` skip index. [#97826](https://github.com/ClickHouse/ClickHouse/pull/97826) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Fix LOGICAL\_ERROR exceptions caused by `LowCardinality` inside compound types (`Variant`, `Dynamic`, `Tuple`) in `concatWithSeparator`, `format`, `IN` subqueries, `GLOBAL IN`, and joins with runtime filters. [#97831](https://github.com/ClickHouse/ClickHouse/pull/97831) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `LOGICAL_ERROR` exception `Chunk info was not set for chunk in MergingAggregatedTransform` when using `ARRAY JOIN` with `merge()` table function over multiple Distributed tables combined with `GROUP BY`. [#97838](https://github.com/ClickHouse/ClickHouse/pull/97838) ([Raúl Marín](https://github.com/Algunenano)).
* Fix server crash (`std::terminate`) caused by an uncaught exception in the HTTP connection pool destructor when the connection group hard limit is reached under high concurrency. The exception `HTTP_CONNECTION_LIMIT_REACHED` could escape `~PooledConnection` when recycling a connection back to the pool, leading to `SIGABRT`. [#97850](https://github.com/ClickHouse/ClickHouse/pull/97850) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix incorrect result when `grace_hash` algorithm is used with non-equi joins and left block cannot be processed completely because of the size constraints on the join result. [#97866](https://github.com/ClickHouse/ClickHouse/pull/97866) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix performance inefficiency in DeltaLake metadata scanning introduced in [#96686](https://github.com/ClickHouse/ClickHouse/pull/96686). [#97880](https://github.com/ClickHouse/ClickHouse/pull/97880) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix data race in ZooKeeper client between sendThread and receiveThread. [#97887](https://github.com/ClickHouse/ClickHouse/pull/97887) ([Pablo Marcos](https://github.com/pamarcos)).
* Fixes a bug where it was not possible to use CTE with distributed insert selects. Continuation of [https://github.com/ClickHouse/ClickHouse/pull/87789](https://github.com/ClickHouse/ClickHouse/pull/87789). Closes [#95837](https://github.com/ClickHouse/ClickHouse/issues/95837). [#97889](https://github.com/ClickHouse/ClickHouse/pull/97889) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix exception from `CachedOnDiskReadBufferFromFile::readBigAt`. Closes [#97325](https://github.com/ClickHouse/ClickHouse/issues/97325). [#97890](https://github.com/ClickHouse/ClickHouse/pull/97890) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix `LOGICAL_ERROR` exception in `Alias` engine with materialized columns due to column mismatch. Closes [#97907](https://github.com/ClickHouse/ClickHouse/issues/97907). [#97921](https://github.com/ClickHouse/ClickHouse/pull/97921) ([Kai Zhu](https://github.com/nauu)).
* Fix Keeper data loss after restart when using Azure Blob Storage with `s3_plain` metadata for log storage. [#97987](https://github.com/ClickHouse/ClickHouse/pull/97987) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix JIT miscompilation of `sign` function for integer types wider than `Int8` — values outside the -128..127 range could produce incorrect sign. [#98012](https://github.com/ClickHouse/ClickHouse/pull/98012) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `DUPLICATE_COLUMN` exception and silent NULLs when reading Delta Lake tables that use column mapping "name" mode with struct fields whose names contain dots (e.g. ``STRUCT<`a.foo`: STRING, `b.foo`: STRING>``). [#98013](https://github.com/ClickHouse/ClickHouse/pull/98013) ([Caio Ishizaka Costa](https://github.com/ch-caioishizaka)).
* Fix mutation after lightweight update and secondary indices. [#98044](https://github.com/ClickHouse/ClickHouse/pull/98044) ([Raúl Marín](https://github.com/Algunenano)).
* Fix incorrect result of FINAL queries when mixing primary key and non primary key skip indexes. [#98097](https://github.com/ClickHouse/ClickHouse/pull/98097) ([Raúl Marín](https://github.com/Algunenano)).
* Enforce READ ON FILE checks for scalar file() and DESCRIBE TABLE file(). [#98115](https://github.com/ClickHouse/ClickHouse/pull/98115) ([Nikolay Degterinsky](https://github.com/evillique)).
* Fixes a crash where querying files with a glob pattern (e.g., `file('dir/**', 'LineAsString')`) would throw an unhandled filesystem exception (`STD_EXCEPTION`) if the directory contained a dangling symlink. Dangling symlinks are now silently skipped, and the query returns results from all valid files. [#98143](https://github.com/ClickHouse/ClickHouse/pull/98143) ([Mark Andreev](https://github.com/mrk-andreev)).
* Fix segfault in query plan optimization when converting outer join to inner join with `arrayJoin` in filter expression. [#98147](https://github.com/ClickHouse/ClickHouse/pull/98147) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `ProtobufList` format not working with Kafka engine due to read state not being reset between messages. [#98151](https://github.com/ClickHouse/ClickHouse/pull/98151) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error with analyzer\_compatibility\_join\_using\_top\_level\_identifier and ARRAY JOIN, closes [#98164](https://github.com/ClickHouse/ClickHouse/issues/98164). [#98179](https://github.com/ClickHouse/ClickHouse/pull/98179) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Set `Watch` component for watch responses in `aggregated_zookeeper_log` instead of leaving it empty. [#98202](https://github.com/ClickHouse/ClickHouse/pull/98202) ([Antonio Andelic](https://github.com/antonio2368)).
* If the partition key columns are not covered by the sorting key, then partition pruning could incorrectly skip partitions containing rows that should "win" during FINAL deduplication. [#98242](https://github.com/ClickHouse/ClickHouse/pull/98242) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix logical error "Bad cast from type DB::ColumnConst to DB::ColumnArray" in `kql_array_sort_asc`/`kql_array_sort_desc` when called with constant array arguments. [#98251](https://github.com/ClickHouse/ClickHouse/pull/98251) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix out-of-bounds access in `ColumnConst::getExtremes` that could cause a crash when `extremes = 1` is enabled. [#98263](https://github.com/ClickHouse/ClickHouse/pull/98263) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix potential deadlock when two concurrent `MOVE PARTITION` operations work with the same pair of tables in opposite directions. [#98264](https://github.com/ClickHouse/ClickHouse/pull/98264) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* HTTP server now returns an error message in the response body for 400 Bad Request responses caused by malformed headers, instead of an empty body. [#98268](https://github.com/ClickHouse/ClickHouse/pull/98268) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix wrong results with distributed index analysis (experimental feature) and query condition cache. [#98269](https://github.com/ClickHouse/ClickHouse/pull/98269) ([Azat Khuzhin](https://github.com/azat)).
* Fixed LOGICAL\_ERROR exception "Invalid binary search result in `MergeTreeSetIndex`" triggered by `toDate` conversion on key columns with data crossing the 65535 boundary. [#98276](https://github.com/ClickHouse/ClickHouse/pull/98276) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception when a RIGHT JOIN wrapped in a CROSS JOIN is swapped by the `query_plan_join_swap_table` optimization in the legacy join step code path. [#98279](https://github.com/ClickHouse/ClickHouse/pull/98279) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Validate corrupted data during `DDSketch` deserialization to prevent segfaults, exceptions, infinite loops, and OOM when reading corrupted `quantilesDD` aggregate function states. [#98284](https://github.com/ClickHouse/ClickHouse/pull/98284) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR "Trying to execute PLACEHOLDER action" when correlated columns from outer queries are referenced inside lambda functions such as `arrayMap`. [#98285](https://github.com/ClickHouse/ClickHouse/pull/98285) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception in `caseWithExpression` when `CASE` expression involves `materialize(NULL)` or other `Nullable(Nothing)` arguments. [#98290](https://github.com/ClickHouse/ClickHouse/pull/98290) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix bad cast exception when filtering `_table` virtual column in `merge` table function. [#98291](https://github.com/ClickHouse/ClickHouse/pull/98291) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix sporadic deduplication failure where re-inserts were incorrectly deduplicated due to inconsistent cleanup ordering between `blocks/` and `deduplication_hashes/` ZooKeeper directories. [#98293](https://github.com/ClickHouse/ClickHouse/pull/98293) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when `ORDER BY ... WITH FILL` is used together with `LIMIT BY`. [#98361](https://github.com/ClickHouse/ClickHouse/pull/98361) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix silent data corruption when inserting a Parquet/Arrow `Date` column into an `Enum` column — now properly rejects the incompatible type conversion instead of storing invalid enum values. [#98364](https://github.com/ClickHouse/ClickHouse/pull/98364) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when reading an Arrow file with `Array` column into a table with `Nested` column. [#98365](https://github.com/ClickHouse/ClickHouse/pull/98365) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `MATERIALIZE INDEX` and `MATERIALIZE PROJECTION` mutations getting stuck when the index or projection is dropped before the mutation finishes. [#98369](https://github.com/ClickHouse/ClickHouse/pull/98369) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when reading from `Nullable(Tuple(...))` where a Tuple element name collides with the Nullable `null` subcolumn. [#98372](https://github.com/ClickHouse/ClickHouse/pull/98372) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "Column ... query tree node does not have valid source node" when joining a `Merge` table (wrapping a `Distributed` table) with another table. [#98376](https://github.com/ClickHouse/ClickHouse/pull/98376) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect Parquet `Bool` to `FixedString` conversion in native V3 reader that produced raw bytes instead of string representation. [#98378](https://github.com/ClickHouse/ClickHouse/pull/98378) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `tryGetColumnDescription` to filter subcolumns by parent column kind, consistent with other column lookup methods. [#98391](https://github.com/ClickHouse/ClickHouse/pull/98391) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Accept base64 credentials without padding in HTTP Basic Auth. Some HTTP clients omit trailing `=` padding in the `Authorization: Basic` header, which previously caused authentication failures. [#98392](https://github.com/ClickHouse/ClickHouse/pull/98392) ([Amos Bird](https://github.com/amosbird)).
* Fix incorrect partition pruning results after merging parts with `Nullable` partition key columns, caused by wrong min-max index bounds. [#98405](https://github.com/ClickHouse/ClickHouse/pull/98405) ([Amos Bird](https://github.com/amosbird)).
* Fix rare exception in the pipeline executor, that could manifest as a `Received signal 6` (only in debug builds), when pipeline expansion races with query cancellation. [#98428](https://github.com/ClickHouse/ClickHouse/pull/98428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "Column identifier is already registered" when `count_distinct_optimization` is used with a `QUALIFY` clause. [#98433](https://github.com/ClickHouse/ClickHouse/pull/98433) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "cannot be inside Nullable type" when using `IN`/`NOT IN` with `LowCardinality` column arguments (e.g. `a NOT IN (b)` where `a` is `LowCardinality(String)`). [#98443](https://github.com/ClickHouse/ClickHouse/pull/98443) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Pipeline stuck" exception in `full_sorting_merge` joins caused by a deadlock in `PingPongProcessor` when the `FilterBySetOnTheFly` optimization created a circular dependency with `MergeJoinTransform`. [#98454](https://github.com/ClickHouse/ClickHouse/pull/98454) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception "Projection cannot increase the number of rows in a block" when merging parts with TTL that deletes all rows and an aggregate projection with a constant `GROUP BY` key. [#98458](https://github.com/ClickHouse/ClickHouse/pull/98458) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception when `CROSS JOIN` is used together with `INNER JOIN USING`. [#98459](https://github.com/ClickHouse/ClickHouse/pull/98459) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix null pointer dereference in `dictGetOrDefault` when the key argument is `Nullable`. [#98460](https://github.com/ClickHouse/ClickHouse/pull/98460) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception in `DISTINCT` queries when using aggregate projections and `materialize` causes `LowCardinality` type differences between the query and the projection. [#98462](https://github.com/ClickHouse/ClickHouse/pull/98462) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR exception when `arrayJoin` is used in a filter expression with OUTER JOIN and `join_use_nulls` enabled. [#98464](https://github.com/ClickHouse/ClickHouse/pull/98464) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception "Replica decided to read in WithOrder mode, not in ReverseOrder" when using parallel replicas with `optimize_aggregation_in_order`. [#98467](https://github.com/ClickHouse/ClickHouse/pull/98467) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed ClickHouse Keeper disconnecting Java ZooKeeper clients after `addWatch` request. The Java client expects a 4-byte `ErrorResponse` body in the `addWatch` response, but Keeper was sending an empty body, causing `EOFException` and session disconnect. This broke Apache Curator's `CuratorCache` and any Java application using persistent watches. Fixes [#98079](https://github.com/ClickHouse/ClickHouse/issues/98079). [#98499](https://github.com/ClickHouse/ClickHouse/pull/98499) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix `zk_followers` and `zk_synced_followers` Keeper metrics not decreasing when a follower goes down. Add new `zk_learners` and `zk_synced_non_voting_followers` metrics to the `mntr` four-letter-word command. Fixes [#54173](https://github.com/ClickHouse/ClickHouse/issues/54173). [#98504](https://github.com/ClickHouse/ClickHouse/pull/98504) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix a LOGICAL\_ERROR exception in `renameAndCommitEmptyParts` that could occur when `TRUNCATE TABLE` runs concurrently with `OPTIMIZE TABLE` using MergeTree transactions. [#98508](https://github.com/ClickHouse/ClickHouse/pull/98508) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed Keeper's secure raft port ignoring `cipherList` and `dhParamsFile` from `openSSL` configuration, always using defaults instead of user-specified values. Close [#51188](https://github.com/ClickHouse/ClickHouse/issues/51188). [#98509](https://github.com/ClickHouse/ClickHouse/pull/98509) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed misleading Keeper log messages like "Receiving request for session X took 9963 ms" where the reported time was actually spent waiting idle in `poll()` between heartbeats, not performing the operation itself. Fixes [#79026](https://github.com/ClickHouse/ClickHouse/issues/79026). [#98510](https://github.com/ClickHouse/ClickHouse/pull/98510) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix unexpected result with read\_in\_order\_use\_virtual\_row and monotonic functions, close [#97837](https://github.com/ClickHouse/ClickHouse/issues/97837). [#98514](https://github.com/ClickHouse/ClickHouse/pull/98514) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix `LOGICAL_ERROR: Not-ready Set is passed as the second argument for function 'in'` when using `PREWHERE` with `IN` subquery on MergeTree tables. [#98522](https://github.com/ClickHouse/ClickHouse/pull/98522) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix Keeper TCP connections preventing graceful server shutdown by not responding to shutdown signal. [#98525](https://github.com/ClickHouse/ClickHouse/pull/98525) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "Sorting column wasn't found in the ActionsDAG's outputs" when `query_plan_convert_join_to_in` is enabled with `query_plan_merge_expressions = 0`. [#98526](https://github.com/ClickHouse/ClickHouse/pull/98526) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix MongoDB dictionary source failing with named collections. Closes [#97840](https://github.com/ClickHouse/ClickHouse/issues/97840). [#98528](https://github.com/ClickHouse/ClickHouse/pull/98528) ([Pablo Marcos](https://github.com/pamarcos)).
* Fixed LOGICAL\_ERROR when Identifier is empty after parameter substitution. [#98530](https://github.com/ClickHouse/ClickHouse/pull/98530) ([Pervakov Grigorii](https://github.com/GrigoryPervakov)).
* Fix pipeline deadlock when using `sort_overflow_mode = 'break'` together with window functions. [#98543](https://github.com/ClickHouse/ClickHouse/pull/98543) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix column rollback in Buffer engine during handling an exception during appending a new block. Old logic could lead to corrupted in-memory state of columns. [#98551](https://github.com/ClickHouse/ClickHouse/pull/98551) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed exception `Bad cast from type ColumnConst to ColumnDynamic` in null-safe comparison (`<=>` / `IS NOT DISTINCT FROM`) with const `Dynamic` or `Variant` columns and `NULL`. Also fixed `IS DISTINCT FROM` with `Dynamic`/`Variant` vs `NULL` always incorrectly returning 0. [#98553](https://github.com/ClickHouse/ClickHouse/pull/98553) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed usage of the text index with other skip indexes. Previously, logical errors such as "Trying to get non-existing mark" could be thrown when a query filter utilized a text index and other regular skip indexes simultaneously. [#98555](https://github.com/ClickHouse/ClickHouse/pull/98555) ([Anton Popov](https://github.com/CurtizJ)).
* Fix logical error "TABLE\_FUNCTION is not allowed in expression context" when a table function with an alias appears multiple times in the same query scope (e.g. in both `PREWHERE` and `QUALIFY` clauses). [#98557](https://github.com/ClickHouse/ClickHouse/pull/98557) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix distributed index analysis with expressions (not just columns) in PK (leads to zero filtering of redundant granules on remote replicas). [#98561](https://github.com/ClickHouse/ClickHouse/pull/98561) ([Azat Khuzhin](https://github.com/azat)).
* Disallow dropping column when its subcolumns are used in other columns default/alias expressions and use analyzer for default expressions on alter drop column. [#98569](https://github.com/ClickHouse/ClickHouse/pull/98569) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Fix S3 requests being incorrectly retried on non-retryable errors (including `HTTP_CONNECTION_LIMIT_REACHED`) in the HTTP client. [#98598](https://github.com/ClickHouse/ClickHouse/pull/98598) ([Sema Checherinda](https://github.com/CheSema)).
* Fixes a decimal overflow when partition pruning with DateTime64. [#98628](https://github.com/ClickHouse/ClickHouse/pull/98628) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix two bugs in JIT expression compilation: a copy-paste error in `nativeCast` type checking that made integer-to-integer and float-to-float cast branches unreachable, and incorrect `nullptr` TargetMachine passed to LLVM `PassBuilder` preventing target-specific optimization passes from being registered. [#98660](https://github.com/ClickHouse/ClickHouse/pull/98660) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix RBAC bypass that allowed users to DESCRIBE any table via `remote()`, `remoteSecure()`, `cluster()`, or `clusterAllReplicas()` pointed at localhost, without requiring `SHOW_COLUMNS` privilege. [#98669](https://github.com/ClickHouse/ClickHouse/pull/98669) ([pufit](https://github.com/pufit)).
* Fix `BAD_GET` exception and incorrect query results when a non-boolean expression (e.g. `sin(col)`) is used in both WHERE and SELECT with a JOIN, due to filter push-down optimization corrupting shared DAG nodes. [#98681](https://github.com/ClickHouse/ClickHouse/pull/98681) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR "Replica decided to read in Default mode, not in WithOrder" when using `read_in_order_through_join` with parallel replicas. [#98685](https://github.com/ClickHouse/ClickHouse/pull/98685) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "Bad cast from type `DB::TableFunctionNode` to `DB::QueryNode`" when using `input` table function as an argument of `remote`. [#98694](https://github.com/ClickHouse/ClickHouse/pull/98694) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix outdated data parts resurrection caused by incorrectly cleaning up empty covering parts. [#98698](https://github.com/ClickHouse/ClickHouse/pull/98698) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix exception in `LogicalExpressionOptimizerPass` when a boolean function in an `equals` comparison returns a `Variant` type. [#98712](https://github.com/ClickHouse/ClickHouse/pull/98712) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `parseDateTimeBestEffort` incorrectly parsing words starting with month/weekday prefixes. Closes [#97965](https://github.com/ClickHouse/ClickHouse/issues/97965). [#98742](https://github.com/ClickHouse/ClickHouse/pull/98742) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `UNKNOWN_IDENTIFIER` exception when querying `merge()` table function or `Merge` engine over tables with JSON columns that have different parameters (e.g. different `SKIP` fields) and ALIAS columns referencing JSON sub-paths, with the new analyzer enabled. Closes [#97812](https://github.com/ClickHouse/ClickHouse/issues/97812). [#98753](https://github.com/ClickHouse/ClickHouse/pull/98753) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `optimize_skip_unused_shards` optimization with the analyzer in case `Distributed` storage is used in a `View`. [#98754](https://github.com/ClickHouse/ClickHouse/pull/98754) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix tuple subcolumn access by name (e.g. `SELECT x.a` for `Tuple(a UUID, b Int32)`) for external tables passed via `--external` in `clickhouse-client`. Closes [#96925](https://github.com/ClickHouse/ClickHouse/issues/96925). [#98755](https://github.com/ClickHouse/ClickHouse/pull/98755) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix `reverseUTF8` exception on invalid (truncated) UTF-8 input. [#98770](https://github.com/ClickHouse/ClickHouse/pull/98770) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix detecting set skip index usefulness with OR with false (i.e. or(x, 0)) predicate. [#98776](https://github.com/ClickHouse/ClickHouse/pull/98776) ([Azat Khuzhin](https://github.com/azat)).
* Fix a `LOGICAL_ERROR` exception (Block structure mismatch in `removeUnusedColumns`) that could occur with `FINAL` + `PREWHERE` + constant `WHERE` expression + column-independent aggregates like `count()`. [#98778](https://github.com/ClickHouse/ClickHouse/pull/98778) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Make `system.trace_log` entries for ClickHouse dictionaries' auto-reloads have non-empty query IDs. [#98784](https://github.com/ClickHouse/ClickHouse/pull/98784) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixes a crash where we could de-reference a null pointer in system tables created between the time when we snapshot the tables in the `IDatabaseTablesIterator::table()` call and the tables changing in another thread during later iteration. [#98792](https://github.com/ClickHouse/ClickHouse/pull/98792) ([Grant Holly](https://github.com/grantholly-clickhouse)).
* Fix `SYSTEM START REPLICATED VIEW` not waking up the refresh task. [#98797](https://github.com/ClickHouse/ClickHouse/pull/98797) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix exception "Inconsistent table names" when using `view()` table function containing JOINs inside another JOIN (only with old analyzer). [#98809](https://github.com/ClickHouse/ClickHouse/pull/98809) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix adjusting RLIMIT\_SIGPENDING (via pending\_signals). [#98829](https://github.com/ClickHouse/ClickHouse/pull/98829) ([Azat Khuzhin](https://github.com/azat)).
* Fix exception when composing `loop` with cluster table functions. [#98860](https://github.com/ClickHouse/ClickHouse/pull/98860) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* LEFT ANTI JOIN with multiple join key columns returned wrong results when `enable_join_runtime_filters=1` (which is default). [#98871](https://github.com/ClickHouse/ClickHouse/pull/98871) ([Alexander Gololobov](https://github.com/davenger)).
* Fix `WITH FILL STALENESS` producing extra filled rows when data is read in multiple chunks (e.g., with small `index_granularity`). [#98895](https://github.com/ClickHouse/ClickHouse/pull/98895) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "RPNBuilderFunctionTreeNode has A arguments, attempted to get argument at index B" LOGICAL\_ERROR. [#98900](https://github.com/ClickHouse/ClickHouse/pull/98900) ([Azat Khuzhin](https://github.com/azat)).
* Fix memory tracking drift caused by failed allocations not being rolled back, `nallocx(0)` undefined behavior, and off-by-one in global peak tracking. Extend tracking to cover `io_uring` ring buffers. [#98915](https://github.com/ClickHouse/ClickHouse/pull/98915) ([Antonio Andelic](https://github.com/antonio2368)).
* Forbid attaching to local data lake tables outside user paths, not only creating them. [#98936](https://github.com/ClickHouse/ClickHouse/pull/98936) ([Daniil Ivanik](https://github.com/divanik)).
* Fix a race condition that could cause a "ReadBuffer is canceled" exception in queries using `urlCluster` or similar cluster table functions. [#98955](https://github.com/ClickHouse/ClickHouse/pull/98955) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception in financial functions (`financialNetPresentValue`, `financialInternalRateOfReturn`, etc.) when `BFloat16` type arguments are passed. [#98958](https://github.com/ClickHouse/ClickHouse/pull/98958) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix skip indexes (and primary key conditions) not being applied for ALIAS columns when query plan expression merging is disabled (query\_plan\_merge\_expressions = 0 or query\_plan\_enable\_optimizations = 0). [#98960](https://github.com/ClickHouse/ClickHouse/pull/98960) ([Peng](https://github.com/fastio)).
* Increment `InsertQuery` ProfileEvent for async inserts. Closes [#98626](https://github.com/ClickHouse/ClickHouse/issues/98626). [#98962](https://github.com/ClickHouse/ClickHouse/pull/98962) ([Narasimha Pakeer](https://github.com/npakeer)).
* Fix exception "Inconsistent KeyCondition behavior" in debug builds when primary key contains NaN float values, by making `accurateLess` and `accurateEquals` handle NaN consistently with ClickHouse sort order. Closes [#98075](https://github.com/ClickHouse/ClickHouse/issues/98075). [#98964](https://github.com/ClickHouse/ClickHouse/pull/98964) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* SummingMergeTree no longer sums Bool (and other domain type) columns. Bool values are kept as-is instead of being arithmetically summed. [#98976](https://github.com/ClickHouse/ClickHouse/pull/98976) ([Yash ](https://github.com/Onyx2406)).
* Fixes an exception Scalar doesn't exist that occurred when querying a remote shard with `optimize_const_name_size` set and `enable_scalar_subquery_optimization` = 0. Large constants replaced with `__getScalar` references in the remote query were not being sent to the shard, causing the query to fail. [#98979](https://github.com/ClickHouse/ClickHouse/pull/98979) ([andriibeee](https://github.com/andriibeee)).
* Fix `NOT_FOUND_COLUMN_IN_BLOCK` for some queries with `GROUP BY` and expressions that include inverse dictionary lookup, `Date/DateTime` conversion comparisons, and tuple comparisons. Closes [#98888](https://github.com/ClickHouse/ClickHouse/issues/98888). [#98980](https://github.com/ClickHouse/ClickHouse/pull/98980) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed undefined behavior (null pointer dereference) when altering a version/sign/is\_deleted column to `EPHEMERAL` or `ALIAS` in MergeTree engines. Such alterations are now properly rejected. [#98985](https://github.com/ClickHouse/ClickHouse/pull/98985) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed an issue where `system.grants` omitted the regular expression parameters for `URL` and `S3` grants in the `access_object` column. [#98987](https://github.com/ClickHouse/ClickHouse/pull/98987) ([DQ](https://github.com/il9ue)).
* Fixed Iceberg BigLake reads: ADC credentials are now forwarded to the GCS S3 client (fixing 403 errors), OAuth2 credentials are URL-encoded before sending (fixing auth failures for tokens with special characters), and namespace traversal no longer aborts on BigLake HTTP 400 responses. [#98998](https://github.com/ClickHouse/ClickHouse/pull/98998) ([Nikita Fomichev](https://github.com/fm4v)).
* Fixed `clickhouse-client` failing to switch timezone when `TZ` environment variable uses POSIX file path syntax (e.g. `TZ=:/etc/localtime`). [#99000](https://github.com/ClickHouse/ClickHouse/pull/99000) ([Yash ](https://github.com/Onyx2406)).
* Fix incorrect or less pruning when `startsWith`, `LIKE`, `NOT LIKE` used with `FixedString` column. Additionally, `FixedString` to `String` cast function can now prune granules when wrapped around key column. Closes [#98940](https://github.com/ClickHouse/ClickHouse/issues/98940). [#99001](https://github.com/ClickHouse/ClickHouse/pull/99001) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed `windowFunnel` with `strict_deduplication` returning incorrect level when a duplicate event was encountered. [#99003](https://github.com/ClickHouse/ClickHouse/pull/99003) ([Yash ](https://github.com/Onyx2406)).
* Fixes a bug where EXISTS would ignore LIMIT and OFFSET clauses in subqueries, causing incorrect results when the subquery returned no rows due to an offset or a zero limit. Closes [#88722](https://github.com/ClickHouse/ClickHouse/issues/88722). [#99005](https://github.com/ClickHouse/ClickHouse/pull/99005) ([andriibeee](https://github.com/andriibeee)).
* Fix "Block structure mismatch" exception when filter push-down optimization encounters an AND expression that short-circuits to a constant with `GROUPING SETS`. [#99010](https://github.com/ClickHouse/ClickHouse/pull/99010) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when reading patch parts (lightweight updates) without `_part_offset` column in the query plan. [#99023](https://github.com/ClickHouse/ClickHouse/pull/99023) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* A query like `SELECT * FROM table WHERE pk_id = ''` where `pk_id` is the primary key and of `String` type will now correctly use the primary key index for filtering granules. [#99027](https://github.com/ClickHouse/ClickHouse/pull/99027) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Fix `DEPENDENCIES_NOT_FOUND` exception in Kafka engine when materialized view is detached while the background thread is streaming data. [#99028](https://github.com/ClickHouse/ClickHouse/pull/99028) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception when creating a table with an `EPHEMERAL` column that has the same name as a virtual column (e.g., `_part_offset`). [#99031](https://github.com/ClickHouse/ClickHouse/pull/99031) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix misleading "inflate failed: buffer error" when reading non-existent compressed files via `url()` table function with glob patterns. Now returns empty result as expected when `http_skip_not_found_url_for_globs` is enabled. [#99034](https://github.com/ClickHouse/ClickHouse/pull/99034) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix server crash (std::terminate) when executing `ALTER TABLE ... DROP PART` on a patch part after a schema change (e.g. ADD COLUMN). The crash was caused by missing system columns (`_part`) in the empty coverage part metadata, leading to an uncaught exception inside a NOEXCEPT\_SCOPE. [#99036](https://github.com/ClickHouse/ClickHouse/pull/99036) ([Peng](https://github.com/fastio)).
* ClickHouse server process could crash if there was a memory limit exceeded exception thrown during a *cached disk read*. That is now fixed. [#99042](https://github.com/ClickHouse/ClickHouse/pull/99042) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Fix `LOGICAL_ERROR` when querying a table that has both a ROW POLICY and an ALIAS column using `dictGet`. The issue was caused by premature access to the table expression during ALIAS column resolution in the new analyzer. [#99065](https://github.com/ClickHouse/ClickHouse/pull/99065) ([Peng](https://github.com/fastio)).
* Fix out of bounds error when user tries to query only virtual columns from Iceberg table with Avro format for data. It's super rare scenario so not marking it as critical. Fixes [#88238](https://github.com/ClickHouse/ClickHouse/issues/88238). [#99080](https://github.com/ClickHouse/ClickHouse/pull/99080) ([alesapin](https://github.com/alesapin)).
* Fix segfault in recursive CTE with `remote()` + `view()`. [#99081](https://github.com/ClickHouse/ClickHouse/pull/99081) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Skip unnecessary extra index analysis when read-in-order optimization is applied. [#99084](https://github.com/ClickHouse/ClickHouse/pull/99084) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed a crash triggered by a memory limit exception thrown during patch part application. [#99086](https://github.com/ClickHouse/ClickHouse/pull/99086) ([Anton Popov](https://github.com/CurtizJ)).
* Fix debug assertion in `DDLWorker` caused by stale `first_failed_task_name` after a ZooKeeper entry is deleted during reinitialization recovery. [#99099](https://github.com/ClickHouse/ClickHouse/pull/99099) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed rebuild of text indexes on merges with TTL. [#99107](https://github.com/ClickHouse/ClickHouse/pull/99107) ([Anton Popov](https://github.com/CurtizJ)).
* Fix crash in `ALTER TABLE ... REMOVE SETTINGS` query for Iceberg table engine. Fixes [#86330](https://github.com/ClickHouse/ClickHouse/issues/86330). [#99108](https://github.com/ClickHouse/ClickHouse/pull/99108) ([alesapin](https://github.com/alesapin)).
* Fixes a bug in `query_plan_convert_any_join_to_semi_or_anti_join` optimization, returning an incorrect result for unmatched rows. Related: [https://github.com/ClickHouse/ClickHouse/pull/95995](https://github.com/ClickHouse/ClickHouse/pull/95995). [#99112](https://github.com/ClickHouse/ClickHouse/pull/99112) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix LOGICAL\_ERROR exception in `ASTColumnsExceptTransformer::transform`. [#99119](https://github.com/ClickHouse/ClickHouse/pull/99119) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix RBAC bypass that allowed users to obtain table structure via `DESCRIBE TABLE` or `CREATE TABLE AS` on table functions (`mysql()`, `postgresql()`, `sqlite()`, `arrowFlight()`, `jdbc()`, `odbc()`, etc.) without the required source access privileges. For functions that infer schema from remote servers, this also allowed triggering outbound connections (SSRF) without authorization. [#99122](https://github.com/ClickHouse/ClickHouse/pull/99122) ([pufit](https://github.com/pufit)).
* Fix Keeper crash (segfault in NuRaft) during dynamic reconfiguration and leadership transfer. [#99133](https://github.com/ClickHouse/ClickHouse/pull/99133) ([JIaQi Tang](https://github.com/JiaQiTang98)).
* Fix crash on usage of Buffer table with SAMPLE when destination does not support it. [#99141](https://github.com/ClickHouse/ClickHouse/pull/99141) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix LOGICAL\_ERROR due to patch parts column order mismatch. [#99164](https://github.com/ClickHouse/ClickHouse/pull/99164) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix very rare crash when Iceberg table contains files of mixed format (ORC and Parquet). Fixes [#88126](https://github.com/ClickHouse/ClickHouse/issues/88126). [#99168](https://github.com/ClickHouse/ClickHouse/pull/99168) ([alesapin](https://github.com/alesapin)).
* Fix max\_execution\_time not being applied for backup/restore. [#99205](https://github.com/ClickHouse/ClickHouse/pull/99205) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix `insert_deduplication_token` being silently ignored for `INSERT SELECT` queries without `ORDER BY ALL`. Previously, deduplication was disabled entirely for unsorted `INSERT SELECT`, even when an explicit user token was provided. Now, providing `insert_deduplication_token` is sufficient to enable deduplication regardless of `ORDER BY ALL`. [#99206](https://github.com/ClickHouse/ClickHouse/pull/99206) ([Desel72](https://github.com/Desel72)).
* Fix excessive access checks during `InverseDictionaryLookupPass` optimization by checking `CREATE_TEMPORARY_TABLE` grant once before the pass instead of for every visited node. [#99210](https://github.com/ClickHouse/ClickHouse/pull/99210) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix `clickhouse format --obfuscate` producing invalid SQL by obfuscating skip index types, compression codec names, database engine names, and dictionary layout/source definitions. [#99260](https://github.com/ClickHouse/ClickHouse/pull/99260) ([Raúl Marín](https://github.com/Algunenano)).
* Fixed a bug where, in some cases, comparing between Time\[64] and DateTime\[64] types was confusing; now, in cases like this, Time\[64] values are promoted to DateTime\[64] by adding the `1970-01-01` as a date part. [#99267](https://github.com/ClickHouse/ClickHouse/pull/99267) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Clamp settings constraints in DDL worker for distributed DDL queries. [#99317](https://github.com/ClickHouse/ClickHouse/pull/99317) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix minor issues with TOTP authentication: the `--one-time-password` CLI option with empty password, validation of `<digits>` and `<period>` configuration values. [#99322](https://github.com/ClickHouse/ClickHouse/pull/99322) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix logical error `unordered_map::at: key not found` in Avro output format when serializing `Enum8`/`Enum16` columns with values not present in the enum definition. [#99332](https://github.com/ClickHouse/ClickHouse/pull/99332) ([Desel72](https://github.com/Desel72)).
* Fix CHECK TABLE with sparse serialization inside Tuple with Dynamic. Closes [#96588](https://github.com/ClickHouse/ClickHouse/issues/96588). [#99351](https://github.com/ClickHouse/ClickHouse/pull/99351) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed too strict validation of text index preprocessor. [#99359](https://github.com/ClickHouse/ClickHouse/pull/99359) ([Anton Popov](https://github.com/CurtizJ)).
* Fix compatibility when upgrading replicated tables with implicit minmax indices from 25.10 to newer versions. [#99392](https://github.com/ClickHouse/ClickHouse/pull/99392) ([Raúl Marín](https://github.com/Algunenano)).
* Removed support for negated functions (`notEquals`, `notLike`, `notIn`) in text index analysis. These functions could never skip any granules, so analyzing the index for them only added overhead without any benefit. [#99393](https://github.com/ClickHouse/ClickHouse/pull/99393) ([Anton Popov](https://github.com/CurtizJ)).
* Fix `optimize_skip_unused_shards` with a new analyzer for the case when a `Distributed` table was used inside an IN subquery. [#99436](https://github.com/ClickHouse/ClickHouse/pull/99436) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix heap-use-after-free in `INTERSECT`/`EXCEPT` when the query produces duplicate column names. [#99471](https://github.com/ClickHouse/ClickHouse/pull/99471) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error in `ALTER TABLE ... DROP PART` when a typed query parameter is used for the part name. [#99489](https://github.com/ClickHouse/ClickHouse/pull/99489) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed `NOT_FOUND_COLUMN_IN_BLOCK` exception when a text index predicate (e.g. `hasAllTokens`) is referenced in both `SELECT` and `WHERE` clauses via an alias. [#99504](https://github.com/ClickHouse/ClickHouse/pull/99504) ([Anton Popov](https://github.com/CurtizJ)).
* Fix incorrect results when using `hasAllTokens` with OR across columns that have separate text indexes. [#99505](https://github.com/ClickHouse/ClickHouse/pull/99505) ([Anton Popov](https://github.com/CurtizJ)).
* Initialize page cache in `clickhouse-local` so that `page_cache_max_size` setting takes effect. [#99510](https://github.com/ClickHouse/ClickHouse/pull/99510) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed rare incorrect marking of a data part as broken and detaching it after `DETACH/ATTACH TABLE` query. [#99529](https://github.com/ClickHouse/ClickHouse/pull/99529) ([Anton Popov](https://github.com/CurtizJ)).
* Fix `std::length_error` exception when querying empty system tables with Pretty format via HTTP interface. [#99541](https://github.com/ClickHouse/ClickHouse/pull/99541) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` when using `ALTER TABLE ADD COLUMN` to create an `EPHEMERAL` column with the same name as a virtual column (e.g. `_part_offset`). [#99549](https://github.com/ClickHouse/ClickHouse/pull/99549) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `VectorSimilarityIndexCache` entries never being evicted after part removal due to mismatched cache keys. [#99575](https://github.com/ClickHouse/ClickHouse/pull/99575) ([Seva Potapov](https://github.com/seva-potapov)).
* Forbid reading Google credentials from a local file. This setting is insecure because it allows reading other credentials if the file path is known. [#99584](https://github.com/ClickHouse/ClickHouse/pull/99584) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix performance degradation in the analyzer. Prune unused columns from ARRAY JOIN. [#99587](https://github.com/ClickHouse/ClickHouse/pull/99587) ([Dmitry Novik](https://github.com/novikd)).
* Fixed reading of text index in table with existing lightweight deletes and row policies. [#99661](https://github.com/ClickHouse/ClickHouse/pull/99661) ([Anton Popov](https://github.com/CurtizJ)).
* Fix nullptr dereference in Parquet reader when filter-in-decoder path encounters filtered-out pages. Closes [#99676](https://github.com/ClickHouse/ClickHouse/issues/99676). [#99677](https://github.com/ClickHouse/ClickHouse/pull/99677) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O\_DIRECT. Closes [#99358](https://github.com/ClickHouse/ClickHouse/issues/99358). [#99678](https://github.com/ClickHouse/ClickHouse/pull/99678) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed heap-buffer-overflow in `CompressionCodecT64` and process abort in `CompressionCodecMultiple` when decompressing malformed compressed data. Both issues were found by new libFuzzer targets. The codecs now throw an exception instead of crashing. [#99680](https://github.com/ClickHouse/ClickHouse/pull/99680) ([Rahul](https://github.com/motsc)).
* Delay processing until server has finished loading all the tables. [#99700](https://github.com/ClickHouse/ClickHouse/pull/99700) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix MySQL dictionary source bypassing `RemoteHostFilter` for inline DDL params. [#99720](https://github.com/ClickHouse/ClickHouse/pull/99720) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix logical error when iterating over data lake tables in `system.tables`. [#99739](https://github.com/ClickHouse/ClickHouse/pull/99739) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fixed analysis of predicates with the `IN` function by text index with the preprocessor. Fixed the collision of searched tokens in the text index, which could lead to incorrect results. [#99755](https://github.com/ClickHouse/ClickHouse/pull/99755) ([Anton Popov](https://github.com/CurtizJ)).
* Fix infinite loop when reading `Npy` format files with negative shape dimensions. [#99812](https://github.com/ClickHouse/ClickHouse/pull/99812) ([Desel72](https://github.com/Desel72)).
* Fix global-buffer-overflow in `CRC32` function on `FixedString` arguments when evaluated with zero rows during query plan header computation. [#99835](https://github.com/ClickHouse/ClickHouse/pull/99835) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix crash (null pointer dereference) when executing `ALTER TABLE ... MODIFY COLUMN ... COMMENT` on Iceberg tables. [#99838](https://github.com/ClickHouse/ClickHouse/pull/99838) ([Desel72](https://github.com/Desel72)).
* Fix `aggregate_functions_null_for_empty` setting to work with aggregate functions returning non-Nullable types such as `Array` or `Map` (e.g., `groupArray`, `sumMap`). [#99839](https://github.com/ClickHouse/ClickHouse/pull/99839) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix LOGICAL\_ERROR exception in `midpoint` function when called with mixed signed/unsigned integer types. [#99867](https://github.com/ClickHouse/ClickHouse/pull/99867) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Block structure mismatch" exception in queries with HAVING clause where the filter expression contains both an aggregate wrapped in a NULL-producing function and `materialize(0)`. [#99915](https://github.com/ClickHouse/ClickHouse/pull/99915) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix assertion failure in `sipHash128Keyed` (and similar keyed hash functions) when the data argument is a Map with array keys or other nested array types. [#99921](https://github.com/ClickHouse/ClickHouse/pull/99921) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception "Not-ready Set" in `IN` function during query plan optimization with `convertAnyJoinToSemiOrAntiJoin`. [#99939](https://github.com/ClickHouse/ClickHouse/pull/99939) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="263-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Reduce compilation time by removing heavy header includes and moving expensive template instantiations out of headers. [#97893](https://github.com/ClickHouse/ClickHouse/pull/97893) ([Raúl Marín](https://github.com/Algunenano)).
* Reduce compile time of arithmetic functions and related headers by shrinking template dispatch matrices and removing heavy includes. [#98204](https://github.com/ClickHouse/ClickHouse/pull/98204) ([Raúl Marín](https://github.com/Algunenano)).
* Use `mongo-c-driver` 2.2.2. [#98304](https://github.com/ClickHouse/ClickHouse/pull/98304) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `postgres` REL\_18\_3. [#98306](https://github.com/ClickHouse/ClickHouse/pull/98306) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Enable jemalloc allocator for UBSan builds to avoid RSS accumulation from glibc malloc's poor memory reclamation behavior. [#98444](https://github.com/ClickHouse/ClickHouse/pull/98444) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Use Rust v0 symbol mangling and strip internal symbols from PRQL library to reduce symbol name bloat from parser combinator libraries. [#98446](https://github.com/ClickHouse/ClickHouse/pull/98446) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add TPC-H benchmark suite and TPC-DS README to `tests/benchmarks`. [#98495](https://github.com/ClickHouse/ClickHouse/pull/98495) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Add correctness tests for all 99 TPC-DS queries. [#99204](https://github.com/ClickHouse/ClickHouse/pull/99204) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Add integration test reproducing DDL CREATE TABLE + ALTER with offline replica bug ([#44070](https://github.com/ClickHouse/ClickHouse/issues/44070)), marked as expected failure. [#99259](https://github.com/ClickHouse/ClickHouse/pull/99259) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Integrate jemalloc with `je_` prefix and remove usage of linker's --wrap. [#99342](https://github.com/ClickHouse/ClickHouse/pull/99342) ([Azat Khuzhin](https://github.com/azat)).

<h3 id="262">
  ClickHouse release 26.2, 2026-02-26. [Presentation](https://presentations.clickhouse.com/2026-release-26.2/), [Video](https://www.youtube.com/watch?v=7qHba08vNfo)
</h3>

<h4 id="262-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* Deduplication is turned ON for all inserts by default. It was OFF before for async inserts and for MV's, but it was ON for sync inserts. The goal is to have the same defaults for both ways of inserts. If you have deduplication explicitly disabled on your cluster, you have to explicitly set `deduplicate_insert='backward_compatible_choice'` to keep the old behavior. The same with `deduplicate_blocks_in_dependent_materialized_views`. [#95970](https://github.com/ClickHouse/ClickHouse/pull/95970) ([Sema Checherinda](https://github.com/CheSema)).
* Improved storage format of statistics. All statistics are now stored in a single file. [#93414](https://github.com/ClickHouse/ClickHouse/pull/93414) ([Anton Popov](https://github.com/CurtizJ)). If you didn't explicitly enable table statistics, you can ignore this item.
* Limit S3(Azure)Queue in-memory metadata. System tables are renamed from `azure_queue` to `azure_queue_metadata_cache` and `system.s3queue` to `s3queue_metadata_cache`. [#95809](https://github.com/ClickHouse/ClickHouse/pull/95809) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Previously, applying a function to a `Variant` column silently returned NULLs when a variant sub-type was incompatible with the function; now it throws an exception, which may break queries that relied on the silent NULL behavior. [#95811](https://github.com/ClickHouse/ClickHouse/pull/95811) ([Bharat Nallan](https://github.com/bharatnc)).
* `DATE` columns from PostgreSQL are now inferred as `Date32` in ClickHouse (in previous versions they were inferred as `Date`, which led to overflow of the values outside of a narrow range). Allow inserting `Date32` values back to PostgreSQL. Closes [#73084](https://github.com/ClickHouse/ClickHouse/issues/73084). [#95999](https://github.com/ClickHouse/ClickHouse/pull/95999) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The semantics of the `do_not_merge_across_partitions_select_final` setting were made more obvious. Previously, the feature could be automatically enabled when the setting was not explicitly set in the configs. It caused confusion repeatedly and, unfortunately, led to some issues in production. Now, the rules are simpler: `do_not_merge_across_partitions_select_final=1` enables the functionality unconditionally. If `do_not_merge_across_partitions_select_final=0`, then automatic is used only if the new setting `enable_automatic_decision_for_merging_across_partitions_for_final=1` and not used otherwise. To preserve the old behaviour as much as possible, the defaults were set to `do_not_merge_across_partitions_select_final=0` and `enable_automatic_decision_for_merging_across_partitions_for_final=1`. [#96110](https://github.com/ClickHouse/ClickHouse/pull/96110) ([Nikita Taranov](https://github.com/nickitat)).
* When creating an S3 table with explicitly specified columns, ClickHouse now validates that those column names actually exist in the remote file's schema. Queries that previously worked with mismatched column names will now fail at table creation time. This closes [#96089](https://github.com/ClickHouse/ClickHouse/issues/96089). [#96194](https://github.com/ClickHouse/ClickHouse/pull/96194) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Forbid using subqueries in ORDER BY and other table key expressions. [#96847](https://github.com/ClickHouse/ClickHouse/pull/96847) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Enable `apply_row_policy_after_final` by default. Initially, when `optimize_move_to_prewhere_if_final=0`, both ROW POLICY and PREWHERE respect FINAL and were applied after FINAL. This was broken by [#87303](https://github.com/ClickHouse/ClickHouse/issues/87303), which ignored the `optimize_move_to_prewhere_if_final` for the ROW POLICY filter. To fix this, this PR enables the setting `apply_row_policy_after_final` introduced in [#91065](https://github.com/ClickHouse/ClickHouse/issues/91065). With `apply_row_policy_after_final` enabled, ROW POLICY would continue to respect FINAL by default, as previously. This PR is an incompatible change because it changes the behaviour for `optimize_move_to_prewhere_if_final=1`. Now, to get the ROW POLICY applied before FINAL, `apply_row_policy_after_final` should be used instead of `optimize_move_to_prewhere_if_final`. [#97279](https://github.com/ClickHouse/ClickHouse/pull/97279) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* The `Date` type is now serialized as Arrow's native `date32` type in Arrow/ArrowStream formats, instead of `uint16`. Tools like PyArrow will now correctly see the column as a date type. The old behavior can be restored with the `output_format_arrow_date_as_uint16` setting. Reading old Arrow files that used `uint16` for `Date` columns is still supported. [#96860](https://github.com/ClickHouse/ClickHouse/pull/96860) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="262-new-feature">
  New Feature
</h4>

* Users can now use ClickStack (an observability UI) directly from ClickHouse, useful for debugging and local development. [#96597](https://github.com/ClickHouse/ClickHouse/pull/96597) ([Aaron Knudtson](https://github.com/knudtty)).
* Support time-based one-time password (TOTP) as an authentication method. [#71273](https://github.com/ClickHouse/ClickHouse/pull/71273) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Add `lazy_load_tables` database setting. When enabled, tables are not loaded during database startup — a lightweight `StorageTableProxy` is created instead and the real table engine is materialized on first access. [#96283](https://github.com/ClickHouse/ClickHouse/pull/96283) ([xiaohuanlin](https://github.com/xiaohuanlin)).
* Added `input_format_max_block_wait_ms` setting to emit data blocks by timeout and allowed processing of remaining data when an HTTP connection is closed unexpectedly. [#94509](https://github.com/ClickHouse/ClickHouse/pull/94509) ([Mostafa Mohamed Salah](https://github.com/Sasao4o)).
* Google BigLake catalog integration. This closes [#95339](https://github.com/ClickHouse/ClickHouse/issues/95339). [#97104](https://github.com/ClickHouse/ClickHouse/pull/97104) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Added system table `system.tokenizers` which shows all available tokenizers. [#96753](https://github.com/ClickHouse/ClickHouse/pull/96753) ([Robert Schulze](https://github.com/rschu1ze)).
* Add new system table `system.user_defined_functions` to monitor UDF loading status and configuration. [#90340](https://github.com/ClickHouse/ClickHouse/pull/90340) ([Xu Jia](https://github.com/XuJia0210)).
* Add `system.jemalloc_stats` table exposing jemalloc memory allocator statistics (via `malloc_stats_print`) for diagnosing memory usage on servers built with jemalloc. Also add a `/jemalloc.html` HTTP endpoint on the ClickHouse HTTP interface for interactive visualization of these statistics. [#97077](https://github.com/ClickHouse/ClickHouse/pull/97077) ([Antonio Andelic](https://github.com/antonio2368)).
* Added `system.jemalloc_profile_text` table for reading and analyzing jemalloc heap profiles. The output format is controlled by the `jemalloc_profile_text_output_format` setting (raw, symbolized, or collapsed; default collapsed). Inline frame resolution is controlled by `jemalloc_profile_text_symbolize_with_inline` (when enabled, inline frames are included at the cost of slower symbolization; when disabled, they are skipped for faster output). For the collapsed format, `jemalloc_profile_text_collapsed_use_count` controls whether stacks are weighted by live allocation count (true) or live bytes (false, default). This enables easier memory profiling and flame graph visualization of jemalloc heap profiles. Fixes [#93248](https://github.com/ClickHouse/ClickHouse/issues/93248). [#97218](https://github.com/ClickHouse/ClickHouse/pull/97218) ([Antonio Andelic](https://github.com/antonio2368)).
* Add the `default_dictionary_database` setting, which lets ClickHouse resolve external dictionaries referenced without a database qualifier in a specified default database. This simplifies migration from XML-defined global dictionaries to SQL-defined per-database dictionaries—allowing existing dictionary queries (e.g. dictGet('name', …)) to continue working without modification. [#91412](https://github.com/ClickHouse/ClickHouse/pull/91412) ([Dmitrii Plotnikov](https://github.com/dimbo4ka)).
* Support auxiliary zookeeper for `DatabaseReplicated`. [#91683](https://github.com/ClickHouse/ClickHouse/pull/91683) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Implement new table function `primes` and new system table `system.primes` that contains prime numbers in ascending order. Closes [#90839](https://github.com/ClickHouse/ClickHouse/issues/90839). [#92776](https://github.com/ClickHouse/ClickHouse/pull/92776) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Async inserts support parallel quorum. The inserted data is replicated to the quorum. If duplicates are found, query waits until previously inserted data is replicated as well. [#93356](https://github.com/ClickHouse/ClickHouse/pull/93356) ([Sema Checherinda](https://github.com/CheSema)).
* Added functions `colorOKLABToSRGB`, `colorSRGBToOKLAB` to convert value from sRGB to OKLAB and vice versa. [#93361](https://github.com/ClickHouse/ClickHouse/pull/93361) ([Pranav Tiwari](https://github.com/pranavt84)).
* A new `deduplicate_insert` setting which overrides `insert_deduplicate` and `async_insert_deduplicate`. [#94413](https://github.com/ClickHouse/ClickHouse/pull/94413) ([Sema Checherinda](https://github.com/CheSema)).
* Server setting `insert_deduplication_version` makes it possible to migrate on unified deduplication hash. [#95409](https://github.com/ClickHouse/ClickHouse/pull/95409) ([Sema Checherinda](https://github.com/CheSema)).
* Add `xxh3_128` hashing function. [#96055](https://github.com/ClickHouse/ClickHouse/pull/96055) ([Raúl Marín](https://github.com/Algunenano)).
* Added `OPTIMIZE <table> DRY RUN PARTS <part names>` query to simulate merges without committing the result part. It may be useful for testing purposes: verifying merge correctness in the new version, deterministically reproducing merge-related bugs, and reliably benchmarking merge performance. [#96122](https://github.com/ClickHouse/ClickHouse/pull/96122) ([Anton Popov](https://github.com/CurtizJ)).
* Add a new check enabled by default via setting `check_named_collection_dependencies` to avoid dropping named collections used by tables. [#96181](https://github.com/ClickHouse/ClickHouse/pull/96181) ([Pablo Marcos](https://github.com/pamarcos)).
* Added `system.fail_points` to inspect existing failpoints in the server and whether they are enabled or not. This is going to help automate testing. [#96762](https://github.com/ClickHouse/ClickHouse/pull/96762) ([Pedro Ferreira](https://github.com/PedroTadim)).
* Add role-based access to Glue catalog. Use settings `aws_role_arn` and, optionally, `aws_role_session_name`. [#90825](https://github.com/ClickHouse/ClickHouse/pull/90825) ([Antonio Andelic](https://github.com/antonio2368)).
* Added a setting `add_minmax_index_for_temporal_columns` that, when enabled, automatically creates minmax indexes for all `Date`, `Date32`, `Time`, `Time64`, `DateTime`, and `DateTime64` columns. [#93355](https://github.com/ClickHouse/ClickHouse/pull/93355) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Support for extended table aliases for JOINs (queries like `SELECT * FROM (SELECT 1) AS t(a) JOIN (SELECT 1) AS u(b) ON a = b`). Closes [#95131](https://github.com/ClickHouse/ClickHouse/issues/95131). [#95331](https://github.com/ClickHouse/ClickHouse/pull/95331) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Added support for `ALTER TABLE RENAME COLUMN` for Iceberg tables. Previously only `ADD COLUMN, DROP COLUMN, and MODIFY COLUMN` were supported. [#97455](https://github.com/ClickHouse/ClickHouse/pull/97455) ([murphy-4o](https://github.com/murphy-4o)).

<h4 id="262-experimental-feature">
  Experimental Feature
</h4>

* The text index is now GA. [#96794](https://github.com/ClickHouse/ClickHouse/pull/96794) ([Robert Schulze](https://github.com/rschu1ze)).
* The `QBit` data type for quantized bit-packed vector storage (used for approximate nearest-neighbor search) is now generally available and no longer requires enabling an experimental setting. [#95358](https://github.com/ClickHouse/ClickHouse/pull/95358) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Vector search in ClickHouse can now use replicas in the cluster to *distribute* the load and search of vector index parts. This enables ClickHouse to support large vector indexes that exceed the memory capacity of a single VM. [#95876](https://github.com/ClickHouse/ClickHouse/pull/95876) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Add server-side AST fuzzer controlled by `ast_fuzzer_runs` and `ast_fuzzer_any_query` settings. When enabled, the server runs randomized mutations of each query after its normal execution, discarding the results. [#97568](https://github.com/ClickHouse/ClickHouse/pull/97568) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `iif` function to the experimental KQL dialect. [#94790](https://github.com/ClickHouse/ClickHouse/pull/94790) ([happyso](https://github.com/sunyeongchoi)).
* Schema inference now respects `allow_experimental_nullable_tuple_type`. When enabled, it allows inferred tuple types to be `Nullable(Tuple(...))`, so missing nested objects can become `NULL` instead of a tuple of `NULL` elements. [#95525](https://github.com/ClickHouse/ClickHouse/pull/95525) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* The `use_statistics_cache` setting is now enabled by default, so column statistics are cached in memory to speed up query optimization without needing to reload them from each part. [#95950](https://github.com/ClickHouse/ClickHouse/pull/95950) ([Han Fei](https://github.com/hanfei1991)).

<h4 id="262-performance-improvement">
  Performance Improvement
</h4>

* Allow any deterministic expression in Primary Key to be used for data skipping (e.g. `ORDER BY cityHash64(user_id)`/ `ORDER BY length(user_id)`). For deterministic expressions, ClickHouse can apply the expression to query constants and use the result in the primary key index for predicates like `=`, `IN`, and `has`. If the expression is also injective (e.g. `ORDER BY hex(p)` or `ORDER BY reverse(tuple(reverse(p), hex(p)))`), we can effectively use the index for the negated forms: `!=`, `NOT IN`, and `NOT has`. Closes [#10685](https://github.com/ClickHouse/ClickHouse/issues/10685). Closes [#82161](https://github.com/ClickHouse/ClickHouse/issues/82161). [#92952](https://github.com/ClickHouse/ClickHouse/pull/92952) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Improved storage format of statistics. All statistics are now stored in a single file. [#93414](https://github.com/ClickHouse/ClickHouse/pull/93414) ([Anton Popov](https://github.com/CurtizJ)).
* Allow parallelized read for remote table engines/functions in the filesystem cache. [#71781](https://github.com/ClickHouse/ClickHouse/pull/71781) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Allow using userspace page cache with local files and object storage table functions. [#77874](https://github.com/ClickHouse/ClickHouse/pull/77874) ([Michael Kolupaev](https://github.com/al13n321)).
* Avoid unnecessary memcpy in userspace page cache. [#77884](https://github.com/ClickHouse/ClickHouse/pull/77884) ([Michael Kolupaev](https://github.com/al13n321)).
* The default for `concurrent_threads_scheduler` is now `max_min_fair` instead of `fair_round_robin`. This improves fairness under high load by prioritizing queries with fewer allocated slots, so short-running queries aren't penalized by long-running ones. [#95300](https://github.com/ClickHouse/ClickHouse/pull/95300) ([Sergei Trifonov](https://github.com/serxa)).
* If a `FINAL` query used primary key condition for filtering followed by skip indexes for other conditions, the `PrimaryKeyExpand` processing step will now only check the initial shortlisted primary key ranges for intersection. [#94903](https://github.com/ClickHouse/ClickHouse/pull/94903) ([Shankar Iyer](https://github.com/shankar-iyer)).
* When using parallel replicas with table functions like `s3(...)`, queries with a single subquery wrapping the table function are now automatically parallelized across replicas, whereas previously only direct table function references were parallelized. Closes [#92264](https://github.com/ClickHouse/ClickHouse/issues/92264). [#96332](https://github.com/ClickHouse/ClickHouse/pull/96332) ([phulv94](https://github.com/phulv94)).
* Enable splitting data and system files in cache into separate segments. [#87834](https://github.com/ClickHouse/ClickHouse/pull/87834) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* Speed up some hash join operations by implementing dynamic dispatch for `ColumnVector::replicate`. [#79573](https://github.com/ClickHouse/ClickHouse/pull/79573) ([Raúl Marín](https://github.com/Algunenano)).
* Performance improvement for parallel hash join in cases of complex predicates. Previously, we were processing non-joined rows in one thread, which is suboptimal the idea of the optimization is to parallelize the processing of the non-joined rows across multiple threads. Can be toggled by the `parallel_non_joined_rows_processing` setting. Enabled by default. [#92068](https://github.com/ClickHouse/ClickHouse/pull/92068) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Slightly optimize parsing of JSON type. [#93614](https://github.com/ClickHouse/ClickHouse/pull/93614) ([Pavel Kruglov](https://github.com/Avogar)).
* Improve memory footprint of AST. Optimization makes sense as fields are not used when highlighting is not used and there is no VALUES parsing. [#93974](https://github.com/ClickHouse/ClickHouse/pull/93974) ([Ilya Yatsishin](https://github.com/qoega)).
* Optimize memory consumption of named Tuple AST objects. Place column names as strings in tuple object instead of having them in generic AST literal nodes. [#94704](https://github.com/ClickHouse/ClickHouse/pull/94704) ([Ilya Yatsishin](https://github.com/qoega)).
* Devirtualization is improved with additional linker options. [#94737](https://github.com/ClickHouse/ClickHouse/pull/94737) ([Nikita Taranov](https://github.com/nickitat)).
* Improve clone replica performance for ReplicatedMergeTree tables with many parts by batching ZooKeeper requests. [#94847](https://github.com/ClickHouse/ClickHouse/pull/94847) ([c-end](https://github.com/c-end)).
* When read step already has PREWHERE filters a new filter couldn't be added. This change postpones PREWHERE optimization until after JOIN runtime filter optimization so that runtime filters can be also pushed to PREWHERE. [#95838](https://github.com/ClickHouse/ClickHouse/pull/95838) ([Alexander Gololobov](https://github.com/davenger)).
* Speedup `T64` codec compression by using dynamic dispatch on x86. [#95881](https://github.com/ClickHouse/ClickHouse/pull/95881) ([Raúl Marín](https://github.com/Algunenano)).
* Speed up `uniq` over numeric types by batching inserts when possible (not null, not -If, no GROUP BY, no IPv6 or String). [#95904](https://github.com/ClickHouse/ClickHouse/pull/95904) ([Raúl Marín](https://github.com/Algunenano)).
* Low-level optimizations for Keeper: `ZooKeeper::observeOperations` has been found to account for >20% of the ZooKeeper receive thread CPU consumption. This change addresses that by: 1. For `AggregatedZooKeeperLog::stats`, use `CityHash64` instead of `SipHash` which is >10x faster. 2. For `Coordination::ErrorCounter`, use `std::array<std::atomic<UInt32>, N>` instead of `std::unordered_map` and `std::mutex`. [#95962](https://github.com/ClickHouse/ClickHouse/pull/95962) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Remove 64-byte alignment for ProfileEvents::Counter to save memory. [#96097](https://github.com/ClickHouse/ClickHouse/pull/96097) ([Azat Khuzhin](https://github.com/azat)).
* Memory optimization: trim size of `CachedOnDiskReadBufferFromFile` structure 50x. [#96098](https://github.com/ClickHouse/ClickHouse/pull/96098) ([Azat Khuzhin](https://github.com/azat)).
* Don't copy old data on hash table resizing if it's empty. [#96180](https://github.com/ClickHouse/ClickHouse/pull/96180) ([Raúl Marín](https://github.com/Algunenano)).
* Support JOIN runtime filters for `RIGHT OUTER` JOINs. [#96183](https://github.com/ClickHouse/ClickHouse/pull/96183) ([Hechem Selmi](https://github.com/m-selmi)).
* The optimization `enable_join_runtime_filters` is now the default. [#89314](https://github.com/ClickHouse/ClickHouse/pull/89314) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Previously, text index direct read optimization was applied only when all parts had a materialized text index. This PR adds partial support: if some parts have a materialized text index, those parts will use it, while parts without a materialized text index will fall back to executing the original filter expression. [#96411](https://github.com/ClickHouse/ClickHouse/pull/96411) ([Anton Popov](https://github.com/CurtizJ)).
* Added `minmax` secondary indexes on time columns and `bloom_filter` indexes on `query_id`/`initial_query_id` columns to system log tables for faster filtering. [#96712](https://github.com/ClickHouse/ClickHouse/pull/96712) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Lazy materialization optimization is now applied to all branches of a `UNION ALL` query, not just the first one. Queries that combine multiple sorted and limited reads from different `MergeTree` tables via `UNION ALL` will now benefit from deferred column reading on every branch, reducing I/O. [#96832](https://github.com/ClickHouse/ClickHouse/pull/96832) ([Federico Ginosa](https://github.com/menxit)).
* Optimize minmax skip index computation during INSERT by removing an unnecessary data copy and enabling vectorized min/max calculation for numeric columns. [#97392](https://github.com/ClickHouse/ClickHouse/pull/97392) ([Raúl Marín](https://github.com/Algunenano)).
* Storage `DeltaLake` now takes `count()` result from delta lake metadata and shows correct table stats in system.tables (total bytes/rows). [#96190](https://github.com/ClickHouse/ClickHouse/pull/96190) ([Kseniia Sumarokova](https://github.com/kssenii)).
* The unused columns are removed also from the reading step in case of reading from a MergeTree. It is especially useful when a filter is pushed down into `PREWHERE`. [#89982](https://github.com/ClickHouse/ClickHouse/pull/89982) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Improved processing `SHOW TABLES` query by fetching only names of tables and improved getLightweightTablesIterator to return structure containing only table names. resolves [#93835](https://github.com/ClickHouse/ClickHouse/issues/93835). [#94467](https://github.com/ClickHouse/ClickHouse/pull/94467) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Improve `assumeNotNull`, `coalesce`, `ifNull` to enable primary key and skip index pruning for range predicates when key columns are wrapped in these functions. Closes [#94689](https://github.com/ClickHouse/ClickHouse/issues/94689). [#94754](https://github.com/ClickHouse/ClickHouse/pull/94754) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Add with\_data & with\_stat extension to getChildren Keeper request. This allows fetching not only the list of children, but also their `stat` and/or `data` in a single operation. [#94826](https://github.com/ClickHouse/ClickHouse/pull/94826) ([Nikolay Degterinsky](https://github.com/evillique)).
* The index analysis is done only once (in most cases) regardless of whether we end up executing a local plan or a plan with parallel replicas. [#94854](https://github.com/ClickHouse/ClickHouse/pull/94854) ([Nikita Taranov](https://github.com/nickitat)).
* Allow to enable distributed index analysis based on amount of parts (`distributed_index_analysis_min_parts_to_activate`) and indexes size (`distributed_index_analysis_min_indexes_size_to_activate`). [#95216](https://github.com/ClickHouse/ClickHouse/pull/95216) ([Azat Khuzhin](https://github.com/azat)).
* Enable PREWHERE optimization for Iceberg tables. [#95476](https://github.com/ClickHouse/ClickHouse/pull/95476) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Reduce the memory footprint of some AST classes. [#95514](https://github.com/ClickHouse/ClickHouse/pull/95514) ([Raúl Marín](https://github.com/Algunenano)).
* Limit the number of pipeline streams generated with `split_intersecting_parts_ranges_into_layers` enabled. Helps to avoid excessive memory consumption. [#96478](https://github.com/ClickHouse/ClickHouse/pull/96478) ([Nikita Taranov](https://github.com/nickitat)).
* Implement equivalent sets optimization for multiple joins. Queries with multiple consecutive `INNER JOIN` operations now benefit from improved filter pushdown optimization. When tables are joined on equivalent columns (e.g., `t1 JOIN t2 ON t1.id = t2.id JOIN t3 ON t2.id = t3.id WHERE t1.id > 10`), filters applied to any table in the chain are automatically pushed down to all tables. Close [#96550](https://github.com/ClickHouse/ClickHouse/issues/96550). [#96596](https://github.com/ClickHouse/ClickHouse/pull/96596) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Optimize delta lake metadata scan. Uses changes from delta-kernel PR [https://github.com/delta-io/delta-kernel-rs/pull/1827](https://github.com/delta-io/delta-kernel-rs/pull/1827). [#96686](https://github.com/ClickHouse/ClickHouse/pull/96686) ([Kseniia Sumarokova](https://github.com/kssenii)).
* In Replicated database, don't update the cached cluster for every dummy query. [#96897](https://github.com/ClickHouse/ClickHouse/pull/96897) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Use the primary key index when filtering with `startsWithUTF8` if the prefix contains only ASCII characters. [#97055](https://github.com/ClickHouse/ClickHouse/pull/97055) ([vkcku](https://github.com/vkcku)).

<h4 id="262-improvement">
  Improvement
</h4>

* Add OpenTelemetry tracing for Keeper requests. [#91332](https://github.com/ClickHouse/ClickHouse/pull/91332) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* New configuration options: `logger.startup_console_level` & `logger.shutdown_console_level` to allow for overriding the console log level during the startup & shutdown of ClickHouse respectively. [#95919](https://github.com/ClickHouse/ClickHouse/pull/95919) ([Garrett Thomas](https://github.com/garrettthomaskth)).
* Respect command-line overrides when reloading configuration. Closes [#80294](https://github.com/ClickHouse/ClickHouse/issues/80294). [#80295](https://github.com/ClickHouse/ClickHouse/pull/80295) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Allow key-value overrides for named collection parameters in `mongodb` table function. [#89616](https://github.com/ClickHouse/ClickHouse/pull/89616) ([vanchaklar](https://github.com/vanchaklar)).
* The read-in-order optimization for Iceberg tables now works with complex sorting functions like `icebergBucket` and `icebergTruncate`, not just simple column references. [#90256](https://github.com/ClickHouse/ClickHouse/pull/90256) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Add a new column named parts\_postpone\_reasons in system.mutations to improve diagnostics, which shows the parts postpone reasons. [#92206](https://github.com/ClickHouse/ClickHouse/pull/92206) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Track changes in the number of rows to read (due to inserts/deletes or query condition cache usage) in `DataflowStatisticsCache`. [#93636](https://github.com/ClickHouse/ClickHouse/pull/93636) ([Nikita Taranov](https://github.com/nickitat)).
* Support SYSTEM RESET DDL WORKER \[ON CLUSTER] query. It requests to reset the state of DDLWorker in its main thread. It is helpful to refresh the replica active when host IDs are updated. [#93780](https://github.com/ClickHouse/ClickHouse/pull/93780) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Support `mutation_ids` in `system.part_log` for event type of `MUTATE_PART` and `MUTATE_PART_START`. [#93811](https://github.com/ClickHouse/ClickHouse/pull/93811) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Background operations (Mutate, Merge) can now be configured independently via 'background' profile. Previously such operations shared settings with regular queries via 'default' profile. [#93905](https://github.com/ClickHouse/ClickHouse/pull/93905) ([Arsen Muk](https://github.com/arsenmuk)).
* Add more information to `system.crash_log`. [#94112](https://github.com/ClickHouse/ClickHouse/pull/94112) [#95857](https://github.com/ClickHouse/ClickHouse/pull/95857) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Added new `QueryNonInternal` metric to track the number of executing non-internal queries. This metric is exposed as `ClickHouseMetrics_QueryNonInternal` and helps operators monitor query concurrency against the `max_concurrent_queries` limit, which only applies to non-internal queries. [#94284](https://github.com/ClickHouse/ClickHouse/pull/94284) ([Ashwath Singh](https://github.com/ashwath)).
* Support input bytes statistics collection for columns from compact parts in `RuntimeDataflowStatisticsCacheUpdater`. [#94626](https://github.com/ClickHouse/ClickHouse/pull/94626) ([Nikita Taranov](https://github.com/nickitat)).
* Add a check for Keeper misconfiguration leading to cluster assembly failures. Closes [#60932](https://github.com/ClickHouse/ClickHouse/issues/60932). [#94682](https://github.com/ClickHouse/ClickHouse/pull/94682) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Improve JSON prefixes deserialization during part loading. [#94848](https://github.com/ClickHouse/ClickHouse/pull/94848) ([Pavel Kruglov](https://github.com/Avogar)).
* Refactor the write using full INSERT pipeline, which triggers materialized views on the target table. [#94890](https://github.com/ClickHouse/ClickHouse/pull/94890) ([Kai Zhu](https://github.com/nauu)).
* Use vector similarity search plan optimizations only if the index exists for the search column. [#94998](https://github.com/ClickHouse/ClickHouse/pull/94998) ([Eduard Karacharov](https://github.com/korowa)).
* Check for the total memory limit before the user authentication and throw `(total) memory limit exceeded` if the total limit is more than allowed. [#95003](https://github.com/ClickHouse/ClickHouse/pull/95003) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Added the `throw_on_unmatched_row_policies` configuration option which, when enabled, throws an exception if a user queries a table that has row policies but none of them apply to that user — preventing the ambiguous behavior of returning all rows due to access control misconfiguration. [#95014](https://github.com/ClickHouse/ClickHouse/pull/95014) ([Vitaly Baranov](https://github.com/vitlibar)).
* Dynamic update s3 access tokens in long queries with unity catalog. This closes [#93981](https://github.com/ClickHouse/ClickHouse/issues/93981). [#95069](https://github.com/ClickHouse/ClickHouse/pull/95069) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Disable jemalloc's dirty page decay if ClickHouse is under sustained memory pressure for `memory_worker_decay_adjustment_period_ms` milliseconds. Enable jemalloc's dirty page decay back if ClickHouse is working under normal conditions for same amount of time. [#95145](https://github.com/ClickHouse/ClickHouse/pull/95145) ([Antonio Andelic](https://github.com/antonio2368)).
* S3Queue auxiliary Zookeeper support using `keeper_path` setting from s3Queue. [#95203](https://github.com/ClickHouse/ClickHouse/pull/95203) ([Diego Nieto](https://github.com/lesandie)).
* Respect `max_parts_to_merge_at_once` in TTL drop part merges. [#95315](https://github.com/ClickHouse/ClickHouse/pull/95315) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Add `connection_address` and `connection_port` to query\_log to reflect physical connection (`address` and `port` are replaced when connected through proxy and auth\_use\_forwarded\_address=1). [#95471](https://github.com/ClickHouse/ClickHouse/pull/95471) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix incorrect memory accounting for the query conditions cache. The key problem was that it didn't take into account the cache key that composed of several strings (like part\_name, the table id and the whole SQL condition). [#95478](https://github.com/ClickHouse/ClickHouse/pull/95478) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Server started with the embedded configuration will allow to manipulate users and grants, saving them to the `access` directory, as the regular configuration does. This improves testing. Also enabled all access\_control\_improvements in the embedded config and in clickhouse-local. [#95481](https://github.com/ClickHouse/ClickHouse/pull/95481) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improved S3 authentication error messages to include a hint to check credentials when access is denied. [#95648](https://github.com/ClickHouse/ClickHouse/pull/95648) ([Gerald Latkovic](https://github.com/batkovic75)).
* Enable statistics cache and set the update period of cache to 300s. [#95841](https://github.com/ClickHouse/ClickHouse/pull/95841) ([Han Fei](https://github.com/hanfei1991)).
* Add component name to `system.aggregated_zookeeper_log`. [#95882](https://github.com/ClickHouse/ClickHouse/pull/95882) ([Antonio Andelic](https://github.com/antonio2368)).
* Skip object storage reads when querying `DeltaLake` tables from `system.tables`. [#95899](https://github.com/ClickHouse/ClickHouse/pull/95899) ([Antonio Andelic](https://github.com/antonio2368)).
* Enable `enable_max_bytes_limit_for_min_age_to_force_merge` by default if the `compatibility` setting is `26.2` or higher. [#95917](https://github.com/ClickHouse/ClickHouse/pull/95917) ([Christoph Wurm](https://github.com/cwurm)).
* Delta Lake is now available on macOS. Closes #95979. [#95985](https://github.com/ClickHouse/ClickHouse/pull/95985) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In previous versions, when combining conflicting ALTER expressions with UPDATE and RENAME COLUMN, a logical error was thrown instead of a proper exception. Closes [#70678](https://github.com/ClickHouse/ClickHouse/issues/70678). [#96022](https://github.com/ClickHouse/ClickHouse/pull/96022) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve the help output for all ClickHouse applications and add a --no-sudo option with a few fixes. This is a continuation of [#58244](https://github.com/ClickHouse/ClickHouse/issues/58244) from [Ilya Yatsishin](https://github.com/qoega). [#96025](https://github.com/ClickHouse/ClickHouse/pull/96025) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add `distanceCosine` alias for `cosineDistance` because all other distance functions already have alias of this form. [#96065](https://github.com/ClickHouse/ClickHouse/pull/96065) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Add support for the `with_data` Keeper extension to improve table fetching in Database Replicated. [#96090](https://github.com/ClickHouse/ClickHouse/pull/96090) ([Nikolay Degterinsky](https://github.com/evillique)).
* Update chdig to [v26.2.1](https://github.com/azat/chdig/releases/tag/v26.2.1) (new features and MacOS support). [#96113](https://github.com/ClickHouse/ClickHouse/pull/96113) ([Azat Khuzhin](https://github.com/azat)).
* Improve filter pushdown for `numbers` and `primes`. ClickHouse can now derive conservative value bounds from `WHERE` conditions when exact bounds cannot be derived, and restrict sequence generation accordingly (for example, for `WHERE number % 5 < 2 AND number > 100 AND number < 300`, ClickHouse will only generate numbers between 100 and 300, then apply the predicate), avoiding unbounded scans. Closes [#84853](https://github.com/ClickHouse/ClickHouse/issues/84853). Closes [#93913](https://github.com/ClickHouse/ClickHouse/issues/93913). [#96115](https://github.com/ClickHouse/ClickHouse/pull/96115) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* The formatter previously wrapped SELECT in parentheses when a `COMMENT` clause was present to disambiguate parsing. Instead, output `COMMENT` before `AS SELECT`, which eliminates the ambiguity without parentheses. [#96293](https://github.com/ClickHouse/ClickHouse/pull/96293) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The `allow_impersonate_user` config setting is now located inside the `access_control_improvements` section rather than being a standalone server setting. [#96451](https://github.com/ClickHouse/ClickHouse/pull/96451) ([Vitaly Baranov](https://github.com/vitlibar)).
* Make `core_dump.size_limit` configuration setting hot-reloadable, to avoid having to restart servers for configuration changes to take place. [#96524](https://github.com/ClickHouse/ClickHouse/pull/96524) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Improves CPU and real-time profiler interoperability with socket timeouts. [#96601](https://github.com/ClickHouse/ClickHouse/pull/96601) ([Sergei Trifonov](https://github.com/serxa)).
* Prevent the resurrection of dropped data if ADD COLUMN is run quickly after the DROP COLUMN mutation. [#96713](https://github.com/ClickHouse/ClickHouse/pull/96713) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Change `function_id` type in `system.instrumentation` from LowCardinality(Int32) to Int32. [#96726](https://github.com/ClickHouse/ClickHouse/pull/96726) (Copilot).
* Synchronous waiting for mutations will respect query cancellation and time limits. [#96756](https://github.com/ClickHouse/ClickHouse/pull/96756) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added system command `SYSTEM RELOAD DELTA KERNEL TRACING <level>` to be able to change delta-kernel logging, which can be useful for debugging. [#96763](https://github.com/ClickHouse/ClickHouse/pull/96763) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Filtering by IP address family, i.e. `dns_allow_resolve_names_to_ipv4/ipv6` settings, are applied even if DNS cache is disabled. [#96810](https://github.com/ClickHouse/ClickHouse/pull/96810) ([c-end](https://github.com/c-end)).
* Better jemalloc introspection. [#96840](https://github.com/ClickHouse/ClickHouse/pull/96840) ([Azat Khuzhin](https://github.com/azat)).
* Fix `/play` Web UI throwing `QUERY_CACHE_USED_WITH_SYSTEM_TABLE` when querying system tables. [#96869](https://github.com/ClickHouse/ClickHouse/pull/96869) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve Web UI: change favicon to indicate running query state; display errors from auxiliary queries (loading databases and tables) instead of silently ignoring them. Closes [#85055](https://github.com/ClickHouse/ClickHouse/issues/85055). [#96883](https://github.com/ClickHouse/ClickHouse/pull/96883) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Make the left panel in `/play` UI clickable to toggle the database list. [#96884](https://github.com/ClickHouse/ClickHouse/pull/96884) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `DROP DATABASE` now drops tables in reverse dependency order, improving crash-safety when the database contains tables with loading dependencies (e.g. `Distributed` tables using `joinGet`). [#97057](https://github.com/ClickHouse/ClickHouse/pull/97057) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Bump yaml-cpp to prevent skipping invalid YAML. [#97333](https://github.com/ClickHouse/ClickHouse/pull/97333) ([Azat Khuzhin](https://github.com/azat)).
* Show a loading indicator in the `play.html` sidebar while tables are being fetched. [#97531](https://github.com/ClickHouse/ClickHouse/pull/97531) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add a copy-to-clipboard button for raw query results in the built-in web UI (play.html). [#97532](https://github.com/ClickHouse/ClickHouse/pull/97532) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix query obfuscator (`clickhouse-format --obfuscate`) to produce parseable SQL in more cases. [#97584](https://github.com/ClickHouse/ClickHouse/pull/97584) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="262-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* After metadata-only ALTERs, such as extending the elements of Enums, the optimization of aggregation with projection may end up producing an exception. [#84143](https://github.com/ClickHouse/ClickHouse/pull/84143) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Materialized views now use the database where they were created as execution context, meaning that: - it is possible to omit explicit database qualification on names referred in view's select query - if no explicit database qualification is given, the same database where the materialized view was created is assumed. [#88193](https://github.com/ClickHouse/ClickHouse/pull/88193) ([Dmitry Kovalev](https://github.com/dk-github)).
* Fix query parameter substitution in CREATE USER authentication methods when using ON CLUSTER. Query parameters in authentication methods (e.g., password) were not being replaced, causing UNKNOWN\_QUERY\_PARAMETER errors on remote nodes. [#92777](https://github.com/ClickHouse/ClickHouse/pull/92777) ([xiaohuanlin](https://github.com/xiaohuanlin)).
* Fixed inconsistencies in text index analysis for `has`, `mapContainsKey`, and `mapContainsValue` functions. Previously, queries using these functions could return different results depending on whether the expression was evaluated with or without a text index. [#93578](https://github.com/ClickHouse/ClickHouse/pull/93578) ([Anton Popov](https://github.com/CurtizJ)).
* Fix crash when attaching a table to a `MaterializedPostgreSQL` database if `dropReplicationSlot` throws during stack unwinding. [#96871](https://github.com/ClickHouse/ClickHouse/pull/96871) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Backups could crash the server if you do many concurrent backups clashing over the same files. [#93659](https://github.com/ClickHouse/ClickHouse/pull/93659) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixes queries with parallel replicas and JOIN with non-MT table. Closes [#92056](https://github.com/ClickHouse/ClickHouse/issues/92056). [#93902](https://github.com/ClickHouse/ClickHouse/pull/93902) ([Igor Nikonov](https://github.com/devcrafter)).
* Fixes an issue when Iceberg columns with dot in names returned NULL as values. [#94335](https://github.com/ClickHouse/ClickHouse/pull/94335) ([Mikhail Koviazin](https://github.com/mkmkme)).
* Fixed handling of UTF8 strings in `stringJaccardIndexUTF8` and improve performance. [#94613](https://github.com/ClickHouse/ClickHouse/pull/94613) ([Joanna Hulboj](https://github.com/jh0x)).
* Fix possible overflows in `WITH FILL STALENESS` (that leads to UB or/and endless loops). Fix possible endless loop due to big jumps. Add old analyzer support (mostly for stress tests). [#94663](https://github.com/ClickHouse/ClickHouse/pull/94663) ([Azat Khuzhin](https://github.com/azat)).
* Fix possible hung distributed queries when hostnames resolve to multiple addresses and a remote replica freezes. [#94726](https://github.com/ClickHouse/ClickHouse/pull/94726) ([c-end](https://github.com/c-end)).
* Fix invalid result on joining multiple table expressions, when leftmost table expression is a `-Cluster` table function. Resolves [#89996](https://github.com/ClickHouse/ClickHouse/issues/89996). [#94748](https://github.com/ClickHouse/ClickHouse/pull/94748) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Fix incorrect primary key and skip index pruning for predicates involving `toWeek`, `toYearWeek`, `toStartOfWeek`, `toLastDayOfWeek`, and `toDayOfWeek`, and fix exceptions in some of these functions for valid queries with `LowCardinality(String)`. [#94816](https://github.com/ClickHouse/ClickHouse/pull/94816) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Remove unnecessary skip permissions check in `ATTACH` queries for a view with SQL Security. This prevents potential privilege escalation when a user attaches a view with a definer without validating required access. [#94865](https://github.com/ClickHouse/ClickHouse/pull/94865) ([pufit](https://github.com/pufit)).
* Fixes a crash during `ReplicatedMergeTree` startup caused by concurrent removal of `delete_tmp_*` directories. [#94892](https://github.com/ClickHouse/ClickHouse/pull/94892) ([myeongjun](https://github.com/myeongjjun)).
* Fix `INSERT` into Iceberg tables with materialized views losing deduplication information, which caused an exception. [#94938](https://github.com/ClickHouse/ClickHouse/pull/94938) ([Daniil Ivanik](https://github.com/divanik)).
* Fix a bug where `SYSTEM DROP QUERY CACHE TAG 'TAGNAME' ON CLUSTER <CLUSTERNAME>` would drop the full cache on the cluster. [#94978](https://github.com/ClickHouse/ClickHouse/pull/94978) ([Rory Crispin](https://github.com/RoryCrispin)).
* Preserve constant index granularity (use\_const\_adaptive\_granularity) after Vertical merges (v2 with a fix for Nested, and in general). [#95013](https://github.com/ClickHouse/ClickHouse/pull/95013) ([Azat Khuzhin](https://github.com/azat)).
* Fixes race in filesystem cache in version 26.1 after \[ClickHouse/ClickHouse[#82764](https://github.com/ClickHouse/ClickHouse/issues/82764)]\([https://github.com/ClickHouse/ClickHouse/pull/82764](https://github.com/ClickHouse/ClickHouse/pull/82764)). [#95042](https://github.com/ClickHouse/ClickHouse/pull/95042) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix postgresql() table function canceling by KILL QUERY and cancel query (Ctrl+C) in clickhouse-client. [#95136](https://github.com/ClickHouse/ClickHouse/pull/95136) ([Roman Vasin](https://github.com/rvasin)).
* Fixed type inference for qualified columns from source tables when multiple joins are used with `USING` clause. Previously, subsequent joins incorrectly updated types of underlying source columns to a common supertype even when the column was not involved in that join (e.g., in `SELECT t2.a FROM t1 LEFT JOIN t2 USING (a) LEFT JOIN t3 USING (a)`, the `t2.a` column is only used by the first join, so its type should be the supertype of `t1.a` and `t2.a`, excluding `t3.a`). This could lead to logical errors or crashes when functions expected different column types than what actually appeared in the execution plan. [#95157](https://github.com/ClickHouse/ClickHouse/pull/95157) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Make column transform only once during getting content of manifest .avro list and files. [#95164](https://github.com/ClickHouse/ClickHouse/pull/95164) ([Daniil Ivanik](https://github.com/divanik)).
* Fix incorrect calculation of JSON column sizes that could lead to excessive memory usage or wrong column statistics. [#95207](https://github.com/ClickHouse/ClickHouse/pull/95207) ([Azat Khuzhin](https://github.com/azat)).
* Fixed inaccurate memory accounting when applying large patch parts after lightweight updates. Previously, applying large patches could cause excessive memory usage and result in the server process being killed by the OOM killer. [#95231](https://github.com/ClickHouse/ClickHouse/pull/95231) ([Anton Popov](https://github.com/CurtizJ)).
* Fix undefined behavior that could cause incorrect results or an exception when a distributed query with `max_parallel_replicas` fell back to a local replica during index analysis. [#95263](https://github.com/ClickHouse/ClickHouse/pull/95263) ([Azat Khuzhin](https://github.com/azat)).
* Fix aggregation of sparse columns for `sum` and timeseries when `group_by_overflow_mode` is set to `any`. [#95301](https://github.com/ClickHouse/ClickHouse/pull/95301) ([Mikhail Koviazin](https://github.com/mkmkme)).
* Fix a reliability issue in `plain_rewritable` disk policy where a network error mid-way through unlinking a metadata file could leave the storage in an inconsistent state. [#95302](https://github.com/ClickHouse/ClickHouse/pull/95302) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Replace Date with Date32 for iceberg. [#95322](https://github.com/ClickHouse/ClickHouse/pull/95322) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* The password argument of the `redis` table function now will be masked in the logs and system tables (e.g.: `query_log`). [#95325](https://github.com/ClickHouse/ClickHouse/pull/95325) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix a bug where tables could be dropped or altered while a distributed query was still executing against them, potentially causing exceptions or incorrect results. [#95356](https://github.com/ClickHouse/ClickHouse/pull/95356) ([Azat Khuzhin](https://github.com/azat)).
* Fix a logical error in some cases when negative `LIMIT/OFFSET` is used in distributed queries. [#95357](https://github.com/ClickHouse/ClickHouse/pull/95357) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix a bug where clickhouse-client would ask for password twice when connecting using ssh. [#95372](https://github.com/ClickHouse/ClickHouse/pull/95372) ([Isak Ellmer](https://github.com/spinojara)).
* Fix a data race in storage S3(Azure)Queue. [#95385](https://github.com/ClickHouse/ClickHouse/pull/95385) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix the prewhere filter error caused by lambda expressions in prewhere. [#95395](https://github.com/ClickHouse/ClickHouse/pull/95395) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
* Fix `optimize_syntax_fuse_functions` to not rewrite `sum/count/avg` into `sumCount()` when the aggregate argument is `Nullable`. Closes [#95390](https://github.com/ClickHouse/ClickHouse/issues/95390). [#95441](https://github.com/ClickHouse/ClickHouse/pull/95441) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Avoid possible crash for distributed queries in case of cancellation. [#95466](https://github.com/ClickHouse/ClickHouse/pull/95466) ([Aleksandr Musorin](https://github.com/AVMusorin)).
* Fix deduplication for streaming from S3(Azure)Queue engine. [#95467](https://github.com/ClickHouse/ClickHouse/pull/95467) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix updating row policies assigned to the initial user in distributed queries. [#95469](https://github.com/ClickHouse/ClickHouse/pull/95469) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix check for encrypted disks over plain\_rewritable (Fixes possible `It is not possible to register multiple plain-rewritable disks with the same object storage prefix`). [#95470](https://github.com/ClickHouse/ClickHouse/pull/95470) ([Azat Khuzhin](https://github.com/azat)).
* The `mergeTreeProjection` table function was missing an access check, allowing users without SELECT permission on a table (but with permissions for table functions) to read data from its projections. This fix adds the same access check that `mergeTreeIndex` and `mergeTreeAnalyzeIndexes` already have. [#95480](https://github.com/ClickHouse/ClickHouse/pull/95480) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix possible logical error during reading of size subcolumn from dynamic subcolumns of Dynamic/JSON types. [#95573](https://github.com/ClickHouse/ClickHouse/pull/95573) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix regression in (experimental) zero‑copy replication introduced by [#94262](https://github.com/ClickHouse/ClickHouse/issues/94262) where shared parts could be deleted before other replicas finished fetching them. [#95597](https://github.com/ClickHouse/ClickHouse/pull/95597) ([filimonov](https://github.com/filimonov)).
* Fix crash during `tupleElement` applied to arrays of JSON. Closes [#95581](https://github.com/ClickHouse/ClickHouse/issues/95581). [#95647](https://github.com/ClickHouse/ClickHouse/pull/95647) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix logical error exception when using a matcher (`*`) inside a lambda function within a VALUES clause in a JOIN with USING. Close [#93675](https://github.com/ClickHouse/ClickHouse/issues/93675). [#95661](https://github.com/ClickHouse/ClickHouse/pull/95661) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed `There was an error: Cannot obtain error message` logical error when waiting for a distributed DDL and dropping the Replicated database concurrently. Fixes [#95539](https://github.com/ClickHouse/ClickHouse/issues/95539). [#95664](https://github.com/ClickHouse/ClickHouse/pull/95664) ([Alexander Tokmakov](https://github.com/tavplubix)).
* Fix `IN` function returning incorrect results with `NULL` values when `transform_null_in` is enabled. Closes [#65776](https://github.com/ClickHouse/ClickHouse/issues/65776). [#95674](https://github.com/ClickHouse/ClickHouse/pull/95674) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Correctly handle LowCardinality Nullable types in `CAST` when the setting `cast_keep_nullable` is enabled. Closes [#95670](https://github.com/ClickHouse/ClickHouse/issues/95670). [#95747](https://github.com/ClickHouse/ClickHouse/pull/95747) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix squashing partitioned delta lake data. [#95773](https://github.com/ClickHouse/ClickHouse/pull/95773) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix race condition for Nullable join column in runtime filters. [#95775](https://github.com/ClickHouse/ClickHouse/pull/95775) ([Hechem Selmi](https://github.com/m-selmi)).
* Fix possible logical error in query with matcher (`*`, `table.*`) and `analyzer_compatibility_join_using_top_level_identifier` when `USING` column has different types in tables and select list. Close [#90477](https://github.com/ClickHouse/ClickHouse/issues/90477). [#95808](https://github.com/ClickHouse/ClickHouse/pull/95808) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix memory safety bugs in parallel thread pool operations (backups, aggregation, distributed queries) that could cause exceptions when an error occurred during task scheduling. [#95818](https://github.com/ClickHouse/ClickHouse/pull/95818) ([Raúl Marín](https://github.com/Algunenano)).
* Fixes a crash on the DROP WORKLOAD while running concurrently with queries using the workload being dropped. [#95856](https://github.com/ClickHouse/ClickHouse/pull/95856) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix slow performance when querying system tables with a user that has limited grants on many databases. Closes [#89371](https://github.com/ClickHouse/ClickHouse/issues/89371). [#95874](https://github.com/ClickHouse/ClickHouse/pull/95874) ([pufit](https://github.com/pufit)).
* Fix executing tupleElement on JSON with nested paths, previously it could lead to wrong query result. [#95907](https://github.com/ClickHouse/ClickHouse/pull/95907) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed a `NOT_SUPPORTED` error that could occur when using the `direct` join algorithm with an empty MergeTree table. [#95935](https://github.com/ClickHouse/ClickHouse/pull/95935) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix the client not suggesting and auto-completing alias names for settings, closes [#92190](https://github.com/ClickHouse/ClickHouse/issues/92190). [#95945](https://github.com/ClickHouse/ClickHouse/pull/95945) ([phulv94](https://github.com/phulv94)).
* Fix event\_date in system.asynchronous\_metric\_log. [#95947](https://github.com/ClickHouse/ClickHouse/pull/95947) ([Raúl Marín](https://github.com/Algunenano)).
* Fix skipping paths in JSON data type. Previously with `JSON(SKIP path)` all JSON keys with prefix `path` were skipped, even keys like `"pathpath"`, so it could lead to data loss for these paths during insert. Now it's fixed and only key `"path"` is skipped. [#95948](https://github.com/ClickHouse/ClickHouse/pull/95948) ([Pavel Kruglov](https://github.com/Avogar)).
* Part with unknown projections should not be marked as lost forever. [#95952](https://github.com/ClickHouse/ClickHouse/pull/95952) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Fix empty string becoming `NULL` in `Join` table with `Nullable(String)` key. Closes [#71414](https://github.com/ClickHouse/ClickHouse/issues/71414). [#96002](https://github.com/ClickHouse/ClickHouse/pull/96002) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Now the PostgreSQL engine can correctly read `BOOLEAN[]`. Closes [#72754](https://github.com/ClickHouse/ClickHouse/issues/72754). [#96006](https://github.com/ClickHouse/ClickHouse/pull/96006) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the `ProtobufList` format for the case of reading from an empty file. Closes [#70059](https://github.com/ClickHouse/ClickHouse/issues/70059). [#96007](https://github.com/ClickHouse/ClickHouse/pull/96007) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `ProtobufList` format producing ghost record for empty tables. Closes [#72596](https://github.com/ClickHouse/ClickHouse/issues/72596). [#96010](https://github.com/ClickHouse/ClickHouse/pull/96010) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `if` function type mismatch between `UInt64` and `Int32` in an unusual case of distributed queries and PREWHERE, with type inference. Closes [#70017](https://github.com/ClickHouse/ClickHouse/issues/70017). [#96012](https://github.com/ClickHouse/ClickHouse/pull/96012) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `JIT` compiled queries involving `Bool` types. [#96013](https://github.com/ClickHouse/ClickHouse/pull/96013) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error when reading UUID column from SQLite TEXT column. Closes [#71263](https://github.com/ClickHouse/ClickHouse/issues/71263). [#96016](https://github.com/ClickHouse/ClickHouse/pull/96016) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix SQLite engine type conversion for `DateTime`, `Date`, `UUID`, and other types. Closes [#73481](https://github.com/ClickHouse/ClickHouse/issues/73481). [#96017](https://github.com/ClickHouse/ClickHouse/pull/96017) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `FixedString` values were escaped incorrectly in queries to external databases, SQLite and PostgreSQL. Closes [#73519](https://github.com/ClickHouse/ClickHouse/issues/73519). Co-authored with @jh0x. [#96019](https://github.com/ClickHouse/ClickHouse/pull/96019) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix assertion failure in WindowTransform with a large PRECEDING offset. Closes [#75852](https://github.com/ClickHouse/ClickHouse/issues/75852). [#96026](https://github.com/ClickHouse/ClickHouse/pull/96026) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a bug with possible data corruption when concurrent async inserts are using the same parameter names but contain different values. [#96035](https://github.com/ClickHouse/ClickHouse/pull/96035) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix period for global profilers (controlled by `global_profiler_real_time_period_ns` and `global_profiler_cpu_time_period_ns`). Instead of set value, a truncated value was used, causing profiler to wakeup more than intended. [#96048](https://github.com/ClickHouse/ClickHouse/pull/96048) ([Antonio Andelic](https://github.com/antonio2368)).
* Earlier if reference data file inside iceberg manifest file for position delete was present in an entry but was null, we didn't get correct bounds for a corresponding data files. This PR fixes this bug. [#96061](https://github.com/ClickHouse/ClickHouse/pull/96061) ([Daniil Ivanik](https://github.com/divanik)).
* Fix revoking default roles. [#96103](https://github.com/ClickHouse/ClickHouse/pull/96103) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix use-after-free in the index analysis in a rare combination of disabled `use_primary_key` and a very large number of disjunctions of conditions that use the index. [#96112](https://github.com/ClickHouse/ClickHouse/pull/96112) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a regression with the `Gorilla` codec when an explicitly specified size does not correspond to the data type size, and the buffer size is too small. In previous versions, it threw an exception on decompression. Closes [#78253](https://github.com/ClickHouse/ClickHouse/issues/78253). [#96118](https://github.com/ClickHouse/ClickHouse/pull/96118) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Avoid a deadlock in dictionaries loaded when one dictionary references a Merge table that references it recursively. Closes [#78360](https://github.com/ClickHouse/ClickHouse/issues/78360). [#96120](https://github.com/ClickHouse/ClickHouse/pull/96120) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix use-of-uninitialized-value in `formatDateTime` with non-fixed-width formatters, such as MySQL and JODA-style. [#96133](https://github.com/ClickHouse/ClickHouse/pull/96133) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The combination of settings `use_const_adaptive_granularity` and `index_granularity_bytes` (which means "non-adaptive granularity") led to a miscalculation of the number of rows to read and an exception. [#96143](https://github.com/ClickHouse/ClickHouse/pull/96143) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Running an invalid ALTER UPDATE mutation on object storage file-like tables, such as S3 and Azure, could lead to a nullptr dereference. Closes [#92994](https://github.com/ClickHouse/ClickHouse/issues/92994). [#96162](https://github.com/ClickHouse/ClickHouse/pull/96162) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `AccessRights::contains` returning incorrect results with partial revokes. [#96170](https://github.com/ClickHouse/ClickHouse/pull/96170) ([pufit](https://github.com/pufit)).
* Fix query condition cache hash collision for CTE folded constants, which could lead to a wrong query result. Closes [#96060](https://github.com/ClickHouse/ClickHouse/issues/96060). [#96172](https://github.com/ClickHouse/ClickHouse/pull/96172) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix possible deadlock in ProcessList. It can happen because of possible lock inversion if memory overcommit tracker triggers when we are adding task to cancellation checker. [#96182](https://github.com/ClickHouse/ClickHouse/pull/96182) ([Antonio Andelic](https://github.com/antonio2368)).
* Fixed a bug where queries involving outer joins (LEFT, RIGHT, or FULL) combined with multiple INNER JOINs could return incorrect results due to illegal join reordering. When an outer join's ON condition referenced columns from multiple previously joined tables, the optimizer failed to account for all table dependencies and could reorder the joins incorrectly, producing missing rows. Close [#95972](https://github.com/ClickHouse/ClickHouse/issues/95972). [#96193](https://github.com/ClickHouse/ClickHouse/pull/96193) ([Vladimir Cherkasov](https://github.com/vdimir)).
* When a table has no statistics defined, ClickHouse shouldn't try to load them. This avoids some overhead (100+ms) for checking if the statistics files exist. (issue [#96068](https://github.com/ClickHouse/ClickHouse/issues/96068)). [#96233](https://github.com/ClickHouse/ClickHouse/pull/96233) ([Han Fei](https://github.com/hanfei1991)).
* Fix `optimize_syntax_fuse_functions` to not rewrite `sum/count/avg` into `sumCount()` when the aggregate argument is `LowCardinality(Nullable)`. Closes [#95390](https://github.com/ClickHouse/ClickHouse/issues/95390). [#96239](https://github.com/ClickHouse/ClickHouse/pull/96239) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix incorrect partition pruning for `not IN` and `not has` function in some cases. [#96241](https://github.com/ClickHouse/ClickHouse/pull/96241) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `stack-use-after-scope` in the vector similarity index. [#96259](https://github.com/ClickHouse/ClickHouse/pull/96259) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix test runner not recognizing error hint comments when a query is preceded by a SQL comment. [#96336](https://github.com/ClickHouse/ClickHouse/pull/96336) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Fix logical error in KeyCondition when a table has a nullable primary key, and the query uses the `coalesce` function, which has its first argument constant. [#96340](https://github.com/ClickHouse/ClickHouse/pull/96340) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* The interaction of `GROUPING SETS`, `group_by_use_nulls`, and the `Tuple` data type with `LowCardinality` inside it, could produce an unexpected block structure in the query pipeline, which led to a logical error. This appeared after the introduction of `Nullable` `Tuple`s. [#96358](https://github.com/ClickHouse/ClickHouse/pull/96358) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* It was possible to create a table with an empty expression `()` as an index, which led to an invalid memory access. [#96363](https://github.com/ClickHouse/ClickHouse/pull/96363) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed crash in old analyzer if JOIN and duplicated aliases. [#96405](https://github.com/ClickHouse/ClickHouse/pull/96405) ([Ilya Golshtein](https://github.com/ilejn)).
* Fix `Nested columns sizes are inconsistent with local_discriminators` error due to a wrong in-place filtering optimization for Variant columns. [#96410](https://github.com/ClickHouse/ClickHouse/pull/96410) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `CREATE TABLE ... CLONE AS ...` ignoring full qualifier of source table. [#96415](https://github.com/ClickHouse/ClickHouse/pull/96415) ([Hasyimi Bahrudin](https://github.com/hasyimibhar)).
* Fix `mysql` table function canceling by KILL QUERY and cancel query (Ctrl+C) in clickhouse-client. [#96437](https://github.com/ClickHouse/ClickHouse/pull/96437) ([Roman Vasin](https://github.com/rvasin)).
* Fixes livelock in the cancellation checker thread for queries with high `max_execution_time` values. [#96450](https://github.com/ClickHouse/ClickHouse/pull/96450) ([Sergei Trifonov](https://github.com/serxa)).
* Fix a logical error in some cases when fractional `LIMIT/OFFSET` is used in distributed queries. [#96475](https://github.com/ClickHouse/ClickHouse/pull/96475) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix null pointer dereference in certain expressions with lambda functions. [#96479](https://github.com/ClickHouse/ClickHouse/pull/96479) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect results when `LowCardinality` columns are converted to `Nullable`. [#96483](https://github.com/ClickHouse/ClickHouse/pull/96483) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix a crash when creating an Iceberg table with an `ORDER BY` clause referencing a non-existent column or using a positional argument. Closes [#93280](https://github.com/ClickHouse/ClickHouse/issues/93280). [#96484](https://github.com/ClickHouse/ClickHouse/pull/96484) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix runtime filter exception for Tuple columns with Nullable subfields. [#96509](https://github.com/ClickHouse/ClickHouse/pull/96509) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception in Parquet V3 native reader when `PREWHERE` filter column contains non-boolean UInt8 values. [#96594](https://github.com/ClickHouse/ClickHouse/pull/96594) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix implicit index regeneration in replicated tables during metadata changes. [#96600](https://github.com/ClickHouse/ClickHouse/pull/96600) ([Raúl Marín](https://github.com/Algunenano)).
* Fixes a datarace on DROP WORKLOAD. [#96614](https://github.com/ClickHouse/ClickHouse/pull/96614) ([Sergei Trifonov](https://github.com/serxa)).
* Fix a bug in Iceberg table writes where partitioned inserts could produce incorrect data distribution across partition files. [#96620](https://github.com/ClickHouse/ClickHouse/pull/96620) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fixed `heap-use-after-free` in `CREATE TABLE` with constraints. [#96669](https://github.com/ClickHouse/ClickHouse/pull/96669) ([Nikita Taranov](https://github.com/nickitat)).
* Validate witness version in bech32 to avoid buffer overflow. [#96671](https://github.com/ClickHouse/ClickHouse/pull/96671) ([Raúl Marín](https://github.com/Algunenano)).
* Fix `system.tables` returning errors when a Data Lake REST catalog is created with an invalid `auth_header` setting. [#96680](https://github.com/ClickHouse/ClickHouse/pull/96680) ([Han Fei](https://github.com/hanfei1991)).
* Fix `min(timestamp)` returning epoch (`1970-01-01`) via `_minmax_count_projection` after TTL merge when all rows in a block are filtered out. [#96703](https://github.com/ClickHouse/ClickHouse/pull/96703) ([Raquel Barbadillo](https://github.com/rbarbadillo)).
* Improve validation of the `iceberg_metadata_file_path` setting to prevent path traversal and ensure the specified metadata file is within the table directory. [#96754](https://github.com/ClickHouse/ClickHouse/pull/96754) ([Daniil Ivanik](https://github.com/divanik)).
* Fix crash in `ifNull` with `Variant` argument used in `GROUP BY`. [#96790](https://github.com/ClickHouse/ClickHouse/pull/96790) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fixed cache key collisions between tables with `table_disk=1` setting. [#96818](https://github.com/ClickHouse/ClickHouse/pull/96818) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix MemoryWorker's purging thread being stuck because of a race condition. [#96819](https://github.com/ClickHouse/ClickHouse/pull/96819) ([Antonio Andelic](https://github.com/antonio2368)).
* Don't log data with credentials in iceberg catalogs. [#96831](https://github.com/ClickHouse/ClickHouse/pull/96831) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix exit status of clickhouse-client after server error. [#96841](https://github.com/ClickHouse/ClickHouse/pull/96841) ([Vitaly Baranov](https://github.com/vitlibar)).
* Queries with CROSS JOINs and enabled parallel replicas could return incorrect result. Fixes [#74337](https://github.com/ClickHouse/ClickHouse/issues/74337). [#96848](https://github.com/ClickHouse/ClickHouse/pull/96848) ([Igor Nikonov](https://github.com/devcrafter)).
* Fixed `ALTER TABLE DROP COLUMN` queries failing after a lightweight update was previously performed on the same column. [#96861](https://github.com/ClickHouse/ClickHouse/pull/96861) ([Anton Popov](https://github.com/CurtizJ)).
* Fix stack overflow (crash) when creating archive-based backups (`.zip`, `.tzst`) to a `plain_rewritable` object storage disk. [#96872](https://github.com/ClickHouse/ClickHouse/pull/96872) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix server crash when backup fails due to full disk or other I/O errors on the destination filesystem. [#96873](https://github.com/ClickHouse/ClickHouse/pull/96873) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `EXCEPT ALL` and `INTERSECT ALL` ignoring row multiplicities and behaving like their `DISTINCT` counterparts. [#96876](https://github.com/ClickHouse/ClickHouse/pull/96876) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `std::terminate` exception in `indexOfAssumeSorted` when called with incompatible types (e.g., `IPv4` array with integer search value). [#96877](https://github.com/ClickHouse/ClickHouse/pull/96877) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception `Bad cast from type DB::ColumnNullable to DB::ColumnString` when using window functions with `group_by_use_nulls = 1` and CUBE/ROLLUP/GROUPING SETS. [#96878](https://github.com/ClickHouse/ClickHouse/pull/96878) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect results when JIT-compiled expressions convert `DateTime` to `DateTime64` (e.g., in `CASE`/`if`/`multiIf` with mixed DateTime types). The value was reinterpreted instead of properly scaled, producing wrong timestamps after expression compilation kicked in. [#96879](https://github.com/ClickHouse/ClickHouse/pull/96879) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception in `CoalescingMergeTree` when a skip index expression produces a constant column (e.g., `bloom_filter` on `ifNotFinite(1, c0)` for an integer column). [#96880](https://github.com/ClickHouse/ClickHouse/pull/96880) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix wrong port number in error message when accidentally connecting with HTTP to the TLS-enabled native protocol port. [#96881](https://github.com/ClickHouse/ClickHouse/pull/96881) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix per-subquery `SETTINGS` not being applied to table functions like `file` in CTEs and subqueries. [#96882](https://github.com/ClickHouse/ClickHouse/pull/96882) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix memory leak of BIO objects when reading X509 certificates. [#96885](https://github.com/ClickHouse/ClickHouse/pull/96885) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception in query analyzer when a lambda expression is passed where a concrete value is expected (e.g., as the accumulator argument of `arrayFold`). [#96892](https://github.com/ClickHouse/ClickHouse/pull/96892) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `ColumnNullable is not compatible with original` exception when casting complex nested types (Array of Nullable Tuple containing Map with Nullable Enum values). [#96924](https://github.com/ClickHouse/ClickHouse/pull/96924) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a race condition in sharded `HASHED` dictionary parallel loading that could occasionally cause some rows to not be loaded. [#96953](https://github.com/ClickHouse/ClickHouse/pull/96953) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a race condition between `REPLACE PARTITION` and background mutations that could result in both old and new data being visible after the replace. [#96955](https://github.com/ClickHouse/ClickHouse/pull/96955) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `arrayJoin` function producing duplicate rows when used with INNER JOIN and WHERE clause, caused by the partial predicate push-down optimization incorrectly pushing filters containing `arrayJoin` below a JOIN. [#96989](https://github.com/ClickHouse/ClickHouse/pull/96989) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix crash (SEGFAULT) in `clearCaches` caused by `BlockIO::operator=` not moving `query_metadata_cache`, leading to premature destruction of cached storage snapshots and use-after-free of `MergeTreeData` storage. [#96995](https://github.com/ClickHouse/ClickHouse/pull/96995) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix assertion failure in `IfTransformStringsToEnumPass` when the `if` or `transform` function returns `Nullable(String)` (e.g. with `GROUP BY ... WITH CUBE` and `group_by_use_nulls = true`). [#97002](https://github.com/ClickHouse/ClickHouse/pull/97002) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect data written during `INSERT ... SELECT` with `UNION ALL` and `JOIN`, where constant string columns could receive wrong values after block squashing. [#97019](https://github.com/ClickHouse/ClickHouse/pull/97019) ([Hasyimi Bahrudin](https://github.com/hasyimibhar)).
* Fix `assert_cast` exception (or silent data corruption in release builds) when building column statistics after `ALTER TABLE MODIFY COLUMN` changes the column type. [#97027](https://github.com/ClickHouse/ClickHouse/pull/97027) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix reads of uninitialized memory in Azure Blob Storage, SSH protocol, and Arrow Flight interfaces. [#97053](https://github.com/ClickHouse/ClickHouse/pull/97053) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix cases where indexes were affecting the result for queries with row policy/PREWHERE and FINAL. [#97076](https://github.com/ClickHouse/ClickHouse/pull/97076) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix remaining race condition between `REPLACE PARTITION` and background mutations in `MergeTree` tables that could cause old data to reappear. [#97105](https://github.com/ClickHouse/ClickHouse/pull/97105) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix implicit indices with alias columns and do full validation before creating them. [#97115](https://github.com/ClickHouse/ClickHouse/pull/97115) ([Raúl Marín](https://github.com/Algunenano)).
* Fix logical error in `FunctionVariantAdaptor` with functions requiring const arguments like `arrayROCAUC`. [#97116](https://github.com/ClickHouse/ClickHouse/pull/97116) ([Bharat Nallan](https://github.com/bharatnc)).
* Fix stuck mutations when `PartCheckThread` re-enqueues a `GET_PART` for an already-mutated part, leaving phantom entries in `parts_to_do`. [#97162](https://github.com/ClickHouse/ClickHouse/pull/97162) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix query plan row count estimation for subqueries with `ORDER BY ... LIMIT`, which could cause the optimizer to choose a suboptimal join order. [#97193](https://github.com/ClickHouse/ClickHouse/pull/97193) ([Alexander Gololobov](https://github.com/davenger)).
* Fix `LOGICAL_ERROR` exception in `FunctionVariantAdaptor` when a function operating on Variant columns returns `Nothing` type, which can happen with empty arrays in `UNION ALL` queries. [#97213](https://github.com/ClickHouse/ClickHouse/pull/97213) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a data race during S3 multipart copy operations (e.g., during `BACKUP`/`RESTORE` to S3) that could cause exceptions under concurrent access. [#97227](https://github.com/ClickHouse/ClickHouse/pull/97227) ([Azat Khuzhin](https://github.com/azat)).
* Fix `LOGICAL_ERROR` exception when `arrayJoin` in `WHERE` clause references columns from both sides of a `JOIN`. [#97239](https://github.com/ClickHouse/ClickHouse/pull/97239) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception when reading `.size` subcolumn of a sparse `Nullable(String)` in a Tuple with PREWHERE. [#97264](https://github.com/ClickHouse/ClickHouse/pull/97264) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix exception "Number of rows in lazy chunk does not match number of offsets" in `LazyMaterializingTransform` when reading from tables with non-adaptive index granularity (`index_granularity_bytes = 0`) using `ORDER BY ... LIMIT`. [#97270](https://github.com/ClickHouse/ClickHouse/pull/97270) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `SYSTEM RESTART REPLICA` losing table from database when table re-creation fails with a non-ZooKeeper exception (e.g. memory limit), causing metadata digest mismatches in `DatabaseReplicated`. [#97276](https://github.com/ClickHouse/ClickHouse/pull/97276) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Field `readonly` in `system.merge_tree_settings` now properly reflects that certain merge tree settings (e.g. `index_granularity`) are unconditionally readonly. [#97277](https://github.com/ClickHouse/ClickHouse/pull/97277) ([Robert Schulze](https://github.com/rschu1ze)).
* Fix a crash during `count()` optimization on `MergeTree` tables when the storage snapshot was created without data. [#97281](https://github.com/ClickHouse/ClickHouse/pull/97281) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix a possible crash when resolving function names from debug information for stack traces. [#97294](https://github.com/ClickHouse/ClickHouse/pull/97294) ([Azat Khuzhin](https://github.com/azat)).
* Fix logical error with analyzer\_compatibility\_join\_using\_top\_level\_identifier and ALIAS columns. Close [#96228](https://github.com/ClickHouse/ClickHouse/issues/96228). [#97297](https://github.com/ClickHouse/ClickHouse/pull/97297) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix `LOGICAL_ERROR` exception in `applyOrder` when using text-indexed columns with `QUALIFY` clause. [#97313](https://github.com/ClickHouse/ClickHouse/pull/97313) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* System table `system.functions` now shows for internal functions `categories = 'Internal'` instead of `categories = ''`. [#97315](https://github.com/ClickHouse/ClickHouse/pull/97315) ([Robert Schulze](https://github.com/rschu1ze)).
* Query with RIGHT JOIN chain and enabled parallel replicas can produce incorrect result. Fixes [#74341](https://github.com/ClickHouse/ClickHouse/issues/74341). [#97316](https://github.com/ClickHouse/ClickHouse/pull/97316) ([Igor Nikonov](https://github.com/devcrafter)).
* Fix spurious `TABLE_UUID_MISMATCH` errors that could occur with refreshable materialized views and other scenarios where tables are renamed. [#97323](https://github.com/ClickHouse/ClickHouse/pull/97323) ([Azat Khuzhin](https://github.com/azat)).
* Fix segfault in `StorageKeeperMap` backup due to use-after-free of dangling storage pointer in lazy backup batch. [#97336](https://github.com/ClickHouse/ClickHouse/pull/97336) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix the `exists` function with a scalar subquery inside an `ALTER UPDATE/DELETE` when `mutations_execute_subqueries_on_initiator` is enabled. The scalar subquery was incorrectly evaluated, which could lead to an error or a corrupt mutation command that made the table unloadable on the next server restart. [#97347](https://github.com/ClickHouse/ClickHouse/pull/97347) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Fix logical exception `Unexpected return type from equals. Expected Nullable(UInt8). Got Const(LowCardinality(Nullable(UInt8)))` when comparing NULL with a Variant column containing LowCardinality types. [#97379](https://github.com/ClickHouse/ClickHouse/pull/97379) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a possible race condition when `EXCHANGE TABLES` is executed in parallel with the sharded query cache enabled. [#97411](https://github.com/ClickHouse/ClickHouse/pull/97411) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix `LOGICAL_ERROR` exception in Array-to-`QBit` conversion when `nullable_source` from an outer `Tuple` wrapper replaces the converted array column with a mismatched column type. Closes [#97389](https://github.com/ClickHouse/ClickHouse/issues/97389). [#97413](https://github.com/ClickHouse/ClickHouse/pull/97413) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix AST formatting roundtrip inconsistency for aliased tuple literals inside parentheses, e.g., `(('a', 'b') AS x)` was incorrectly reformatted as `tuple(('a', 'b') AS x)`. [#97418](https://github.com/ClickHouse/ClickHouse/pull/97418) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix an exception during asynchronous inserts with deduplication when a parsing failure produced an empty block with zero rows. [#97460](https://github.com/ClickHouse/ClickHouse/pull/97460) ([Sema Checherinda](https://github.com/CheSema)).
* Fix exception "Number of rows in lazy chunk does not match number of offsets" in `LazyMaterializingTransform` when reading from tables with non-adaptive index granularity (`index_granularity_bytes = 0`) using `ORDER BY ... LIMIT`. [#97482](https://github.com/ClickHouse/ClickHouse/pull/97482) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix insert iceberg settings. Add alias for the `allow_experimental_insert_into_iceberg` setting. [#97483](https://github.com/ClickHouse/ClickHouse/pull/97483) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix `ACCESS_DENIED` for users without `CREATE TEMPORARY TABLE` permission when `optimize_inverse_dictionary_lookup` optimization rewrites `dictGet(...)` predicates. ClickHouse now skips the rewrite and executes the original expression. Closes [#97269](https://github.com/ClickHouse/ClickHouse/issues/97269). [#97484](https://github.com/ClickHouse/ClickHouse/pull/97484) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix assertion failure (exception in debug/sanitizer builds) in `Set` and `MergeTreeIndexSet` when processing columns with inner sparse subcolumns (e.g., `Tuple` columns from MergeTree parts with different sparse serialization profiles). [#97493](https://github.com/ClickHouse/ClickHouse/pull/97493) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a possible use after free in StorageKafka2. [#97520](https://github.com/ClickHouse/ClickHouse/pull/97520) ([Bharat Nallan](https://github.com/bharatnc)).
* Fix `INTO OUTFILE` with `TRUNCATE` and `into_outfile_create_parent_directories` setting when the output path contains directories. [#97549](https://github.com/ClickHouse/ClickHouse/pull/97549) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `BAD_ARGUMENTS` error when querying tables with lambda expressions inside ALIAS columns through the `merge()` table function with the analyzer enabled. [#97551](https://github.com/ClickHouse/ClickHouse/pull/97551) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `system.zookeeper_info` exception when Keeper zxid is 0. [#97553](https://github.com/ClickHouse/ClickHouse/pull/97553) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a possible logical error in `ip_trie` dictionary when key type is not String. [#97555](https://github.com/ClickHouse/ClickHouse/pull/97555) ([Bharat Nallan](https://github.com/bharatnc)).
* Fix REST catalog OAuth authentication not working for the base `RestCatalog` (it only worked for derived catalogs like `OneLakeCatalog`). This broke the default REST catalog after BigLake catalog was introduced. [#97561](https://github.com/ClickHouse/ClickHouse/pull/97561) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Geometry functions (`perimeterSpherical`, `areaSpherical`, etc.) now accept individual geometry subtypes (`Polygon`, `Ring`, `Point`, etc.) in addition to the `Geometry` variant type. [#97571](https://github.com/ClickHouse/ClickHouse/pull/97571) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `LOGICAL_ERROR` exception when using `isNull`/`isNotNull` on subcolumns of `Nullable(Tuple(... Nullable(T) ...))` types. Closes [#97224](https://github.com/ClickHouse/ClickHouse/issues/97224). [#97582](https://github.com/ClickHouse/ClickHouse/pull/97582) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix null pointer dereference when applying patch parts during lightweight updates. [#97583](https://github.com/ClickHouse/ClickHouse/pull/97583) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `BaseSettings::readBinary` passes the index from `accessor.find` to `field_infos[]` without checking for the not-found sentinel value (i.e., `-1`), which may cause a `std::vector` out-of-bounds access. The issue was caught thanks to libcxx hardening. This probably happened during query plan deserialization when a newer server sends a setting unknown to an older server. The string-based read method already handles this correctly; `readBinary` was missing the same check. [#97585](https://github.com/ClickHouse/ClickHouse/pull/97585) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix incorrect query results for `UNION ALL` queries where one branch had a constant-false predicate — the branch would incorrectly read data instead of returning nothing. [#97620](https://github.com/ClickHouse/ClickHouse/pull/97620) ([Bharat Nallan](https://github.com/bharatnc)).
* Fix `IN (col)` with a single column reference failing with `UNSUPPORTED_METHOD` error. [#97646](https://github.com/ClickHouse/ClickHouse/pull/97646) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix logical error exception during `GROUP BY ... WITH ROLLUP/CUBE` when keys include `LowCardinality(Nullable(...))` inside `Nullable(Tuple(...))`. [#97647](https://github.com/ClickHouse/ClickHouse/pull/97647) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix AST formatting inconsistency for `NOT (1, 1, 1)` that could cause `LOGICAL_ERROR` in debug builds. [#97653](https://github.com/ClickHouse/ClickHouse/pull/97653) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix `keeper-converter` exception when encountering empty ZooKeeper transaction log files. [#97673](https://github.com/ClickHouse/ClickHouse/pull/97673) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<h4 id="262-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* ClickHouse can be built with clang-23 (master). [#95578](https://github.com/ClickHouse/ClickHouse/pull/95578) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix force `is_local` to false when `bind_host` is configured and replace with integration test. Follow-up for [#74741](https://github.com/ClickHouse/ClickHouse/pull/74741). [#93109](https://github.com/ClickHouse/ClickHouse/pull/93109) [#96018](https://github.com/ClickHouse/ClickHouse/pull/96018) ([Zhigao Hong](https://github.com/zghong)).
* Stress tests: fix stress and upgrade tests in CI. ignore `no-{build}` tags. add compatibility randomization. [#94693](https://github.com/ClickHouse/ClickHouse/pull/94693) ([Nikita Fomichev](https://github.com/fm4v)).
* Publish parser\_memory\_profiler binary from build. Tool can be used to analyze AST memory consumption. [#95826](https://github.com/ClickHouse/ClickHouse/pull/95826) ([Ilya Yatsishin](https://github.com/qoega)).
* Add `--symbolize` flag for `parser_memory_profiler` tool that produces `.heap.sym` files with resolved symbols in results. [#96477](https://github.com/ClickHouse/ClickHouse/pull/96477) ([Ilya Yatsishin](https://github.com/qoega)).
* Pin third-party Docker images in integration tests to specific versions. [#96500](https://github.com/ClickHouse/ClickHouse/pull/96500) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Restore the possibility to link `OpenSSL` dynamically. This is not recommended and not used by any production builds, but the option still exists for enthusiasts on the Internet. [#96506](https://github.com/ClickHouse/ClickHouse/pull/96506) ([Govind R Nair](https://github.com/Revertionist)).
* Reduce `magic_enum` range from \[-100, 1000] to default \[-128, 127] by using a per-type specialization for `Coordination::OpNum`, improving build time. [#96632](https://github.com/ClickHouse/ClickHouse/pull/96632) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove unnecessary C++ templates from Function classes to reduce build times. [#96646](https://github.com/ClickHouse/ClickHouse/pull/96646) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Move `StorageSystemLicenses` generation to configure time to improve build parallelism. [#96697](https://github.com/ClickHouse/ClickHouse/pull/96697) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Parallelize license scanning. [#96727](https://github.com/ClickHouse/ClickHouse/pull/96727) ([Raúl Marín](https://github.com/Algunenano)).
* Add stateless functional test for SSH protocol support. [#96996](https://github.com/ClickHouse/ClickHouse/pull/96996) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add Kafka 3.9.0 to the stateless functional test infrastructure, enabling direct testing of Kafka and Kafka2 table engines using ClickHouse Keeper as ZooKeeper. Six new stateless tests cover basic produce/consume, virtual columns, INSERT, multiple formats, broken message handling, and Keeper-based offset storage. [#96997](https://github.com/ClickHouse/ClickHouse/pull/96997) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Add a CI workflow to build PGO+BOLT optimized clang toolchain. [#96991](https://github.com/ClickHouse/ClickHouse/pull/96991) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Use the PGO-optimized LLVM/Clang build in CI, which should give 20..30% build speed improvement. [#97031](https://github.com/ClickHouse/ClickHouse/pull/97031) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Replace math functions from glibc with llvm-libc implementations. [#90151](https://github.com/ClickHouse/ClickHouse/pull/90151) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Update Boost from 1.83 to 1.90, fixing a `devector` assertion failure in debug builds. [#97037](https://github.com/ClickHouse/ClickHouse/pull/97037) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Update `postgres` to REL\_18\_1. [#95189](https://github.com/ClickHouse/ClickHouse/pull/95189) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `libexpat` 2.7.3. [#95218](https://github.com/ClickHouse/ClickHouse/pull/95218) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `OpenSSL` 3.5.5. [#95345](https://github.com/ClickHouse/ClickHouse/pull/95345) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `simdjson` v4.2.4. [#97129](https://github.com/ClickHouse/ClickHouse/pull/97129) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `libarchive` 3.8.5. [#97131](https://github.com/ClickHouse/ClickHouse/pull/97131) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `fast_float` v8.2.3. [#97133](https://github.com/ClickHouse/ClickHouse/pull/97133) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Use `abseil-cpp` 20260107.1, `s2geometry` to v0.13.1. [#97134](https://github.com/ClickHouse/ClickHouse/pull/97134) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Bump `libxml2` to 2.15.1. [#95574](https://github.com/ClickHouse/ClickHouse/pull/95574) ([Robert Schulze](https://github.com/rschu1ze)).
* Upgraded 7 Tier-3 integration test Docker images from EOL or removed base images to current supported versions. [#97314](https://github.com/ClickHouse/ClickHouse/pull/97314) ([Rahul](https://github.com/motsc)).
* Add TPC-DS benchmark queries. [#97349](https://github.com/ClickHouse/ClickHouse/pull/97349) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Replace individual x86 instruction-set cmake options (`ENABLE_SSSE3`, `ENABLE_AVX2`, `NO_SSE3_OR_HIGHER`, `ARCH_NATIVE`, etc.) with a single numeric `X86_ARCH_LEVEL` option (`1`/`2`/`3`/`4`), matching the standard x86-64 microarchitecture levels already used by the runtime dispatch system. [#97354](https://github.com/ClickHouse/ClickHouse/pull/97354) ([Raúl Marín](https://github.com/Algunenano)).
* Avoid instantiating `division_by_nullable=true` template variants for non-division operations in `FunctionBinaryArithmetic`, reducing compilation time and binary size. [#97496](https://github.com/ClickHouse/ClickHouse/pull/97496) ([Raúl Marín](https://github.com/Algunenano)).
* Reduce the include footprint of `Exception.h` by removing it from high-fan-out headers like `typeid_cast.h`, `assert_cast.h`, `Context_fwd.h`, `IDataType.h`, and various Column headers. [#97497](https://github.com/ClickHouse/ClickHouse/pull/97497) ([Raúl Marín](https://github.com/Algunenano)).
* Always use bundled `compiler-rt` headers (sanitizer and XRay interfaces) instead of the host compiler's headers, and build `compiler-rt` libraries from source by default. [#97499](https://github.com/ClickHouse/ClickHouse/pull/97499) ([Raúl Marín](https://github.com/Algunenano)).
* Avoid including boost/multiprecision headers in `wide_integer_impl.h` on platforms with adequate `long double`, improving build time. [#96633](https://github.com/ClickHouse/ClickHouse/pull/96633) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Implement LLVM Code Coverage job and enable it initially for master branch. [#90952](https://github.com/ClickHouse/ClickHouse/pull/90952) ([Alexey Bakharew](https://github.com/alexbakharew)).
* Enable fast libcxx hardening for release builds. This is mostly needed for out-of-bounds checks. Given performance tests results, no noticeable performance impact is expected. [#94757](https://github.com/ClickHouse/ClickHouse/pull/94757) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).

<h3 id="261">
  ClickHouse release 26.1, 2026-01-29. [Presentation](https://presentations.clickhouse.com/2026-release-26.1/), [Video](https://www.youtube.com/watch?v=fWuYt4M0xE4)
</h3>

<h4 id="261-backward-incompatible-change">
  Backward Incompatible Change
</h4>

* Fix inconsistent formatting caused by an incorrect substitution of aliases in the formatter. This closes [#82833](https://github.com/ClickHouse/ClickHouse/issues/82833). This closes [#82832](https://github.com/ClickHouse/ClickHouse/issues/82832). This closes [#68296](https://github.com/ClickHouse/ClickHouse/issues/68296). This change is potentially backward incompatible: when the analyzer is disabled, certain CREATE VIEW queries with IN referencing an alias cannot be processed. To prevent the incompatibility, enable the analyzer (it is enabled by default since 24.3). [#82838](https://github.com/ClickHouse/ClickHouse/pull/82838) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Codecs `DEFLATE_QPL` and `ZSTD_QAT` were removed. Users are advised to convert existing data compressed with `DEFLATE_QPL` or `ZSTD_QAT` to another codec before upgrade. Note that in order to use the codecs, settings `enable_deflate_qpl_codec` and `enable_zstd_qat_codec` had to be enabled. [#92150](https://github.com/ClickHouse/ClickHouse/pull/92150) ([Robert Schulze](https://github.com/rschu1ze)).
* Improve UDF debugging by enabling stderr capture in `system.query_log.exception`. Previously, UDF stderr was only logged to files and not exposed in query logs, making debugging impossible. Now stderr triggers exceptions by default and is fully accumulated (up to 1MB) before throwing, so complete Python tracebacks and error messages appear in `system.query_log.exception` for effective troubleshooting. [#92209](https://github.com/ClickHouse/ClickHouse/pull/92209) ([Xu Jia](https://github.com/XuJia0210)).
* Empty column list in `JOIN USING ()` clause is now considered a syntax error. Previously it was supposed to be `INVALID_JOIN_ON_EXPRESSION` during query execution. In some cases such as joining with `Join` storage it led to `LOGICAL_ERROR`, close [#82502](https://github.com/ClickHouse/ClickHouse/issues/82502). [#92371](https://github.com/ClickHouse/ClickHouse/pull/92371) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Use partial match for SKIP REGEXP in JSON type by default. Closes [#79250](https://github.com/ClickHouse/ClickHouse/issues/79250). [#92847](https://github.com/ClickHouse/ClickHouse/pull/92847) ([Pavel Kruglov](https://github.com/Avogar)).
* Revert "Allow INSERT into simple ALIAS columns" (Reverts ClickHouse/ClickHouse[#84154](https://github.com/ClickHouse/ClickHouse/issues/84154)). It does not work with custom formats, and is not guarded with a setting. [#92849](https://github.com/ClickHouse/ClickHouse/pull/92849) ([Azat Khuzhin](https://github.com/azat)).
* Setting to throw an error if a data lake catalog doesn't have access to object storage. [#93606](https://github.com/ClickHouse/ClickHouse/pull/93606) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* The `Lazy` database engine is removed and no longer available. Closes [#91231](https://github.com/ClickHouse/ClickHouse/issues/91231). [#93627](https://github.com/ClickHouse/ClickHouse/pull/93627) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove the `transposed_with_wide_view` mode of the `metric_log` - it is unusable due to a bug. It is no longer possible to define `system.metric_log` with this mode. This partially reverts [#78412](https://github.com/ClickHouse/ClickHouse/issues/78412). [#93867](https://github.com/ClickHouse/ClickHouse/pull/93867) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* CPU scheduling for workloads is now preemptive by default. See `cpu_slot_preemption` server setting. [#94060](https://github.com/ClickHouse/ClickHouse/pull/94060) ([Sergei Trifonov](https://github.com/serxa)).
* Escape index filenames to prevent broken parts. With this change ClickHouse will fail to load indices with non-ascii characters in their name created by previous versions. To handle it you can use the merge tree setting `escape_index_filenames`. [#94079](https://github.com/ClickHouse/ClickHouse/pull/94079) ([Raúl Marín](https://github.com/Algunenano)).
* Format settings `exact_rows_before_limit`, `rows_before_aggregation`, `cross_to_inner_join_rewrite`, `regexp_dict_allow_hyperscan`, `regexp_dict_flag_case_insensitive`, `regexp_dict_flag_dotall` and `dictionary_use_async_executor` were changed to be regular (non-format) settings now. This is a purely internal change without user-visible side effects except in the (unlikely) case that you specified any of these settings in Iceberg or DeltaLake or Kafka or S3 or S3Queue or Azure or Hive or RabbitMQ or Set or FileLog or NATS table engine definitions. In these cases, these settings were previously ignored, now such definitions throw an error. [#94106](https://github.com/ClickHouse/ClickHouse/pull/94106) ([Robert Schulze](https://github.com/rschu1ze)).
* The `joinGet/joinGetOrNull` functions now enforce `SELECT` privileges on the underlying Join table. After this change, executing `joinGet('db.table', 'column', key)` requires the user to have `SELECT` privilege on both the key columns defined in the Join table and the attribute column being retrieved. Queries lacking these privileges will fail with `ACCESS_DENIED`. To migrate, grant the necessary permissions using `GRANT SELECT ON db.join_table TO user` for full table access, or `GRANT SELECT(key_col, attr_col) ON db.join_table TO user` for column-level access. This change affects all users and applications relying on `joinGet`/`joinGetOrNull` where explicit `SELECT` grants were not previously configured. [#94307](https://github.com/ClickHouse/ClickHouse/pull/94307) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Check `SHOW COLUMNS` for `CREATE TABLE ... AS ...` queries. Previously, it checked `SHOW TABLES`, which is an incorrect grant for this type of permission check. [#94556](https://github.com/ClickHouse/ClickHouse/pull/94556) ([pufit](https://github.com/pufit)).
* Make the `Hash` output format independent of block sizes. [#94503](https://github.com/ClickHouse/ClickHouse/pull/94503) ([Alexey Milovidov](https://github.com/alexey-milovidov)). Note that this changes the output hash values compared to previous versions.

<h4 id="261-new-feature">
  New Feature
</h4>

* HTTP API and embedded Web UI for ClickHouse Keeper. [#78181](https://github.com/ClickHouse/ClickHouse/pull/78181) ([pufit](https://github.com/pufit) and [speeedmaster](https://github.com/speeedmaster)).
* Async insert deduplication now works with dependent materialized views. When collision by block\_id occurs, the original block is filtered to remove rows associated with the block\_id, and the remaining rows are transformed with all relevant materialized views select queries, this rebuilds original block without conflicting rows. [#89140](https://github.com/ClickHouse/ClickHouse/pull/89140) ([Sema Checherinda](https://github.com/CheSema)). It is allowed to use deduplication with async inserts when materialized views are involved. [#93957](https://github.com/ClickHouse/ClickHouse/pull/93957) ([Sema Checherinda](https://github.com/CheSema)).
* Introduced a new syntax and framework to simplify and extend projection index feature. This follows up [https://github.com/ClickHouse/ClickHouse/pull/81021](https://github.com/ClickHouse/ClickHouse/pull/81021). [#91844](https://github.com/ClickHouse/ClickHouse/pull/91844) ([Amos Bird](https://github.com/amosbird)).
* Add text index support for `Array` columns. [#89895](https://github.com/ClickHouse/ClickHouse/pull/89895) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Enable `use_variant_as_common_type` by default, which lets you use incompatible types inside an `Array`, in `UNION` queries, and in branches of `if`/`multiIf`/`case`. [#90677](https://github.com/ClickHouse/ClickHouse/pull/90677) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* New system table `zookeeper_info`. Implements [#88014](https://github.com/ClickHouse/ClickHouse/issues/88014). [#90809](https://github.com/ClickHouse/ClickHouse/pull/90809) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Support the `Variant` type in all functions. [#90900](https://github.com/ClickHouse/ClickHouse/pull/90900) ([Bharat Nallan](https://github.com/bharatnc)).
* Adds a `ClickHouse_Info` metric to the Prometheus `/metrics` endpoint containing mainly version information so it's possible to build charts tracking detailed version information over time. [#91125](https://github.com/ClickHouse/ClickHouse/pull/91125) ([Christoph Wurm](https://github.com/cwurm)).
* Introduce a new four letter `rcfg` command for keeper which allows to change cluster configuration. This command provides broader possibilities for configuration changes than standard `reconfigure` request. Command takes `json` string as an argument. The whole set of bytes sent to TCP interface should look like this: `rcfg{json_string_length_big_endian}{json_string}`. Some examples of command may look like this: `{"preconditions": {"leaders": [1, 2], "members": [1, 2, 3, 4, 5]}, "actions": [{"transfer_leadership": [3]}, {"remove_members": [1, 2]}, {"set_priority": [{"id": 4, "priority": 100}, {"id": 5, "priority": 100}]}, {"transfer_leadership": [4, 5]}, {"set_priority": [{"id": 3, "priority": 0}]}]}`. [#91354](https://github.com/ClickHouse/ClickHouse/pull/91354) ([alesapin](https://github.com/alesapin)).
* Add function `reverseBySeparator` which reverses the order of substrings in a string separated by a specified separator. Close [#91463](https://github.com/ClickHouse/ClickHouse/issues/91463). [#91780](https://github.com/ClickHouse/ClickHouse/pull/91780) ([Xuewei Wang](https://github.com/Sallery-X)).
* Adds new setting `max_insert_block_size_bytes` which control the formation of inserted blocks in finer detail. [#92833](https://github.com/ClickHouse/ClickHouse/pull/92833) ([Kirill Kopnev](https://github.com/Fgrtue)).
* It is possible to execute DDL queries with `ON CLUSTER` clause for a Replicated database if the `ignore_on_cluster_for_replicated_database` setting is enabled. In this case, the cluster name will be ignored. [#92872](https://github.com/ClickHouse/ClickHouse/pull/92872) ([Kirill](https://github.com/kirillgarbar)).
* Implement `mergeTreeAnalyzeIndexes` function. [#92954](https://github.com/ClickHouse/ClickHouse/pull/92954) ([Azat Khuzhin](https://github.com/azat)).
* Add new setting `use_primary_key`. Set it to `false` to disable granule pruning based on the primary key. [#93319](https://github.com/ClickHouse/ClickHouse/pull/93319) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Add `icebergLocalCluster` table function. [#93323](https://github.com/ClickHouse/ClickHouse/pull/93323) ([Anton Ivashkin](https://github.com/ianton-ru)).
* Added `cosineDistanceTransposed` function that approximates the [cosine distance](https://en.wikipedia.org/wiki/Cosine_similarity#Cosine_distance) between two points. [#93621](https://github.com/ClickHouse/ClickHouse/pull/93621) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Add `files` column to system.parts table that shows the number of files in each data part. [#94337](https://github.com/ClickHouse/ClickHouse/pull/94337) ([Match](https://github.com/gayanMatch)).
* Adds a max-min fair scheduler for concurrency control. Provides better fairness under high oversubscription, where many queries compete for limited CPU slots. Short-running queries are not penalized by long-running queries that have accumulated more slots over time. Enabled by the `concurrent_threads_scheduler` server setting `max_min_fair` value. [#94732](https://github.com/ClickHouse/ClickHouse/pull/94732) ([Sergei Trifonov](https://github.com/serxa)).
* Added the ability for ClickHouse client to override TLS SNI when connecting to the server. [#89761](https://github.com/ClickHouse/ClickHouse/pull/89761) ([Matt Klein](https://github.com/mattklein123)).
* Support temporary tables in `joinGet` function calls. [#92973](https://github.com/ClickHouse/ClickHouse/pull/92973) ([Eduard Karacharov](https://github.com/korowa)).
* Support deletion vectors in `DeltaLake` table engine. [#93852](https://github.com/ClickHouse/ClickHouse/pull/93852) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Support deletion vectors for `deltaLakeCluster`. [#94365](https://github.com/ClickHouse/ClickHouse/pull/94365) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Google cloud storage support for data lakes. [#93866](https://github.com/ClickHouse/ClickHouse/pull/93866) ([Konstantin Vedernikov](https://github.com/scanhex12)).

<h4 id="261-experimental-feature">
  Experimental Feature
</h4>

* Move `QBit` from Experimental to Beta. [#93816](https://github.com/ClickHouse/ClickHouse/pull/93816) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Add support for `Nullable(Tuple)`. Set `allow_experimental_nullable_tuple_type = 1` to enable it. [#89643](https://github.com/ClickHouse/ClickHouse/pull/89643) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Support Paimon REST catalog, continuing from [https://github.com/ClickHouse/ClickHouse/pull/84423](https://github.com/ClickHouse/ClickHouse/pull/84423). [#92011](https://github.com/ClickHouse/ClickHouse/pull/92011) ([JIaQi Tang](https://github.com/JiaQiTang98)).

<h4 id="261-performance-improvement">
  Performance Improvement
</h4>

* Setting `use_skip_indexes_on_data_read` is now enabled by default. This setting allows filtering in a streaming fashion, at the same time as reading, improving query performance and startup time. [#93407](https://github.com/ClickHouse/ClickHouse/pull/93407) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Improve performance of `DISTINCT` on `LowCardinality` columns. Closes [#5917](https://github.com/ClickHouse/ClickHouse/issues/5917). [#91639](https://github.com/ClickHouse/ClickHouse/pull/91639) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Optimize `distinctJSONPaths` aggregate function so it reads only JSON paths from data parts and not the whole JSON column. [#92196](https://github.com/ClickHouse/ClickHouse/pull/92196) ([Pavel Kruglov](https://github.com/Avogar)).
* More filters pushed down JOINs. [#85556](https://github.com/ClickHouse/ClickHouse/pull/85556) ([Nikita Taranov](https://github.com/nickitat)).
* Support more cases for push down from join ON condition when the filter uses inputs only from one side. Support `ANY`, `SEMI`, `ANTI` joins. [#92584](https://github.com/ClickHouse/ClickHouse/pull/92584) ([Dmitry Novik](https://github.com/novikd)).
* Allow using equivalent sets to push down filters for `SEMI JOIN`. Closes [#85239](https://github.com/ClickHouse/ClickHouse/issues/85239). [#92837](https://github.com/ClickHouse/ClickHouse/pull/92837) ([Dmitry Novik](https://github.com/novikd)).
* Skip reading left side of hash join when right side is empty. Previously we were reading left side until first non-empty block, which might do a lot of work in case when there is heavy filtering or aggregation. [#94062](https://github.com/ClickHouse/ClickHouse/pull/94062) ([Alexander Gololobov](https://github.com/davenger)).
* Using the "fastrange" (Daniel Lemire) method for partitioning data inside the query pipeline. This could improve parallel sorting and JOINs. [#93080](https://github.com/ClickHouse/ClickHouse/pull/93080) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Improve performance of window functions when PARTITION BY matches or is a prefix of the sorting key. [#87299](https://github.com/ClickHouse/ClickHouse/pull/87299) ([Nikita Taranov](https://github.com/nickitat)).
* Outer filter is pushed down into views which allows applying PREWHERE on local and remote nodes. Resolves [#88189](https://github.com/ClickHouse/ClickHouse/issues/88189). [#88316](https://github.com/ClickHouse/ClickHouse/pull/88316) ([Igor Nikonov](https://github.com/devcrafter)).
* Implement JIT compilations for more functions. Closes [#73509](https://github.com/ClickHouse/ClickHouse/issues/73509). [#88770](https://github.com/ClickHouse/ClickHouse/pull/88770) ([Alexey Milovidov](https://github.com/alexey-milovidov) with [Taiyang Li](https://github.com/taiyang-li)).
* If a skip index used in a `FINAL` query is on a column that is part of the primary key, the additional step to check for primary key intersection in other parts is unnecessary and now not performed. Resolves [#85897](https://github.com/ClickHouse/ClickHouse/issues/85897). [#93899](https://github.com/ClickHouse/ClickHouse/pull/93899) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Optimize performance and memory usage for fractional `LIMIT` and `OFFSET`. [#91167](https://github.com/ClickHouse/ClickHouse/pull/91167) ([Ahmed Gouda](https://github.com/0xgouda)).
* Fix using of faster random read logic for Parquet Reader V3 prefetcher. Closes [#90890](https://github.com/ClickHouse/ClickHouse/issues/90890). [#91435](https://github.com/ClickHouse/ClickHouse/pull/91435) ([Arsen Muk](https://github.com/arsenmuk)).
* Improve performance of `icebergCluster`. Closes [#91462](https://github.com/ClickHouse/ClickHouse/issues/91462). [#91537](https://github.com/ClickHouse/ClickHouse/pull/91537) ([Yang Jiang](https://github.com/Ted-Jiang)).
* Don't filter by virtual columns on constant filters. [#91588](https://github.com/ClickHouse/ClickHouse/pull/91588) ([c-end](https://github.com/c-end)).
* Reduce INSERT/merges memory usage with wide parts for very wide tables by enabling adaptive write buffers. Add support of adaptive write buffers for encrypted disks. [#92250](https://github.com/ClickHouse/ClickHouse/pull/92250) ([Azat Khuzhin](https://github.com/azat)).
* Improved performance of full text search with text index and `sparseGrams` tokenizer by reducing the number of searched tokens in the index. [#93078](https://github.com/ClickHouse/ClickHouse/pull/93078) ([Anton Popov](https://github.com/CurtizJ)).
* Function `isValidASCII` was optimized for positive outcomes, i.e. all-ASCII input values. [#93347](https://github.com/ClickHouse/ClickHouse/pull/93347) ([Robert Schulze](https://github.com/rschu1ze)).
* The read-in-order optimization now recognizes when ORDER BY columns are constant due to WHERE conditions, enabling efficient reverse-order reads. This benefits multi-tenant queries like `WHERE tenant='42' ORDER BY tenant, event_time DESC` which can now use InReverseOrder instead of requiring a full sort.". [#94103](https://github.com/ClickHouse/ClickHouse/pull/94103) ([matanper](https://github.com/matanper)).
* Introduce Enum AST specialized class to store value parameters in (string, integer) pairs instead of ASTLiteral children to optimize memory consumption. [#94178](https://github.com/ClickHouse/ClickHouse/pull/94178) ([Ilya Yatsishin](https://github.com/qoega)).
* Distributed index analysis on multiple replicas. Beneficial for shared storage and huge amount of data in cluster. This is applicable for SharedMergeTree (ClickHouse Cloud) and could be applicable for other types of MergeTree tables on a shared storage. [#86786](https://github.com/ClickHouse/ClickHouse/pull/86786) ([Azat Khuzhin](https://github.com/azat)).
* Reduce overhead of join runtime filters by disabling them in the following cases: - too many bits are set in the bloom filter - too few rows are filtered out at runtime. [#91578](https://github.com/ClickHouse/ClickHouse/pull/91578) ([Alexander Gololobov](https://github.com/davenger)).
* Use an in-memory buffer for correlated subqueries input to avoid evaluating it multiple times. Part of [#79890](https://github.com/ClickHouse/ClickHouse/issues/79890). [#91205](https://github.com/ClickHouse/ClickHouse/pull/91205) ([Dmitry Novik](https://github.com/novikd)).
* Allow all replicas to steal orphaned ranges in parallel replicas reading. This improves load balancing and reduces long-tail latency. [#91374](https://github.com/ClickHouse/ClickHouse/pull/91374) ([zoomxi](https://github.com/zoomxi)).
* External aggregation/sorting/join now respects query setting `temporary_files_codec` in all contexts. Fixed missing profile events for grace hash join. [#92388](https://github.com/ClickHouse/ClickHouse/pull/92388) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Make query memory usage detection for spilling to disk during aggregation/sorting more robust. [#92500](https://github.com/ClickHouse/ClickHouse/pull/92500) ([Azat Khuzhin](https://github.com/azat)).
* Estimate total rows count and NDV (number of distinct values) statistics of aggregation key columns. [#92812](https://github.com/ClickHouse/ClickHouse/pull/92812) ([Alexander Gololobov](https://github.com/davenger)).
* Optimize postings list compression with simdcomp. [#92871](https://github.com/ClickHouse/ClickHouse/pull/92871) ([Peng Jian](https://github.com/fastio)).
* Refactor S3Queue Ordered mode processing with buckets. This should also improve performance, reducing the number of keeper requests. [#92889](https://github.com/ClickHouse/ClickHouse/pull/92889) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Functions `mapContainsKeyLike` and `mapContainsValueLike` can now leverage a text index on `mapKeys()` or `mapValues()`, respectively. [#93049](https://github.com/ClickHouse/ClickHouse/pull/93049) ([Michael Jarrett](https://github.com/EmeraldShift)).
* Reduce memory usage on non-Linux systems (enable immediate purging of jemalloc dirty pages). [#93360](https://github.com/ClickHouse/ClickHouse/pull/93360) ([Eduard Karacharov](https://github.com/korowa)).
* Force purging of jemalloc arenas in case the ratio of dirty pages size to `max_server_memory_usage` exceeds `memory_worker_purge_dirty_pages_threshold_ratio`. [#93500](https://github.com/ClickHouse/ClickHouse/pull/93500) ([Eduard Karacharov](https://github.com/korowa)).
* Reduce memory usage for AST. [#93601](https://github.com/ClickHouse/ClickHouse/pull/93601) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* In some cases we've seen ClickHouse doesn't respect a memory limit when reading from a table. This behaviour is fixed. [#93715](https://github.com/ClickHouse/ClickHouse/pull/93715) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Enable `CHECK_STAT` and `TRY_REMOVE` Keeper extension by default. [#93886](https://github.com/ClickHouse/ClickHouse/pull/93886) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Parse lower and upper bounds of file names corresponding to position deletes from Iceberg manifest file entries for better selection of corresponding data files. [#93980](https://github.com/ClickHouse/ClickHouse/pull/93980) ([Daniil Ivanik](https://github.com/divanik)).
* Add two more settings to control maximum number of dynamic subcolumns in JSON column. First is MergeTree setting `merge_max_dynamic_subcolumns_in_compact_part` (similar to already added `merge_max_dynamic_subcolumns_in_wide_part`) that limits number of dynamic subcolumns created during merge into a Compact part. Second is query level setting `max_dynamic_subcolumns_in_json_type_parsing` that limits number of dynamic subcolumns created during parsing of JSON data, it will allow to specify the limit on insert. [#94184](https://github.com/ClickHouse/ClickHouse/pull/94184) ([Pavel Kruglov](https://github.com/Avogar)).
* Slightly optimize squashing of JSON columns for some cases. [#94247](https://github.com/ClickHouse/ClickHouse/pull/94247) ([Pavel Kruglov](https://github.com/Avogar)).
* Lower the thread pool queue sizes based on the production experience. Add an explicit memory consumption check before reading any data from the MergeTree. [#94692](https://github.com/ClickHouse/ClickHouse/pull/94692) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Make sure the scheduler would prefer MemoryWorker thread under the CPU starvation, because it protects ClickHouse process from an existential threat. [#94864](https://github.com/ClickHouse/ClickHouse/pull/94864) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* Run purging of jemalloc dirty pages in a different thread from main thread of MemoryWorker. If purging is slow, it could delay updates of RSS usage which could lead to out of memory kills of the process. Introduce new config `memory_worker_purge_total_memory_threshold_ratio` to start purging dirty pages based on ratio of total memory usage. [#94902](https://github.com/ClickHouse/ClickHouse/pull/94902) ([Antonio Andelic](https://github.com/antonio2368)).

<h4 id="261-improvement">
  Improvement
</h4>

* `system.blob_storage_log` is now available for Azure Blob Storage. [#93105](https://github.com/ClickHouse/ClickHouse/pull/93105) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Implement `blob_storage_log` for Local and HDFS. Fix an error when `S3Queue` used something other than the disk name for logging in `blob_storage_log`. Add `error_code` column to `blob_storage_log`. Split the test configuration file to simplify local testing. [#93106](https://github.com/ClickHouse/ClickHouse/pull/93106) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `clickhouse-client` and `clickhouse-local` will highlight digit groups (thousands, millions, etc.) inside numeric literals while typing. This closes [#93100](https://github.com/ClickHouse/ClickHouse/issues/93100). [#93108](https://github.com/ClickHouse/ClickHouse/pull/93108) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Adds support in `clickhouse-client` for command-line arguments with a space surrounding the equals sign. Closes [#93077](https://github.com/ClickHouse/ClickHouse/issues/93077). [#93174](https://github.com/ClickHouse/ClickHouse/pull/93174) ([Cole Smith](https://github.com/colesmith54)).
* With `<interactive_history_legacy_keymap>true</interactive_history_legacy_keymap>`, the CLI client can now fall back to Ctrl-R for regular search like before, while Ctrl-T does fuzzy search. [#87785](https://github.com/ClickHouse/ClickHouse/pull/87785) ([Larry Snizek](https://github.com/larry-cdn77)).
* The statement to clear caches `SYSTEM DROP [...] CACHE` gave the false impression that the statement disables the cache. ClickHouse now supports statement `SYSTEM CLEAR [...] CACHE` which is more obvious. The old syntax remains available. [#93727](https://github.com/ClickHouse/ClickHouse/pull/93727) ([Pranav Tiwari](https://github.com/pranavt84)).
* Support multiple columns as primary key in `EmbeddedRocksDB`. Closes [#32819](https://github.com/ClickHouse/ClickHouse/issues/32819). [#33917](https://github.com/ClickHouse/ClickHouse/pull/33917) ([usurai](https://github.com/usurai)).
* It is now possible to use non-constant IN for scalars (queries like `val1 NOT IN if(cond, val2, val3)`). [#93495](https://github.com/ClickHouse/ClickHouse/pull/93495) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Prevent `x-amz-server-side-encryption` headers from being propagated to `HeadObject`, `UploadPart` & `CompleteMultipartUpload` S3 requests as they're not supported. [#64577](https://github.com/ClickHouse/ClickHouse/pull/64577) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)).
* Tracking hive partitioning for ordered mode in S3Queue. Resolves [#71161](https://github.com/ClickHouse/ClickHouse/issues/71161). [#81040](https://github.com/ClickHouse/ClickHouse/pull/81040) ([Anton Ivashkin](https://github.com/ianton-ru)).
* Optimize space reservation in filesystem cache. `FileCache::collectCandidatesForEviction` will be executed without unique lock. [#82764](https://github.com/ClickHouse/ClickHouse/pull/82764) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Support composite rotation strategy (size + time) for server log. [#87620](https://github.com/ClickHouse/ClickHouse/pull/87620) ([Jianmei Zhang](https://github.com/zhangjmruc)).
* CLI client can now specify `<warnings>false</warnings>` instead of the command line `--no-warnings`. [#87783](https://github.com/ClickHouse/ClickHouse/pull/87783) ([Larry Snizek](https://github.com/larry-cdn77)).
* Add support for the `avg` aggregate function with Date, DateTime and Time values as arguments. Closes [#82267](https://github.com/ClickHouse/ClickHouse/issues/82267). [#87845](https://github.com/ClickHouse/ClickHouse/pull/87845) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* The optimization `use_join_disjunctions_push_down` is enabled by default. [#89313](https://github.com/ClickHouse/ClickHouse/pull/89313) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support more table engines and data source kinds in the correlated subqueries. Closes [#80775](https://github.com/ClickHouse/ClickHouse/issues/80775). [#90175](https://github.com/ClickHouse/ClickHouse/pull/90175) ([Dmitry Novik](https://github.com/novikd)).
* If the schema of parameterized view is specified explicitly, it is shown. Close [#88875](https://github.com/ClickHouse/ClickHouse/issues/88875), [#81385](https://github.com/ClickHouse/ClickHouse/issues/81385). [#90220](https://github.com/ClickHouse/ClickHouse/pull/90220) ([Grigorii Sokolik](https://github.com/GSokol)).
* Correctly handle the gap in Keeper log entries if logs are before the last committed index. [#90403](https://github.com/ClickHouse/ClickHouse/pull/90403) ([Antonio Andelic](https://github.com/antonio2368)).
* Improve `min_free_disk_bytes_to_perform_insert` setting to work correctly with JBOD volumes. [#90878](https://github.com/ClickHouse/ClickHouse/pull/90878) ([Aleksandr Musorin](https://github.com/AVMusorin)).
* Make it possible to specify `storage_class_name` setting in named collections for `S3` table engine and `s3` table function. [#91926](https://github.com/ClickHouse/ClickHouse/pull/91926) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Support inserting auxiliary zookeeper by `system.zookeeper`. [#92092](https://github.com/ClickHouse/ClickHouse/pull/92092) ([RinChanNOW](https://github.com/RinChanNOWWW)).
* Add new metrics for the keeper: `KeeperChangelogWrittenBytes`, `KeeperChangelogFileSyncMicroseconds`, `KeeperSnapshotWrittenBytes` and `KeeperSnapshotFileSyncMicroseconds` profile events as well as `KeeperBatchSizeElements` and `KeeperBatchSizeBytes` histogram metrics. [#92149](https://github.com/ClickHouse/ClickHouse/pull/92149) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Add a new setting, `trace_profile_events_list`, which limits tracing with `trace_profile_event` to the specified list of event names. This allows more precise data collection on large workloads. [#92298](https://github.com/ClickHouse/ClickHouse/pull/92298) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Support SYSTEM NOTIFY FAILPOINT for pausable failpoints. - Support SYSTEM WAIT FAILPOINT fp PAUSE/RESUME. [#92368](https://github.com/ClickHouse/ClickHouse/pull/92368) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Add `creation` (implicit/explicit) column to `system.data_skipping_indices`. [#92378](https://github.com/ClickHouse/ClickHouse/pull/92378) ([Raúl Marín](https://github.com/Algunenano)).
* Allow passing the description of columns for YTsaurus dyn tables to the dictionary source. [#92391](https://github.com/ClickHouse/ClickHouse/pull/92391) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* In [#63985](https://github.com/ClickHouse/ClickHouse/pull/63985), we made it possible to specify all the parameters needed for TLS configuration on a per-port basis (see [composable protocols](https://clickhouse.com/docs/operations/settings/composable-protocols)), so we don't have to rely on global TLS config. However, the implementation still implicitly requires a global `openSSL.server` config section to exist, which conflicts with setups where different TLS configurations are needed for different ports. For example, in keeper-in-server deployments, we need separate TLS configs for inter-keeper communication and clickhouse client connections. [#92457](https://github.com/ClickHouse/ClickHouse/pull/92457) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Introduce a new setting `input_format_binary_max_type_complexity` that limits the total number of type nodes that can be decoded in binary format to prevent malicious payloads. [#92519](https://github.com/ClickHouse/ClickHouse/pull/92519) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Reflect running tasks in `system.background_schedule_pool{,_log}`. Add documentation. [#92587](https://github.com/ClickHouse/ClickHouse/pull/92587) ([Azat Khuzhin](https://github.com/azat)).
* Execute current query in Ctrl+R search in client if no history match found. [#92749](https://github.com/ClickHouse/ClickHouse/pull/92749) ([Azat Khuzhin](https://github.com/azat)).
* Support `EXPLAIN indices = 1` as an alias for `EXPLAIN indexes = 1`. Closes [#92483](https://github.com/ClickHouse/ClickHouse/issues/92483). [#92774](https://github.com/ClickHouse/ClickHouse/pull/92774) ([Pranav Tiwari](https://github.com/pranavt84)).
* Parquet reader now allows reading Tuple or Map columns as JSON: `select x from file(f.parquet, auto, 'x JSON')` works even if the type of column `x` in `f.parquet` is tuple or map. [#92864](https://github.com/ClickHouse/ClickHouse/pull/92864) ([Michael Kolupaev](https://github.com/al13n321)).
* Support empty tuples in parquet reader. [#92868](https://github.com/ClickHouse/ClickHouse/pull/92868) ([Michael Kolupaev](https://github.com/al13n321)).
* Fallback to read-write copy for Azure Blob Storage when native copy fails with BadRequest (e.g. invalid block list). Previously this was only done for Unauthorized error which was seen while copying blob to different storage accounts. But we also sometimes see "The specified block list is invalid" error. So now updated the condition to fallback to read & write for all native copy fails. [#92888](https://github.com/ClickHouse/ClickHouse/pull/92888) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* Fix EC2 metadata endpoint throttling when running many concurrent S3 queries with EC2 instance profile credentials. Previously, each query created its own `AWSInstanceProfileCredentialsProvider`, causing concurrent requests to the EC2 metadata service which could result in timeouts and `HTTP response code: 403` errors. Now the credentials provider is cached and shared across all queries. [#92891](https://github.com/ClickHouse/ClickHouse/pull/92891) ([Sav](https://github.com/sberss)).
* Rework `insert_select_deduplicate` setting to add an ability to keep backward compatibility. [#92951](https://github.com/ClickHouse/ClickHouse/pull/92951) ([Sema Checherinda](https://github.com/CheSema)).
* Log background tasks that are slower than average (`background_schedule_pool_log.duration_threshold_milliseconds=30`) to avoid excessive tasks logging. [#92965](https://github.com/ClickHouse/ClickHouse/pull/92965) ([Azat Khuzhin](https://github.com/azat)).
* In previous versions, some of C++ function names were displayed incorrectly ("mangled") in the `system.trace_log` and `system.symbols`, and the `demangle` function didn't process them well. Closes [#93074](https://github.com/ClickHouse/ClickHouse/issues/93074). [#93075](https://github.com/ClickHouse/ClickHouse/pull/93075) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Introduced the `backup_data_from_refreshable_materialized_view_targets` backup setting to skip back up of refreshable materialized views. RMVs with APPEND refresh strategy which are always backed up. [#93076](https://github.com/ClickHouse/ClickHouse/pull/93076) ([Julia Kartseva](https://github.com/jkartseva)). [#93658](https://github.com/ClickHouse/ClickHouse/pull/93658) ([Julia Kartseva](https://github.com/jkartseva))
* Use minimal debug info instead of no debug info for heavy translation units, such as functions. [#93079](https://github.com/ClickHouse/ClickHouse/pull/93079) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Added MinIO compatibility support to AWS S3 C++ SDK by implementing error code mapping for MinIO-specific errors. This change allows ClickHouse to properly handle and retry MinIO server errors when using MinIO deployments instead of AWS S3, improving reliability for users running object storage on self-hosted MinIO clusters. [#93082](https://github.com/ClickHouse/ClickHouse/pull/93082) ([XiaoBinMu](https://github.com/Binnn-MX)).
* Write symbolized jemalloc profiles (eliminating the need for a binary during heap profile generation). [#93099](https://github.com/ClickHouse/ClickHouse/pull/93099) ([Azat Khuzhin](https://github.com/azat)).
* Resurrect `clickhouse git-import` tool - it was broken on large and invalid commits. See [https://presentations.clickhouse.com/2020-matemarketing/](https://presentations.clickhouse.com/2020-matemarketing/). [#93202](https://github.com/ClickHouse/ClickHouse/pull/93202) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Don't show passwords from URL storage in query log. [#93245](https://github.com/ClickHouse/ClickHouse/pull/93245) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Support `Geometry` type for `flipCoordinates`. [#93303](https://github.com/ClickHouse/ClickHouse/pull/93303) ([Bharat Nallan](https://github.com/bharatnc)).
* Improve the UX of SYSTEM INSTRUMENT ADD/REMOVE: use String literals for function names, patch all functions that match and allow using function\_name in `REMOVE`. [#93345](https://github.com/ClickHouse/ClickHouse/pull/93345) ([Pablo Marcos](https://github.com/pamarcos)).
* Add a new setting `materialize_statistics_on_merge` which enables/disables materializing statistics during merge. The default value is `1`. [#93379](https://github.com/ClickHouse/ClickHouse/pull/93379) ([Han Fei](https://github.com/hanfei1991)).
* ClickHouse can now parse `SELECT` without parentheses around `DESCRIBE SELECT` queries. Closes [#58382](https://github.com/ClickHouse/ClickHouse/issues/58382). [#93429](https://github.com/ClickHouse/ClickHouse/pull/93429) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Add randomization of cache correctness checks under probability. [#93439](https://github.com/ClickHouse/ClickHouse/pull/93439) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Add setting `type_json_allow_duplicated_key_with_literal_and_nested_object` to allow duplicated paths in JSON where one is a literal and another is a nested object, e.g. `{"a" : 42, "a" : {"b" : 42}}`. Some data could be created before this restriction on duplicated paths was added in [https://github.com/ClickHouse/ClickHouse/pull/79317](https://github.com/ClickHouse/ClickHouse/pull/79317) and further manipulation with this data can lead to errors now. With this setting, such old data cane still be used with no errors. [#93604](https://github.com/ClickHouse/ClickHouse/pull/93604) ([Pavel Kruglov](https://github.com/Avogar)).
* Don't print values of simple types on separate lines in Pretty JSON. [#93836](https://github.com/ClickHouse/ClickHouse/pull/93836) ([Pavel Kruglov](https://github.com/Avogar)).
* When there are many `alter table ... modify setting ...` statements, it's possible not to acquire lock for 5 seconds. Better to return `timeout` than `logical error`. [#93856](https://github.com/ClickHouse/ClickHouse/pull/93856) ([Han Fei](https://github.com/hanfei1991)).
* Prevent excessive output on a syntax error. Before this change, it output the whole SQL script, which could contain a lot of queries. [#93876](https://github.com/ClickHouse/ClickHouse/pull/93876) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Do proper byte size calculation of the `check` request with stats in Keeper. [#93907](https://github.com/ClickHouse/ClickHouse/pull/93907) ([Mikhail Artemenko](https://github.com/Michicosun)).
* Added `use_hash_table_stats_for_join_reordering` setting to control whether runtime hash table size statistics are used for join reordering. This setting is enabled by default, preserving the existing behavior of `collect_hash_table_stats_during_joins`. [#93912](https://github.com/ClickHouse/ClickHouse/pull/93912) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Users can now partially view nested global server settings in the `system.server_settings` table (e.g. `logger.level`). This only covers settings with a fixed structure (no lists, enumerations, repetitions etc.). [#94001](https://github.com/ClickHouse/ClickHouse/pull/94001) ([Hechem Selmi](https://github.com/m-selmi)).
* `QBit` can now be compared for equality. [#94078](https://github.com/ClickHouse/ClickHouse/pull/94078) ([Raufs Dunamalijevs](https://github.com/rienath)).
* When Keeper detects broken snapshot or inconsistent changelogs, throw exception instead of manually aborting or cleaning up files automatically. This should lead to a safer behaviour of Keeper relying on manual intervention. [#94168](https://github.com/ClickHouse/ClickHouse/pull/94168) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix leaving possible leftovers in case of `CREATE TABLE` fails. [#94174](https://github.com/ClickHouse/ClickHouse/pull/94174) ([Azat Khuzhin](https://github.com/azat)).
* Fix uninitialized memory access (a bug in OpenSSL) when password protected TLS key is used. [#94182](https://github.com/ClickHouse/ClickHouse/pull/94182) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Bump chdig to [v26.1.1](https://github.com/azat/chdig/releases/tag/v26.1.1). [#94290](https://github.com/ClickHouse/ClickHouse/pull/94290) ([Azat Khuzhin](https://github.com/azat)).
* Support more generic partitioning for S3Queue ordered mode. [#94321](https://github.com/ClickHouse/ClickHouse/pull/94321) ([Bharat Nallan](https://github.com/bharatnc)).
* Added alias `use_statistics` for setting `allow_statistics_optimize`. This is more consistent with existing settings `use_primary_key` and `use_skip_indexes`. [#94366](https://github.com/ClickHouse/ClickHouse/pull/94366) ([Robert Schulze](https://github.com/rschu1ze)).
* Enabled setting `input_format_numbers_enum_on_conversion_error` for conversion from Numbers to Enums to check whether the element exists. [#94384](https://github.com/ClickHouse/ClickHouse/pull/94384) ([Elmi Ahmadov](https://github.com/ahmadov)).
* In S3(Azure)Queue ordered mode clean up failed nodes by tracking limits (before that was done only in Unordered mode for both failed and processed, so now this will also be done for Ordered but only for failed nodes). [#94412](https://github.com/ClickHouse/ClickHouse/pull/94412) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Enable access management for `default` user in clickhouse-local. The default user in `clickhouse-local` was missing the access\_management privilege, which caused operations like `DROP ROW POLICY IF EXISTS` to fail with `ACCESS_DENIED` error, even though the user should be unrestricted. [#94501](https://github.com/ClickHouse/ClickHouse/pull/94501) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Enable named collection for YTsaurus dictionaries and tables. [#94582](https://github.com/ClickHouse/ClickHouse/pull/94582) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* Add support for SQL-defined named collections in BACKUP/RESTORE for S3 and Azure Blob Storage. Closes [#94604](https://github.com/ClickHouse/ClickHouse/issues/94604). [#94605](https://github.com/ClickHouse/ClickHouse/pull/94605) ([Pablo Marcos](https://github.com/pamarcos)).
* Support bucketing based on partition key for S3Queue in ordered mode. [#94698](https://github.com/ClickHouse/ClickHouse/pull/94698) ([Bharat Nallan](https://github.com/bharatnc)).
* Add an asynchronous metric with the longest running merge elapsed time. [#94825](https://github.com/ClickHouse/ClickHouse/pull/94825) ([Raúl Marín](https://github.com/Algunenano)).
* Add belonging file check before apply position delete using IcebergBitmapPositionDeleteTransform. [#94897](https://github.com/ClickHouse/ClickHouse/pull/94897) ([Yang Jiang](https://github.com/Ted-Jiang)).
* Now `view_duration_ms` shows the time when group was active, not the sum of the threads duration in it. [#94966](https://github.com/ClickHouse/ClickHouse/pull/94966) ([Sema Checherinda](https://github.com/CheSema)).
* Remove limit of the max number of search tokens in `hasAnyTokens` and `hasAllTokens` functions which was limited to 64. Example: `SELECT count() FROM table WHERE hasAllTokens(text, ['token_1', 'token_2', [...], 'token_65']]);` The query would result in a `BAD_ARGUMENTS` error because there are 65 search tokens. With this PR, the limit has been removed completely and the same query would run without an error. [#95152](https://github.com/ClickHouse/ClickHouse/pull/95152) ([Elmi Ahmadov](https://github.com/ahmadov)).
* Add a setting `input_format_numbers_enum_on_conversion_error` for conversion from Numbers to Enums to check whether the element exists. Closes: [#56144](https://github.com/ClickHouse/ClickHouse/issues/56144). [#56240](https://github.com/ClickHouse/ClickHouse/pull/56240) ([Nikolay Degterinsky](https://github.com/evillique)).
* Share format parser resources between data file and position delete file reading in Iceberg tables to reduce memory allocations. [#94701](https://github.com/ClickHouse/ClickHouse/pull/94701) ([Yang Jiang](https://github.com/Ted-Jiang)).

<h4 id="261-bug-fix-user-visible-misbehavior-in-an-official-stable-release">
  Bug Fix (user-visible misbehavior in an official stable release)
</h4>

* Fixes a bug where predefined query handlers would have trailing whitespace interpreted as data during inserts. [#83604](https://github.com/ClickHouse/ClickHouse/pull/83604) ([Fabian Ponce](https://github.com/FabianPonce)).
* Fix INCOMPATIBLE\_TYPE\_OF\_JOIN error for Join storage and outer to inner join optimization applied. Resolves [#80794](https://github.com/ClickHouse/ClickHouse/issues/80794). [#84292](https://github.com/ClickHouse/ClickHouse/pull/84292) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix exception "Invalid number of rows in Chunk" when using hash join with `allow_experimental_join_right_table_sorting` enabled. [#86440](https://github.com/ClickHouse/ClickHouse/pull/86440) ([yanglongwei](https://github.com/ylw510)).
* Always replace file names to hash in MergeTree if filesystem is case insensitive. Previously on systems with case insensitive filesystem (like MacOS) it could lead to data corruption when several column/subcolumn names differs only in the case. [#86559](https://github.com/ClickHouse/ClickHouse/pull/86559) ([Pavel Kruglov](https://github.com/Avogar)).
* Add a full permissions check on the create stage for the underlying query inside a materialized view. [#89180](https://github.com/ClickHouse/ClickHouse/pull/89180) ([pufit](https://github.com/pufit)).
* Fixed crash in `icebergHash` function on constant argument. [#90335](https://github.com/ClickHouse/ClickHouse/pull/90335) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix logical error when mutation without transaction mutates parts in an active transaction, which is rolled back finally. [#90469](https://github.com/ClickHouse/ClickHouse/pull/90469) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Update `system.warnings` correctly after an ordinary database was converted to an atomic database. [#90473](https://github.com/ClickHouse/ClickHouse/pull/90473) ([sdk2](https://github.com/sdk2)).
* Fixes an assertion when reading from Parquet file, and part of a **prewhere** expression is used elsewhere in the query. [#90635](https://github.com/ClickHouse/ClickHouse/pull/90635) ([Max Kainov](https://github.com/maxknv)).
* Fix crash in a single-node cluster when reading from Iceberg in split-by-buckets mode. This closes [#90913](https://github.com/ClickHouse/ClickHouse/issues/90913#issue-3668583963). [#91553](https://github.com/ClickHouse/ClickHouse/pull/91553) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix possible logical error in Log engine during subcolumns reading. Closes [#91710](https://github.com/ClickHouse/ClickHouse/issues/91710). [#91711](https://github.com/ClickHouse/ClickHouse/pull/91711) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix Logical error: 'Storage does not support transaction' during ATTACH AS REPLICATED. [#91772](https://github.com/ClickHouse/ClickHouse/pull/91772) ([Shaohua Wang](https://github.com/tiandiwonder)).
* Fix for runtime filters working incorrectly when LEFT ANTI JOIN has extra post-condition. [#91824](https://github.com/ClickHouse/ClickHouse/pull/91824) ([Alexander Gololobov](https://github.com/davenger)).
* Fixes an error where we have a null-safe comparison involving the Nothing type. Closes [#91834](https://github.com/ClickHouse/ClickHouse/issues/91834). Closes [#84870](https://github.com/ClickHouse/ClickHouse/issues/84870). Closes [#91821](https://github.com/ClickHouse/ClickHouse/issues/91821). [#91884](https://github.com/ClickHouse/ClickHouse/pull/91884) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix DELTA\_BYTE\_ARRAY decoding bugs in native Parquet reader affecting highly repetitive string data. [#91929](https://github.com/ClickHouse/ClickHouse/pull/91929) ([Daniel Muino](https://github.com/dmuino)).
* Cache schema only for the file it was inferred from in globs instead of all files during schema inference. Closes [#91745](https://github.com/ClickHouse/ClickHouse/issues/91745). [#92006](https://github.com/ClickHouse/ClickHouse/pull/92006) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix the `Couldn't pack tar archive: Failed to write all bytes` error caused by an incorrect archive entry size header. Fixes [#89075](https://github.com/ClickHouse/ClickHouse/issues/89075). [#92122](https://github.com/ClickHouse/ClickHouse/pull/92122) ([Julia Kartseva](https://github.com/jkartseva)).
* Release request stream in insert select to prevent closing http connection. [#92175](https://github.com/ClickHouse/ClickHouse/pull/92175) ([Sema Checherinda](https://github.com/CheSema)).
* Fix logical error for queries with multiple JOINs with `USING` clause and `join_use_nulls`. [#92251](https://github.com/ClickHouse/ClickHouse/pull/92251) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix logical error while join reordering with join\_use\_nulls, close [https://github.com/clickhouse/clickhouse/issues/90795](https://github.com/clickhouse/clickhouse/issues/90795). [#92289](https://github.com/ClickHouse/ClickHouse/pull/92289) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix inconsistent AST formatting of arrayElement with negate literal. Closes [#92288](https://github.com/ClickHouse/ClickHouse/issues/92288) Closes [#92212](https://github.com/ClickHouse/ClickHouse/issues/92212) Closes [#91832](https://github.com/ClickHouse/ClickHouse/issues/91832) Closes [#91789](https://github.com/ClickHouse/ClickHouse/issues/91789) Closes [#91735](https://github.com/ClickHouse/ClickHouse/issues/91735) Closes [#88495](https://github.com/ClickHouse/ClickHouse/issues/88495) Closes [#92386](https://github.com/ClickHouse/ClickHouse/issues/92386). [#92293](https://github.com/ClickHouse/ClickHouse/pull/92293) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a possible crash with `join_on_disk_max_files_to_merge` setting. [#92335](https://github.com/ClickHouse/ClickHouse/pull/92335) ([Bharat Nallan](https://github.com/bharatnc)).
* Related issue #[https://github.com/ClickHouse/support-escalation/issues/6365](https://github.com/ClickHouse/support-escalation/issues/6365). [#92339](https://github.com/ClickHouse/ClickHouse/pull/92339) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix missing access check in `SYSTEM SYNC FILE CACHE`. Closes [#92101](https://github.com/ClickHouse/ClickHouse/issues/92101). [#92372](https://github.com/ClickHouse/ClickHouse/pull/92372) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix `count_distinct_optimization` pass over window functions and over multiple arguments. [#92376](https://github.com/ClickHouse/ClickHouse/pull/92376) ([Raúl Marín](https://github.com/Algunenano)).
* Fix "Cannot write to finalized buffer" error when using certain aggregate functions with window functions. Closes [#91415](https://github.com/ClickHouse/ClickHouse/issues/91415). [#92395](https://github.com/ClickHouse/ClickHouse/pull/92395) ([Jimmy Aguilar Mena](https://github.com/Ergus)).
* Fix logical error with `CREATE TABLE ... AS urlCluster()` and database engine `Replicated`. Closes [#92216](https://github.com/ClickHouse/ClickHouse/issues/92216). [#92418](https://github.com/ClickHouse/ClickHouse/pull/92418) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Inherit source part serialization info settings during mutation in MergeTree. It fixes possible incorrect result of the query over mutated part after changes in data types serialization. [#92419](https://github.com/ClickHouse/ClickHouse/pull/92419) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix possible conflict in column and subcolumn with the same name leading in using wrong serialization and query failures. Closes [#90219](https://github.com/ClickHouse/ClickHouse/issues/90219). Closes [#85161](https://github.com/ClickHouse/ClickHouse/issues/85161). [#92453](https://github.com/ClickHouse/ClickHouse/pull/92453) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix a `LOGICAL_ERROR`s that caused by not wanted modification of query plan when converting outer join to inner join. Also relax the requirements of optimization to be able to apply it in cases when injective functions are applied to the aggregating keys during joins. [#92503](https://github.com/ClickHouse/ClickHouse/pull/92503) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fix possible error `SIZES_OF_COLUMNS_DOESNT_MATCH` during sorting of emty tuple column. Closes [#92422](https://github.com/ClickHouse/ClickHouse/issues/92422). [#92520](https://github.com/ClickHouse/ClickHouse/pull/92520) ([Pavel Kruglov](https://github.com/Avogar)).
* Check for incompatible typed paths in JSON type. Closes [#91577](https://github.com/ClickHouse/ClickHouse/issues/91577). [#92539](https://github.com/ClickHouse/ClickHouse/pull/92539) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix deadlock for SHOW CREATE DATABASE for Backup database. [#92541](https://github.com/ClickHouse/ClickHouse/pull/92541) ([Azat Khuzhin](https://github.com/azat)).
* Use proper error code when validating hypothesis index. [#92559](https://github.com/ClickHouse/ClickHouse/pull/92559) ([Raúl Marín](https://github.com/Algunenano)).
* Fix dynamic subcolumns resolution in column aliases in analyzer. Previously dynamic subcolumn in column alias was wrapped in `getSubcolumn` and in some cases could be not resolved at all. Closes [#91434](https://github.com/ClickHouse/ClickHouse/issues/91434). [#92583](https://github.com/ClickHouse/ClickHouse/pull/92583) ([Pavel Kruglov](https://github.com/Avogar)).
* Prevent crash in tokens() with null second argument. [#92586](https://github.com/ClickHouse/ClickHouse/pull/92586) ([Raúl Marín](https://github.com/Algunenano)).
* Fix potential crash caused by in place mutation of underlying const PREWHERE columns. This could've happened at column shrinking (`IColumn::shrinkToFit`) or filtering (`IColumn::filter`), which could've triggered concurrently from several threads. [#92588](https://github.com/ClickHouse/ClickHouse/pull/92588) ([Arsen Muk](https://github.com/arsenmuk)).
* Creating and materializing text indexes on tables containing large parts (over 4,294,967,295 rows) is temporarily disabled. This limitation prevents incorrect query results, as the current index implementation does not yet support such large parts. [#92644](https://github.com/ClickHouse/ClickHouse/pull/92644) ([Anton Popov](https://github.com/CurtizJ)).
* Fixes a logical error `Too large size (A) passed to allocator` while executing JOINs. Closes [#92043](https://github.com/ClickHouse/ClickHouse/issues/92043). [#92667](https://github.com/ClickHouse/ClickHouse/pull/92667) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Remove a bug that `ngrambf_v1` indexes with ngram length (1st parameter) > 8 would throw an exception. [#92672](https://github.com/ClickHouse/ClickHouse/pull/92672) ([Robert Schulze](https://github.com/rschu1ze)).
* Fix uncaught exception during background named collections reload when zookeeper storage is used. Closes [https://github.com/ClickHouse/clickhouse-private/issues/44180](https://github.com/ClickHouse/clickhouse-private/issues/44180). [#92717](https://github.com/ClickHouse/ClickHouse/pull/92717) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Reworks incorrect logic in access grant checks for wildcard grants. The previous attempt [https://github.com/ClickHouse/ClickHouse/pull/90928](https://github.com/ClickHouse/ClickHouse/pull/90928) addressed a critical vulnerability but ended up being too restrictive, resulting in some wildcard `GRANT` statements failing due to unrelated revokes. [#92725](https://github.com/ClickHouse/ClickHouse/pull/92725) ([pufit](https://github.com/pufit)).
* Fix bug in data skipping logic when `not match(...)` is used in `WHERE` causing incorrect results. Closes [#92492](https://github.com/ClickHouse/ClickHouse/issues/92492). [#92726](https://github.com/ClickHouse/ClickHouse/pull/92726) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Do not attempt to delete temporary directories at startup if a MergeTree table is created over a read-only disk. [#92748](https://github.com/ClickHouse/ClickHouse/pull/92748) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix "Cannot add action to empty ExpressionActionsChain" for ALTER TABLE REWRITE PARTS (v2). [#92754](https://github.com/ClickHouse/ClickHouse/pull/92754) ([Azat Khuzhin](https://github.com/azat)).
* Avoid crash due to reading from a disconnected `Connection`. [#92807](https://github.com/ClickHouse/ClickHouse/pull/92807) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix logical error ` Failed to set file processing within 100 retries` in storgae `S3Queue` in `Ordered` mode. It is now replaced with a warning. This error could happen before 25.10 version if keeper session expired, however it will still be a warning in 25.10+ versions, as it is still theoretically possible to get this error in case of high processing concurrency in `Ordered` mode. [#92814](https://github.com/ClickHouse/ClickHouse/pull/92814) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Previously, some queries that used PK sharding with a false condition were failing. Now they're not. Needed for [https://github.com/ClickHouse/ClickHouse/pull/89313](https://github.com/ClickHouse/ClickHouse/pull/89313). [#92815](https://github.com/ClickHouse/ClickHouse/pull/92815) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fixed calculation of uncompressed sizes of text indexes in the `system.parts` table. [#92832](https://github.com/ClickHouse/ClickHouse/pull/92832) ([Anton Popov](https://github.com/CurtizJ)).
* Fixed usage of primary index in lightweight updates that have an `IN` clause with subqueries in the predicate of the `WHERE` clause. [#92838](https://github.com/ClickHouse/ClickHouse/pull/92838) ([Anton Popov](https://github.com/CurtizJ)).
* Fix creating type hint for path 'skip' in JSON. Closes [#92731](https://github.com/ClickHouse/ClickHouse/issues/92731). [#92842](https://github.com/ClickHouse/ClickHouse/pull/92842) ([Pavel Kruglov](https://github.com/Avogar)).
* In the S3 table engine, we should avoid caching the partition key if there are non-deterministic functions. [#92844](https://github.com/ClickHouse/ClickHouse/pull/92844) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix possible error `FILE_DOESNT_EXIST` after mutation of a sparse column with `ratio_of_defaults_for_sparse_serialization=0.0`. Closes [#92633](https://github.com/ClickHouse/ClickHouse/issues/92633). [#92860](https://github.com/ClickHouse/ClickHouse/pull/92860) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix parquet schema inference in the old parquet reader (not used by default) when a JSON column comes after a Tupe column. Fix the old parquet reader (not used by default) failing on empty tuples. [#92867](https://github.com/ClickHouse/ClickHouse/pull/92867) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix logical error with multiple joins on constant condition and `join_use_nulls`, close [#92640](https://github.com/ClickHouse/ClickHouse/issues/92640). [#92892](https://github.com/ClickHouse/ClickHouse/pull/92892) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix possible error `NOT_FOUND_COLUMN_IN_BLOCK` during insert into a table with subcolumn in partition expression. Closes [#93210](https://github.com/ClickHouse/ClickHouse/issues/93210). Closes [#83406](https://github.com/ClickHouse/ClickHouse/issues/83406). [#92905](https://github.com/ClickHouse/ClickHouse/pull/92905) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix error `NO_SUCH_COLUMN_IN_TABLE` in Merge engine over tables with aliases. Closes [#88665](https://github.com/ClickHouse/ClickHouse/issues/88665). [#92910](https://github.com/ClickHouse/ClickHouse/pull/92910) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix NULL != NULL case for full\_sorting\_join on LowCardinality(Nullable(T)) column. [#92924](https://github.com/ClickHouse/ClickHouse/pull/92924) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fixed several crashes during merges of text indexes in `MergeTree` tables. [#92925](https://github.com/ClickHouse/ClickHouse/pull/92925) ([Anton Popov](https://github.com/CurtizJ)).
* Restore LowCardinality wrappers on SET expression results if needed during TTL aggregation to prevent exceptions during table optimization. [#92971](https://github.com/ClickHouse/ClickHouse/pull/92971) ([Seva Potapov](https://github.com/seva-potapov)).
* Fix logical error during index analysis when empty array is used in `has` function. Closes [#92906](https://github.com/ClickHouse/ClickHouse/issues/92906). [#92995](https://github.com/ClickHouse/ClickHouse/pull/92995) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix possible hung on terminating background schedule pool (may lead to server hungs on shutdown). [#93008](https://github.com/ClickHouse/ClickHouse/pull/93008) ([Azat Khuzhin](https://github.com/azat)).
* Fix possible error FILE\_DOESNT\_EXIST after sparse column mutation when setting `ratio_of_defaults_for_sparse_serialization` was changed to `1.0` via alter. [#93016](https://github.com/ClickHouse/ClickHouse/pull/93016) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix bug in data skipping logic when `not materialize(...)` or `not CAST(...)` is used in WHERE causing incorrect results. Closes [#88536](https://github.com/ClickHouse/ClickHouse/issues/88536). [#93017](https://github.com/ClickHouse/ClickHouse/pull/93017) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix possible usage of outdated parts due to TOCTOU race for shared parts. [#93022](https://github.com/ClickHouse/ClickHouse/pull/93022) ([Azat Khuzhin](https://github.com/azat)).
* Fix crash when deserialising malformed `groupConcat` aggregate state with out-of-bounds offsets. [#93028](https://github.com/ClickHouse/ClickHouse/pull/93028) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fix leaving connection in a broken state after preliminary cancellation distributed queries. [#93029](https://github.com/ClickHouse/ClickHouse/pull/93029) ([Azat Khuzhin](https://github.com/azat)).
* Fix join results when the right-side join key is a sparse column. This closes [#92920](https://github.com/ClickHouse/ClickHouse/issues/92920). I can only reproduce the bug with `set compatibility='23.3'`. Not sure if it should be backported. [#93038](https://github.com/ClickHouse/ClickHouse/pull/93038) ([Amos Bird](https://github.com/amosbird)).
* Fix possible `Cannot finalize buffer after cancellation` in `estimateCompressionRatio()`. Fixes: [#87380](https://github.com/ClickHouse/ClickHouse/issues/87380). [#93068](https://github.com/ClickHouse/ClickHouse/pull/93068) ([Azat Khuzhin](https://github.com/azat)).
* Fixed merges of text indexes built on top of the complex expressions (such as `concat(col1, col2)`). [#93073](https://github.com/ClickHouse/ClickHouse/pull/93073) ([Anton Popov](https://github.com/CurtizJ)).
* Fix applying projection when filter contains subcolumns. Closes [#92882](https://github.com/ClickHouse/ClickHouse/issues/92882). [#93141](https://github.com/ClickHouse/ClickHouse/pull/93141) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix logical error in some cases triggered when join runtime filters are added to query plan. It was caused by incorrectly returning duplicated const columns from one of join sides. [#93144](https://github.com/ClickHouse/ClickHouse/pull/93144) ([Alexander Gololobov](https://github.com/davenger)).
* Special function `__applyFilter` used by join runtime filters was returning ILLEGAL\_TYPE\_OF\_ARGUMENT in some valid cases. [#93187](https://github.com/ClickHouse/ClickHouse/pull/93187) ([Alexander Gololobov](https://github.com/davenger)).
* Prevent different interpolated columns from collapse into the same column in a block when interpolated columns are effectively aliases of the same column. [#93197](https://github.com/ClickHouse/ClickHouse/pull/93197) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* Do not add runtime filter when joining with already filled right table. [#93211](https://github.com/ClickHouse/ClickHouse/pull/93211) ([Alexander Gololobov](https://github.com/davenger)).
* Fix keeper persistent watches cleanup after dead session. This closes [#92480](https://github.com/ClickHouse/ClickHouse/issues/92480). [#93213](https://github.com/ClickHouse/ClickHouse/pull/93213) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix order by tuple in iceberg. This closes [#92977](https://github.com/ClickHouse/ClickHouse/issues/92977). [#93225](https://github.com/ClickHouse/ClickHouse/pull/93225) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix bug with S3Queue setting `s3queue_migrate_old_metadata_to_buckets`. Closes [#93392](https://github.com/ClickHouse/ClickHouse/issues/93392), [#93196](https://github.com/ClickHouse/ClickHouse/issues/93196), [#81739](https://github.com/ClickHouse/ClickHouse/issues/81739). [#93232](https://github.com/ClickHouse/ClickHouse/pull/93232) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Remove unused columns when the projection is rebuilt during the merge. It reduces memory usage and creates fewer temporary parts. [#93233](https://github.com/ClickHouse/ClickHouse/pull/93233) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fix unused columns removal from subqueries in the presence of a scalar correlated subquery. Before the fix column could have been removed if it was used only in the correlated subquery, and the query would fail with `NOT_FOUND_COLUMN_IN_BLOCK` error. [#93273](https://github.com/ClickHouse/ClickHouse/pull/93273) ([Dmitry Novik](https://github.com/novikd)).
* Fix possible missing subcolumn in MV during alter of source table. Closes [#93231](https://github.com/ClickHouse/ClickHouse/issues/93231). [#93276](https://github.com/ClickHouse/ClickHouse/pull/93276) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix the `Merge` table engine query planning with the analyzer that could throw ILLEGAL\_COLUMN for `hostName()` when merging local and remote/Distributed tables. Closes [#92059](https://github.com/ClickHouse/ClickHouse/issues/92059). [#93286](https://github.com/ClickHouse/ClickHouse/pull/93286) ([Jinlin](https://github.com/withlin)).
* Fixes a case where NOT IN with non-constant array arguments was returning the wrong value + Support for non-constant Array functions. Closes [#14980](https://github.com/ClickHouse/ClickHouse/issues/14980). [#93314](https://github.com/ClickHouse/ClickHouse/pull/93314) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* Fix `Not found column` for `use_top_k_dynamic_filtering` optimization. Fixes [#93186](https://github.com/ClickHouse/ClickHouse/issues/93186). [#93316](https://github.com/ClickHouse/ClickHouse/pull/93316) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* Fixed rebuilding of text indexes created on top of subcolumns. [#93326](https://github.com/ClickHouse/ClickHouse/pull/93326) ([Anton Popov](https://github.com/CurtizJ)).
* Fixed handling of empty array as a second argument in `hasAllTokens` and `hasAnyTokens` functions. [#93328](https://github.com/ClickHouse/ClickHouse/pull/93328) ([Anton Popov](https://github.com/CurtizJ)).
* Fix logical error when runtime filters are used in a query with totals for right side table. [#93330](https://github.com/ClickHouse/ClickHouse/pull/93330) ([Alexander Gololobov](https://github.com/davenger)).
* The server no longer crashes if function `tokens` is called with non-const tokenizer parameters (the 2th, 3rd, 4th parameter), e.g., `SELECT tokens(NULL, 1, materialize(1))`. [#93383](https://github.com/ClickHouse/ClickHouse/pull/93383) ([Robert Schulze](https://github.com/rschu1ze)).
* Fixed integer overflow vulnerability in `groupConcat` state deserialisation that could cause memory safety issues with crafted aggregate states. [#93426](https://github.com/ClickHouse/ClickHouse/pull/93426) ([Raufs Dunamalijevs](https://github.com/rienath)).
* Fixed text index analysis on array columns when the index contains no tokens (all arrays are empty or all tokens are skipped by the tokenizer). [#93457](https://github.com/ClickHouse/ClickHouse/pull/93457) ([Anton Popov](https://github.com/CurtizJ)).
* Avoids oauth login in ClickHouse Client when username/password are within the connection string. [#93459](https://github.com/ClickHouse/ClickHouse/pull/93459) ([Krishna Mannem](https://github.com/kcmannem)).
* Fix Azure ADLS Gen2 vended credentials support in DataLakeCatalog - parse `adls.sas-token.*` keys from Iceberg REST catalogs and fix ABFSS URL parsing. [#93477](https://github.com/ClickHouse/ClickHouse/pull/93477) ([Karun Anantharaman](https://github.com/karunmotorq)).
* Fix GLOBAL IN support with analyzer (previously set was created on the remote node again). [#93507](https://github.com/ClickHouse/ClickHouse/pull/93507) ([Azat Khuzhin](https://github.com/azat)).
* Fix extracting subcolumn during deserialization directly into Sparse columns. [#93512](https://github.com/ClickHouse/ClickHouse/pull/93512) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed direct reading from text index with duplicate search queries. [#93516](https://github.com/ClickHouse/ClickHouse/pull/93516) ([Anton Popov](https://github.com/CurtizJ)).
* Fix for NOT\_FOUND\_COLUMN\_IN\_BLOCK error when runtime filter is enabled and joined tables have the same column returned multiple times (e.g. SELECT a, a, a FROM t). [#93526](https://github.com/ClickHouse/ClickHouse/pull/93526) ([Alexander Gololobov](https://github.com/davenger)).
* Fix a bug where clickhouse-client would ask for password twice when connecting using ssh. [#93547](https://github.com/ClickHouse/ClickHouse/pull/93547) ([Isak Ellmer](https://github.com/spinojara)).
* Make sure that zookeeper is finalized on shutdown (fix possible hung on shutdown in very unlikely cases). [#93602](https://github.com/ClickHouse/ClickHouse/pull/93602) ([Azat Khuzhin](https://github.com/azat)).
* Fix LOGICAL\_ERROR when restoring ReplicatedMergeTree with deduplication race. [#93612](https://github.com/ClickHouse/ClickHouse/pull/93612) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix using Sparse column for TTL update during direct deserialization into Sparse columns in some input formats. It fixes possible logical error `Unexpected type of result TTL column`. [#93619](https://github.com/ClickHouse/ClickHouse/pull/93619) ([Pavel Kruglov](https://github.com/Avogar)).
* Fixed h3 index functions sometimes crashing or getting stuck when called on invalid inputs. [#93657](https://github.com/ClickHouse/ClickHouse/pull/93657) ([Michael Kolupaev](https://github.com/al13n321)).
* The usage of `ngram_bf` index on a non-UTF-8 data led to an uninitialized memory read, with values that could reside in the resulting index structure. Closes [#92576](https://github.com/ClickHouse/ClickHouse/issues/92576). [#93663](https://github.com/ClickHouse/ClickHouse/pull/93663) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Validate that the decompressed buffer size is as expected. [#93690](https://github.com/ClickHouse/ClickHouse/pull/93690) ([Raúl Marín](https://github.com/Algunenano)).
* Prevent users to get the list of columns from a table without checking `SHOW COLUMNS` permission using the `merge` table engine. [#93695](https://github.com/ClickHouse/ClickHouse/pull/93695) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* Fixed materialization of skip indexes created on top of subcolumns. [#93708](https://github.com/ClickHouse/ClickHouse/pull/93708) ([Anton Popov](https://github.com/CurtizJ)).
* We store storages' shared pointers in `QueryPipeline::resources::storage_holders` to make sure that the `IStorage` objects are not destroyed while `PipelineExecutor` is alive. [#93746](https://github.com/ClickHouse/ClickHouse/pull/93746) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix attaching Replicated DBs when the interserver host changed after restarting. [#93779](https://github.com/ClickHouse/ClickHouse/pull/93779) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fix assert `!read_until_position` in `ReadBufferFromS3` which happened when cache is enabled. [#93809](https://github.com/ClickHouse/ClickHouse/pull/93809) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix logical error in a rare case when empty tuple is used with `Map` column. Closes [#93784](https://github.com/ClickHouse/ClickHouse/issues/93784). [#93814](https://github.com/ClickHouse/ClickHouse/pull/93814) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fixed `_part_offset` corruption when projections are rebuilt during merges, and optimized projection processing by avoiding unnecessary reads of the `_part_offset` column and skipping unneeded columns in projection calculations. This continues the optimizations introduced in [#93233](https://github.com/ClickHouse/ClickHouse/issues/93233). [#93827](https://github.com/ClickHouse/ClickHouse/pull/93827) ([Amos Bird](https://github.com/amosbird)).
* Remove 'Bad version' handling. [#93843](https://github.com/ClickHouse/ClickHouse/pull/93843) ([Anton Ivashkin](https://github.com/ianton-ru)).
* Fix `optimize_inverse_dictionary_lookup` not working with distributed query when key is signed integral type. Closes [#93259](https://github.com/ClickHouse/ClickHouse/issues/93259). [#93848](https://github.com/ClickHouse/ClickHouse/pull/93848) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix `lag`/`lead` not working with distributed `remote()` query. Closes [#90014](https://github.com/ClickHouse/ClickHouse/issues/90014). [#93858](https://github.com/ClickHouse/ClickHouse/pull/93858) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix system instrument dispatch bug. [#93937](https://github.com/ClickHouse/ClickHouse/pull/93937) ([Pablo Marcos](https://github.com/pamarcos)).
* In [https://github.com/ClickHouse/ClickHouse/pull/89173](https://github.com/ClickHouse/ClickHouse/pull/89173), we added an extra field to the structure that `TraceSender` sends through an internal pipe. However, the buffer size was not updated ([here](https://github.com/ClickHouse/ClickHouse/pull/89173/changes#diff-36ecfac5cde34c92c031652d8a77f0d12782cd5d43e68d6ef159e6d46a54224fL44)), therefore we are writing more data to buffer than `buffer_size` which results in multiple flushes. And because `TraceSender::send` is called from different threads, different threads' flushes may interleave which breaks the invariant that the receiving end (`TraceCollector`) relies on. [#93966](https://github.com/ClickHouse/ClickHouse/pull/93966) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix type conversion to super type during the join operation of the storage `Join` with `USING` clause. Fixes [#91672](https://github.com/ClickHouse/ClickHouse/issues/91672). Fixes [#78572](https://github.com/ClickHouse/ClickHouse/issues/78572). [#94000](https://github.com/ClickHouse/ClickHouse/pull/94000) ([Dmitry Novik](https://github.com/novikd)).
* Fix for FilterStep not properly added when join runtime filter is applied over Merge table. [#94021](https://github.com/ClickHouse/ClickHouse/pull/94021) ([Alexander Gololobov](https://github.com/davenger)).
* A `SELECT` query containing a predicate on multiple columns with bloom filter skip indexes and both `OR` and `NOT` conditions are present could return inconsistent results. That is fixed now. [#94026](https://github.com/ClickHouse/ClickHouse/pull/94026) ([Shankar Iyer](https://github.com/shankar-iyer)).
* Fix CLEAR column with dependent indices. [#94057](https://github.com/ClickHouse/ClickHouse/pull/94057) ([Raúl Marín](https://github.com/Algunenano)).
* Fix use-of-uninitialized-value in `ReadWriteBufferFromHTTP`. [#94058](https://github.com/ClickHouse/ClickHouse/pull/94058) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix bad check for typed paths in JSON. The check was introduced in [https://github.com/ClickHouse/ClickHouse/pull/92842](https://github.com/ClickHouse/ClickHouse/pull/92842) and can lead to an error during existing tables startup. [#94070](https://github.com/ClickHouse/ClickHouse/pull/94070) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix the crash during filter analysis in the presence of OUTER JOIN. Fixes [#90979](https://github.com/ClickHouse/ClickHouse/issues/90979). [#94080](https://github.com/ClickHouse/ClickHouse/pull/94080) ([Dmitry Novik](https://github.com/novikd)).
* Fix accuracy of `uniqTheta` when using UInt8 aggregation keys in parallel (`max_threads` > 1 - default). [#94095](https://github.com/ClickHouse/ClickHouse/pull/94095) ([Azat Khuzhin](https://github.com/azat)).
* Fix crash caused by exception thrown from a `socket.setBlocking(true)` call inside `SCOPE_EXIT`. [#94100](https://github.com/ClickHouse/ClickHouse/pull/94100) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix data loss when `DROP PARTITION` removes parts created by later log entries in ReplicatedMergeTree. [#94123](https://github.com/ClickHouse/ClickHouse/pull/94123) ([Tuan Pham Anh](https://github.com/tuanpach)).
* Fixed parquet reader v3 incorrectly handling arrays that cross page boundaries. This happens e.g. for files written by Arrow without enabling page statistics or page index. Affects only columns of Array data type. Likely symptom is that one array every \~1 MB of data gets truncated. Before this fix, use this setting as workaround: `input_format_parquet_use_native_reader_v3 = 0`. [#94125](https://github.com/ClickHouse/ClickHouse/pull/94125) ([Michael Kolupaev](https://github.com/al13n321)).
* Fix too many watches in ReplicatedMergeTree while waiting for log entry. [#94133](https://github.com/ClickHouse/ClickHouse/pull/94133) ([Azat Khuzhin](https://github.com/azat)).
* Functions `arrayShuffle`, `arrayPartialShuffle` and `arrayRandomSample` to materialize const columns - so that different rows get different results. [#94134](https://github.com/ClickHouse/ClickHouse/pull/94134) ([Joanna Hulboj](https://github.com/jh0x)).
* Fix data race in evaluating table functions in materialized views. [#94171](https://github.com/ClickHouse/ClickHouse/pull/94171) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix nullptr dereference in `PostgreSQL` database engines (when the query is incorrect). Closes [#92887](https://github.com/ClickHouse/ClickHouse/issues/92887). [#94180](https://github.com/ClickHouse/ClickHouse/pull/94180) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix memory leak in refreshable materialized views using `SELECT` queries with multiple subqueries. [#94200](https://github.com/ClickHouse/ClickHouse/pull/94200) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix data race in `DataPartStorageOnDiskBase::remove` vs `system.parts`. Closes [#49076](https://github.com/ClickHouse/ClickHouse/issues/49076). [#94262](https://github.com/ClickHouse/ClickHouse/pull/94262) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Remove the wrong `noexcept` specifier at HashTable copy assignment that may lead to crash (`std::terminate`) on memory exceptions. [#94275](https://github.com/ClickHouse/ClickHouse/pull/94275) ([Nikita Taranov](https://github.com/nickitat)).
* Previously, creating a projection with duplicate columns in GROUP BY (e.g., `GROUP BY c0, c0`) and inserting data caused a `std::length_error` if `optimize_row_order` is enabled. Closes [#94065](https://github.com/ClickHouse/ClickHouse/issues/94065). [#94277](https://github.com/ClickHouse/ClickHouse/pull/94277) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix obscure bug in ZooKeeper client on connect which leads to hungs and crashes. [#94320](https://github.com/ClickHouse/ClickHouse/pull/94320) ([Azat Khuzhin](https://github.com/azat)).
* Fix function to subcolumns optimization not applied to subcolumns. [#94323](https://github.com/ClickHouse/ClickHouse/pull/94323) ([Pavel Kruglov](https://github.com/Avogar)).
* Fix possibly incorrect result in nested RIGHT JOINs when `enable_lazy_columns_replication` is enabled. The bug caused all rows in replicated columns to incorrectly return the same value instead of their distinct values. Close [#93891](https://github.com/ClickHouse/ClickHouse/issues/93891). [#94339](https://github.com/ClickHouse/ClickHouse/pull/94339) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Fix filter pushdown for SEMI JOIN using equivalence sets. Do not push the filter down if argument types have changed. Fixes [#93264](https://github.com/ClickHouse/ClickHouse/issues/93264). [#94340](https://github.com/ClickHouse/ClickHouse/pull/94340) ([Dmitry Novik](https://github.com/novikd)).
* Fix usage of DeltaLake CDF with database DataLake database engine (delta lake catalogs integration). Closes [#94122](https://github.com/ClickHouse/ClickHouse/issues/94122). [#94342](https://github.com/ClickHouse/ClickHouse/pull/94342) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Fix incorrect value of current metric `FilesystemCacheSizeLimit` in case `SLRU` cache policy was used. [#94363](https://github.com/ClickHouse/ClickHouse/pull/94363) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Creating a Backup database engine with less than two arguments now returns a more descriptive error message (`Wrong number of arguments` instead of `std::out_of_range: InlinedVector::at(size_type) const failed bounds check.`). [#94374](https://github.com/ClickHouse/ClickHouse/pull/94374) ([Robert Schulze](https://github.com/rschu1ze)).
* Ignores impossible revokes of global grants on the database level for grants with grant option. [#94386](https://github.com/ClickHouse/ClickHouse/pull/94386) ([pufit](https://github.com/pufit)).
* Fix reading sparse offsets from compact parts. Closes [#94385](https://github.com/ClickHouse/ClickHouse/issues/94385). [#94399](https://github.com/ClickHouse/ClickHouse/pull/94399) ([Pavel Kruglov](https://github.com/Avogar)).
* Don't prevent ALTER of columns using implicit indexes, even if `alter_column_secondary_index_mode`'s `throw` mode is used. [#94425](https://github.com/ClickHouse/ClickHouse/pull/94425) ([Raúl Marín](https://github.com/Algunenano)).
* Fix crash in `TCPHandler` when multiple `receivePacketsExpectQuery` calls read `Protocol::Client::IgnoredPartUUIDs`. [#94434](https://github.com/ClickHouse/ClickHouse/pull/94434) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fix masking sensitive data in `system.functions`. [#94436](https://github.com/ClickHouse/ClickHouse/pull/94436) ([Vitaly Baranov](https://github.com/vitlibar)).
* Fix nullptr dereference with disabled `send_profile_events`. This feature was introduced recently for the ClickHouse Python driver. Closes [#92488](https://github.com/ClickHouse/ClickHouse/issues/92488). [#94466](https://github.com/ClickHouse/ClickHouse/pull/94466) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix text index .mrk incompatibility during merges. [#94494](https://github.com/ClickHouse/ClickHouse/pull/94494) ([Peng Jian](https://github.com/fastio)).
* When `read_in_order_use_virtual_row` is enabled, the code was accessing index columns based on the full primary key size without checking if the index was truncated, leading to use-after-free / uninitialized memory. Closes [#85596](https://github.com/ClickHouse/ClickHouse/issues/85596). [#94500](https://github.com/ClickHouse/ClickHouse/pull/94500) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix an error due to a type mismatch when sending external tables for subqueries with GLOBAL IN if the types are Nullable. Closes [#94097](https://github.com/ClickHouse/ClickHouse/issues/94097). [#94511](https://github.com/ClickHouse/ClickHouse/pull/94511) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* In previous versions, queries with multiple index conditions over the same expression may erroneously throw an exception `Not found column`. Closes [#60660](https://github.com/ClickHouse/ClickHouse/issues/60660). [#94515](https://github.com/ClickHouse/ClickHouse/pull/94515) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix incorrect handling of Nullable join column in runtime filters. [#94555](https://github.com/ClickHouse/ClickHouse/pull/94555) ([Alexander Gololobov](https://github.com/davenger)).
* Creating a workload in another workload that is currently in use no longer causes a crash. [#94599](https://github.com/ClickHouse/ClickHouse/pull/94599) ([Sergei Trifonov](https://github.com/serxa)).
* Fix a crash during ANY LEFT JOIN optimization when `isNotNull` is evaluated on a missing column. [#94600](https://github.com/ClickHouse/ClickHouse/pull/94600) ([Molly](https://github.com/ggmolly)).
* Fix default expression evaluation when referencing other columns with computed defaults. [#94615](https://github.com/ClickHouse/ClickHouse/pull/94615) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix permission issues in BACKUP/RESTORE operations. [#94617](https://github.com/ClickHouse/ClickHouse/pull/94617) ([Pablo Marcos](https://github.com/pamarcos)).
* Fix crash due to incorrect type cast when the data type is `Nullable(DateTime64)`. [#94627](https://github.com/ClickHouse/ClickHouse/pull/94627) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* Fixes a bug where certain distributed queries with `ORDER BY` could return `ALIAS` columns with swapped values (i.e., column `a` showing column `b`’s data and vice versa). [#94644](https://github.com/ClickHouse/ClickHouse/pull/94644) ([filimonov](https://github.com/filimonov)).
* Fix storing results of keeper-bench to file. [#94654](https://github.com/ClickHouse/ClickHouse/pull/94654) ([Antonio Andelic](https://github.com/antonio2368)).
* Fix incorrect estimations with MinMax-type statistics when the column contains negative floating-point values. [#94665](https://github.com/ClickHouse/ClickHouse/pull/94665) ([zoomxi](https://github.com/zoomxi)).
* Fix reading Parquet files when a map's key is a struct. [#94670](https://github.com/ClickHouse/ClickHouse/pull/94670) ([Konstantin Vedernikov](https://github.com/scanhex12)).
* Fix possibly incorrect RIGHT join result when using complex ON conditions. Close [#92913](https://github.com/ClickHouse/ClickHouse/issues/92913). [#94680](https://github.com/ClickHouse/ClickHouse/pull/94680) ([Vladimir Cherkasov](https://github.com/vdimir)).
* Preserve constant index granularity (use\_const\_adaptive\_granularity) after Vertical merges. [#94725](https://github.com/ClickHouse/ClickHouse/pull/94725) ([Azat Khuzhin](https://github.com/azat)).
* Fix mutation bug with scalar subqueries and table dependencies. If a table had dependencies (index or projections) over a column, scalar subqueries might be evaluated and cached without data and lead to incorrect changes. [#94731](https://github.com/ClickHouse/ClickHouse/pull/94731) ([Raúl Marín](https://github.com/Algunenano)).
* Fix AsynchronousMetrics cpu\_pressure fallback on error. [#94827](https://github.com/ClickHouse/ClickHouse/pull/94827) ([Raúl Marín](https://github.com/Algunenano)).
* The `getURLHostRFC` function was missing bounds checks before dereferencing pointers. When an empty string was passed to `domainRFC`, it would read uninitialized memory, triggering MSan errors. [#94851](https://github.com/ClickHouse/ClickHouse/pull/94851) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix readonlyness of encrypted disks. [#94852](https://github.com/ClickHouse/ClickHouse/pull/94852) ([Azat Khuzhin](https://github.com/azat)).
* Fix logical error in fractional `LIMIT/OFFSET` when using the old analyzer with Distributed tables. Closes [#94712](https://github.com/ClickHouse/ClickHouse/issues/94712). [#94999](https://github.com/ClickHouse/ClickHouse/pull/94999) ([Ahmed Gouda](https://github.com/0xgouda)).
* Fix crash under some conditions when join runtime filters are enabled by default. [#95000](https://github.com/ClickHouse/ClickHouse/pull/95000) ([Alexander Gololobov](https://github.com/davenger)).
* Improve masking passwords in url used in table engine `URL()` and table function `url()`. [#95006](https://github.com/ClickHouse/ClickHouse/pull/95006) ([Vitaly Baranov](https://github.com/vitlibar)).
* Function `toStartOfInterval` now works in the same way as `toStartOfX`, where `X` is `Day, Week, Month, Quarter, Year` when the `enable_extended_results_for_datetime_functions` is on. [#95011](https://github.com/ClickHouse/ClickHouse/pull/95011) ([Kirill Kopnev](https://github.com/Fgrtue)).
* Fix constant string comparisons not respecting the settings `cast_string_to_date_time_mode`, `bool_true_representation`, `bool_false_representation`, and `input_format_null_as_default`. Closes [#91681](https://github.com/ClickHouse/ClickHouse/issues/91681). [#95040](https://github.com/ClickHouse/ClickHouse/pull/95040) ([Nihal Z. Miaji](https://github.com/nihalzp)).
* Fix data race in the filesystem cache. [#95064](https://github.com/ClickHouse/ClickHouse/pull/95064) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix a rare race condition in the Parquet reader. [#95068](https://github.com/ClickHouse/ClickHouse/pull/95068) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Fix crash in the top K optimization when `LIMIT` is zero. Closes [#93893](https://github.com/ClickHouse/ClickHouse/issues/93893). [#95072](https://github.com/ClickHouse/ClickHouse/pull/95072) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Converting from DateTime/integers to Time64 extracts the time-of-day component using `toTime`, which is not monotonic. The `ToDateTimeMonotonicity` template incorrectly claimed this conversion was monotonic, causing "Invalid binary search result in MergeTreeSetIndex" exception in debug builds. [#95125](https://github.com/ClickHouse/ClickHouse/pull/95125) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Recreated list of manifest file entries only if necessary (previously it was done on each iteration). [#95162](https://github.com/ClickHouse/ClickHouse/pull/95162) ([Daniil Ivanik](https://github.com/divanik)).

<h4 id="261-build-testing-packaging-improvement">
  Build/Testing/Packaging Improvement
</h4>

* Add a set of tools for profiling memory allocations in the ClickHouse SQL parser using jemalloc's heap profiling capabilities. [#94072](https://github.com/ClickHouse/ClickHouse/pull/94072) ([Ilya Yatsishin](https://github.com/qoega)).
* Added a tool that simplifies debugging of memory allocations in parser. It uses jemalloc `stats.allocated` metric before and after we parse query to AST representation to show what is allocated. Also it supports memory profiling mode that dumps profile before and after to build reports where allocations occurred. [#93523](https://github.com/ClickHouse/ClickHouse/pull/93523) ([Ilya Yatsishin](https://github.com/qoega)).
* Remove transitive libc++ includes. [#92523](https://github.com/ClickHouse/ClickHouse/pull/92523) ([Raúl Marín](https://github.com/Algunenano)).
* Make some sequential tests parallel: [https://github.com/ClickHouse/ClickHouse/pull/93030/changes#diff-c3a73510dae653c9bbfa24300b32f5d6ec663fd4e72cc4a3d5daa6e4342915df](https://github.com/ClickHouse/ClickHouse/pull/93030/changes#diff-c3a73510dae653c9bbfa24300b32f5d6ec663fd4e72cc4a3d5daa6e4342915df). [#93030](https://github.com/ClickHouse/ClickHouse/pull/93030) ([Nikita Fomichev](https://github.com/fm4v)).
* Cleanup some build flags. [#93679](https://github.com/ClickHouse/ClickHouse/pull/93679) ([Raúl Marín](https://github.com/Algunenano)).
* Bump c-ares from v1.34.5 to v1.34.6. This addresses c-ares' `CVE-2025-62408`, which is not relevant for ClickHouse. [#94129](https://github.com/ClickHouse/ClickHouse/pull/94129) ([Govind R Nair](https://github.com/Revertionist)).
* Use `curl` 8.18.0. [#94742](https://github.com/ClickHouse/ClickHouse/pull/94742) ([Konstantin Bogdanov](https://github.com/thevar1able)).
