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

# 2020 更新日志

> 2020 年的更新日志

<div id="clickhouse-release-2012">
  ### ClickHouse 版本发布 20.12
</div>

<div id="clickhouse-release-v2012514-stable-2020-12-28">
  ### ClickHouse 版本发布 v20.12.5.14-稳定版本，2020-12-28
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 在 merge 期间禁用使用 AIO 进行写入，因为这在极少数情况下可能会导致 merge 过程中的主键列数据损坏。[#18481](https://github.com/ClickHouse/ClickHouse/pull/18481) ([alesapin](https://github.com/alesapin)).
* 修复了在执行 `toType(...)` 函数 (`toDate`、`toUInt32` 等) 且参数类型为 `Nullable(String)` 时出现的 `value is too short` 错误。现在，这类函数在发生解析错误时会返回 `NULL`，而不是抛出异常。修复了 [#7673](https://github.com/ClickHouse/ClickHouse/issues/7673)。[#18445](https://github.com/ClickHouse/ClickHouse/pull/18445) ([tavplubix](https://github.com/tavplubix)).
* 限制从 wide 到 compact parts 的 merge。在 vertical merge 的情况下，这会导致生成的 part 损坏。[#18381](https://github.com/ClickHouse/ClickHouse/pull/18381) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了填充表 `system.settings_profile_elements` 时的问题。此 PR 修复了 [#18231](https://github.com/ClickHouse/ClickHouse/issues/18231)。[#18379](https://github.com/ClickHouse/ClickHouse/pull/18379) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复了在使用 two-level aggregation 时，带有组合器 `Distinct` 的聚合函数可能崩溃的问题。修复了 [#17682](https://github.com/ClickHouse/ClickHouse/issues/17682)。[#18365](https://github.com/ClickHouse/ClickHouse/pull/18365) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了查询 `MODIFY COLUMN ... REMOVE TTL` 实际上未删除列生存时间 (TTL) 的错误。[#18130](https://github.com/ClickHouse/ClickHouse/pull/18130) ([alesapin](https://github.com/alesapin)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 将时区信息更新为 2020e。[#18531](https://github.com/ClickHouse/ClickHouse/pull/18531) ([alesapin](https://github.com/alesapin)).

<div id="clickhouse-release-v201245-stable-2020-12-24">
  ### ClickHouse 版本发布 v20.12.4.5-稳定版本, 2020-12-24
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在同时启用 IPv4/IPv6 双协议栈的机器上，server 无法访问 `clickhouse-odbc-bridge` 进程的问题；修复了使用格式错误的查询执行 ODBC 字典更新和/或导致崩溃的问题；可能关闭了 [#14489](https://github.com/ClickHouse/ClickHouse/issues/14489)。[#18278](https://github.com/ClickHouse/ClickHouse/pull/18278) ([Denis Glazachev](https://github.com/traceon)).
* 修复了枚举与 Int 类型之间的键比较问题。此修复解决了 [#17989](https://github.com/ClickHouse/ClickHouse/issues/17989)。[#18214](https://github.com/ClickHouse/ClickHouse/pull/18214) ([Amos Bird](https://github.com/amosbird)).
* 修复了 `MaterializeMySQL` database engine 中唯一键转换时崩溃的问题。此修复解决了 [#18186](https://github.com/ClickHouse/ClickHouse/issues/18186) 和 [#16372](https://github.com/ClickHouse/ClickHouse/issues/16372) [#18211](https://github.com/ClickHouse/ClickHouse/pull/18211) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了 S3 URL 解析中的 `std::out_of_range: basic_string` 问题。[#18059](https://github.com/ClickHouse/ClickHouse/pull/18059) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 修复了因 MaterializeMySQL 不支持转换 MySQL 前缀索引，导致部分表未能从 MySQL 同步到 ClickHouse 的问题。此修复解决了 [#15187](https://github.com/ClickHouse/ClickHouse/issues/15187) 和 [#17912](https://github.com/ClickHouse/ClickHouse/issues/17912) [#17944](https://github.com/ClickHouse/ClickHouse/pull/17944) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了当查询包含 `ARRAY JOIN` 时，query optimization 可能产生错误结果的问题。[#17887](https://github.com/ClickHouse/ClickHouse/pull/17887) ([sundyli](https://github.com/sundy-li)).
* 修复了 `topK` aggregate function 中可能出现的段错误。此修复关闭了 [#17404](https://github.com/ClickHouse/ClickHouse/issues/17404)。[#17845](https://github.com/ClickHouse/ClickHouse/pull/17845) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了 server 以守护进程模式运行时，`system.stack_trace` 表为空的问题。[#17630](https://github.com/ClickHouse/ClickHouse/pull/17630) ([Amos Bird](https://github.com/amosbird)).

<div id="clickhouse-release-v201233-stable-2020-12-13">
  ### ClickHouse 版本发布 v20.12.3.3-稳定版本，2020-12-13
</div>

<div id="backward-incompatible-change">
  #### 向后不兼容变更
</div>

* 默认启用 `use_compact_format_in_distributed_parts_names` (参见相关参考文档) 。[#16728](https://github.com/ClickHouse/ClickHouse/pull/16728) ([Azat Khuzhin](https://github.com/azat)).
* 在创建使用 `File` 表引擎的表时，允许在 `SETTINGS` 子句中指定与文件格式相关的用户设置 (例如 `format_csv_delimiter`) ，并在所有 `INSERT` 和 `SELECT` 中使用这些设置。在当前用户会话中更改的文件格式设置，或在 DML 查询自身的 `SETTINGS` 子句中指定的文件格式设置，不再影响该查询。[#16591](https://github.com/ClickHouse/ClickHouse/pull/16591) ([Alexander Kuzmenkov](https://github.com/akuzm)).

<div id="new-feature">
  #### 新功能
</div>

* 新增对 `*.xz` 压缩/解压的支持。这使得在 `file()` 函数中可以使用 `*.xz`。此更改关闭了 [#8828](https://github.com/ClickHouse/ClickHouse/issues/8828)。[#16578](https://github.com/ClickHouse/ClickHouse/pull/16578) ([Abi Palagashvili](https://github.com/fibersel)) 。
* 引入了查询 `ALTER TABLE ... DROP|DETACH PART 'part_name'`。[#15511](https://github.com/ClickHouse/ClickHouse/pull/15511) ([nvartolomei](https://github.com/nvartolomei)) 。
* 新增 ALTER UPDATE/DELETE IN PARTITION 语法。[#13403](https://github.com/ClickHouse/ClickHouse/pull/13403) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 在使用 JSON 输入/输出格式时，允许将命名元组格式化为 JSON object，由 `output_format_json_named_tuples_as_objects` 设置控制，默认禁用。[#17175](https://github.com/ClickHouse/ClickHouse/pull/17175) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 默认允许在 TSV 和 CSV 格式中将枚举值的 id 作为输入值。[#16834](https://github.com/ClickHouse/ClickHouse/pull/16834) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 Nullable、LowCardinality、Array 和 Tuple 新增了 COLLATE 支持，其中嵌套类型为 String。同时还重构了 ColumnString.cpp 中与排序规则相关的代码。[#16273](https://github.com/ClickHouse/ClickHouse/pull/16273) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增 `tcpPort` 函数，返回该服务器监听的 TCP 端口。[#17134](https://github.com/ClickHouse/ClickHouse/pull/17134) ([Ivan](https://github.com/abyss7)) 。
* 新增数学函数：`acosh`、`asinh`、`atan2`、`atanh`、`cosh`、`hypot`、`log1p`、`sinh`。[#16636](https://github.com/ClickHouse/ClickHouse/pull/16636) ([Konstantin Malanchev](https://github.com/hombit)) 。
* 支持在不同副本之间分配 merge 操作。引入了 `execute_merges_on_single_replica_time_threshold` MergeTree 设置。[#16424](https://github.com/ClickHouse/ClickHouse/pull/16424) ([filimonov](https://github.com/filimonov)) 。
* 为兼容 SQL 标准，新增设置 `aggregate_functions_null_for_empty`。该选项会重写查询中的所有 聚合函数，为它们添加 `-OrNull` 后缀。实现了 [10273](https://github.com/ClickHouse/ClickHouse/issues/10273)。[#16123](https://github.com/ClickHouse/ClickHouse/pull/16123) ([flynn](https://github.com/ucasFL)) 。
* 更新了 DateTime 和 DateTime64 的解析，以接受字符串 Date 字面量格式。[#16040](https://github.com/ClickHouse/ClickHouse/pull/16040) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 现在可以在 `clickhouse-client` 中使用 `--history_file` 参数修改 history file 的路径。[#15960](https://github.com/ClickHouse/ClickHouse/pull/15960) ([Maksim Kita](https://github.com/kitaisreal)) 。

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了极少数情况下 server 可能停止接受连接的问题。[#17542](https://github.com/ClickHouse/ClickHouse/pull/17542) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 ClickHouse 在 Windows Subsystem for Linux 上运行时，在 `Atomic` 数据库中执行 `RENAME` 查询会报 `Function not implemented` 错误的问题。修复了 [#17661](https://github.com/ClickHouse/ClickHouse/issues/17661)。[#17664](https://github.com/ClickHouse/ClickHouse/pull/17664) ([tavplubix](https://github.com/tavplubix)) 。
* 如果禁用了 `in_memory_parts_enable_wal`，则不要从 WAL 中恢复 parts。[#17802](https://github.com/ClickHouse/ClickHouse/pull/17802) ([detailyang](https://github.com/detailyang)) 。
* 修复了 MergeTreeWriterSettings 中将 `max_compress_block_size` 错误初始化为 `min_compress_block_size` 的问题。[#17833](https://github.com/ClickHouse/ClickHouse/pull/17833) ([flynn](https://github.com/ucasFL)) 。
* 有关可删除表最大大小的异常消息显示有误。[#17764](https://github.com/ClickHouse/ClickHouse/pull/17764) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在向 `Distributed` 表插入数据时，空间不足可能导致 segfault 的问题。[#17737](https://github.com/ClickHouse/ClickHouse/pull/17737) ([tavplubix](https://github.com/tavplubix)).
* 修复了 ClickHouse 无法恢复与 MySQL 服务器连接的问题。[#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 由于在 `pool_size` > 1 时存在竞态条件，执行 `ON CLUSTER` 查询时，可能会错误判断集群是否为环形 (交叉) 复制。现已修复。 [#17640](https://github.com/ClickHouse/ClickHouse/pull/17640) ([tavplubix](https://github.com/tavplubix)).
* 现在可在后台记录 MergeTree 表的异常 `fmt::v7::format_error`。此修复解决了 [#17613](https://github.com/ClickHouse/ClickHouse/issues/17613)。[#17615](https://github.com/ClickHouse/ClickHouse/pull/17615) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在交互模式下使用 clickhouse-client 执行多行查询时，单行注释此前会被错误地延伸到整个查询末尾。此修复解决了 [#13654](https://github.com/ClickHouse/ClickHouse/issues/13654)。[#17565](https://github.com/ClickHouse/ClickHouse/pull/17565) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了当相应变更在其他副本上被终止时，ALTER 查询挂起的问题。修复了 [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953)。[#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)).
* 修复了 ClickHouse 低估标记缓存大小的问题。在存在大量带有标记的微小文件时，可能会出现这种情况。[#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)) 。
* 修复启用设置 `optimize_redundant_functions_in_order_by` 时 `ORDER BY` 的问题。[#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了因错误优化导致 `DISTINCT` 后可能出现重复项的问题。修复 [#17294](https://github.com/ClickHouse/ClickHouse/issues/17294)。[#17296](https://github.com/ClickHouse/ClickHouse/pull/17296) ([li chengxiang](https://github.com/chengxianglibra))。[#17439](https://github.com/ClickHouse/ClickHouse/pull/17439) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复从 `JOIN` 表读取 `LowCardinality` 类型时出现的崩溃问题。修复了 [#17228](https://github.com/ClickHouse/ClickHouse/issues/17228)。[#17397](https://github.com/ClickHouse/ClickHouse/pull/17397) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `toInt256(inf)` 导致的栈溢出。Int256 是一项 Experimental 功能。已关闭 [#17235](https://github.com/ClickHouse/ClickHouse/issues/17235)。[#17257](https://github.com/ClickHouse/ClickHouse/pull/17257) ([flynn](https://github.com/ucasFL)) 。
* 修复带有 `LIMIT` 的 Distributed 查询可能记录 `Unexpected packet Data received from client` 错误的问题。[#17254](https://github.com/ClickHouse/ClickHouse/pull/17254) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了子查询中存在 const 列时 Set 索引失效的问题。此修复解决了 [#17246](https://github.com/ClickHouse/ClickHouse/issues/17246)。[#17249](https://github.com/ClickHouse/ClickHouse/pull/17249) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在索引比较类型不一致时，可能导致索引分析错误的问题。此修复解决了 [#17122](https://github.com/ClickHouse/ClickHouse/issues/17122)。[#17145](https://github.com/ClickHouse/ClickHouse/pull/17145) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了会导致崩溃的 ColumnConst 比较问题。此修复解决了 [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088)。[#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)) 。
* 针对 MaterializeMySQL (Experimental 功能) 的多项修复。修复了 [#16923](https://github.com/ClickHouse/ClickHouse/issues/16923)；修复了 [#15883](https://github.com/ClickHouse/ClickHouse/issues/15883)；修复了在修改 MySQL binlog\_checksum 时 MaterializeMySQL SYNC 失败的问题。[#17091](https://github.com/ClickHouse/ClickHouse/pull/17091) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了一个 bug：在非 leader 的 ReplicatedMergeTree 表上，`ON CLUSTER` 查询可能会一直挂起。[#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
* 修复了以下崩溃问题：当 `some_table` 是通过 `AS table_function()` 创建时，执行 `CREATE TABLE ... AS some_table` 查询会发生崩溃。修复 [#16944](https://github.com/ClickHouse/ClickHouse/issues/16944)。[#17072](https://github.com/ClickHouse/ClickHouse/pull/17072) ([tavplubix](https://github.com/tavplubix)).
* 修复 `funciton fuzzBits` 实现未完成的问题，相关 issue：[#16980](https://github.com/ClickHouse/ClickHouse/issues/16980)。[#17051](https://github.com/ClickHouse/ClickHouse/pull/17051) ([hexiaoting](https://github.com/hexiaoting)).
* 修复了 CFA 寄存器为 RAX 时 LLVM's libunwind 出现的问题。这是 [LLVM's libunwind](https://github.com/llvm/llvm-project/tree/master/libunwind) 中的一个 [bug](https://bugs.llvm.org/show_bug.cgi?id=48186)。我们已经为此 bug 提供了变通方案。[#17046](https://github.com/ClickHouse/ClickHouse/pull/17046) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 避免可能在执行过程中被取消的远程查询 (如带有 `LIMIT` 的查询) 出现不必要的网络错误。[#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `optimize_distributed_group_by_sharding_key` 设置在仅使用 OFFSET 的查询中存在的问题 (该设置默认禁用) 。[#16996](https://github.com/ClickHouse/ClickHouse/pull/16996) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了基于分布式表的 Merge 表在使用 JOIN 时的问题。[#16993](https://github.com/ClickHouse/ClickHouse/pull/16993) ([Azat Khuzhin](https://github.com/azat)).
* 修复了从 double 转换为大整数 (128 位、256 位) 时结果错误的问题。大整数支持仍处于 Experimental 状态。[#16986](https://github.com/ClickHouse/ClickHouse/pull/16986) ([Mike](https://github.com/myrrc)) 。
* 修复了一种可能导致服务器崩溃的情况：在 `ALTER TABLE ... MODIFY COLUMN ... NewType` 之后，如果 `SELECT` 的 `WHERE` 表达式作用于正在修改的列，且 `ALTER` 尚未完成。[#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)) 。
* `clickhouse-git-import` 中的 blame 信息计算有误。[#16959](https://github.com/ClickHouse/ClickHouse/pull/16959) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了包含单调函数的 ORDER BY 优化问题。修复 [#16107](https://github.com/ClickHouse/ClickHouse/issues/16107)。[#16956](https://github.com/ClickHouse/ClickHouse/pull/16956) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在启用设置 `optimize_aggregators_of_group_by_keys` 并使用 JOIN 时，GROUP BY 优化的问题。修复 [#12604](https://github.com/ClickHouse/ClickHouse/issues/12604)。[#16951](https://github.com/ClickHouse/ClickHouse/pull/16951) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了带有 `ORDER BY` 的查询中可能出现的错误 `Illegal type of argument`。修复了 [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580)。[#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 InterpreterShowAccessQuery 中的奇怪代码。[#16866](https://github.com/ClickHouse/ClickHouse/pull/16866) ([tavplubix](https://github.com/tavplubix)) 。
* 防止在使用函数 `timeSeriesGroupSum` 时 ClickHouse server 崩溃。该函数已从较新的 ClickHouse 发行版中移除。[#16865](https://github.com/ClickHouse/ClickHouse/pull/16865) ([filimonov](https://github.com/filimonov)).
* 修复了在启用查询分析器，且 ClickHouse 安装于 glibc 版本对某些函数的异步展开表 (据称) 存在缺陷的操作系统上时，偶发的静默崩溃问题。此修复解决了 [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301)。此修复解决了 [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098)。[#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在未传入任何参数时使用 `any` 导致崩溃的问题。这是对 [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803) 的修复。抄送 @azat。[#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)) 。
* 如果在将表元数据写入磁盘时无法分配内存，就可能写出损坏的元数据文件。[#16772](https://github.com/ClickHouse/ClickHouse/pull/16772) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复带有分区谓词的简单查询优化。[#16767](https://github.com/ClickHouse/ClickHouse/pull/16767) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在启用 `transform_null_in` 设置时，涉及多列和元组的 `IN` 运算符问题。修复了 [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310)。[#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)) 。
* 通过 MySQL 协议，为 INSERT 查询返回受影响的行数。此前 ClickHouse 始终返回 0，现已修复。修复了 [#16605](https://github.com/ClickHouse/ClickHouse/issues/16605)。[#16715](https://github.com/ClickHouse/ClickHouse/pull/16715) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在使用 'if' 后缀聚合函数时远程查询失败的问题。修复 [#16574](https://github.com/ClickHouse/ClickHouse/issues/16574) 修复 [#16231](https://github.com/ClickHouse/ClickHouse/issues/16231) [#16610](https://github.com/ClickHouse/ClickHouse/pull/16610) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了 `select_sequential_consistency` 导致的优化后的简单 count 查询和 system.tables 行为不一致的问题。[#16309](https://github.com/ClickHouse/ClickHouse/pull/16309) ([Hao Chen](https://github.com/haoch)) 。

<div id="improvement">
  #### 改进
</div>

* 移除经生存时间 (TTL)、变更或 collapsing 合并算法清理后产生的空 parts。[#16895](https://github.com/ClickHouse/ClickHouse/pull/16895) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为分布式表中的异步发送目录启用紧凑格式：`use_compact_format_in_distributed_parts_names` 现默认设为 1。[#16788](https://github.com/ClickHouse/ClickHouse/pull/16788) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果未向 S3 写入任何数据，则中止分段上传。[#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 出错时，重新解析 `format_avro_schema_registry_url` 的 IP 地址。[#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)) 。
* 将 system.distribution\_queue 中 data\_path 里的密码做掩码处理。[#16727](https://github.com/ClickHouse/ClickHouse/pull/16727) ([Azat Khuzhin](https://github.com/azat)) 。
* 使用列转换器替换不存在的列时会抛出错误。[#16183](https://github.com/ClickHouse/ClickHouse/pull/16183) ([hexiaoting](https://github.com/hexiaoting)).
* 当内存不足以让所有线程同时工作时，会关闭并行解析。另外，如果有人尝试插入极大的行 (> min\_chunk\_bytes\_for\_parallel\_parsing) ，也可能会出现类似 "Memory limit exceeded" 的异常，因为每个待解析的片段都必须是一组相互独立的字符串 (一个或多个) 。[#16721](https://github.com/ClickHouse/ClickHouse/pull/16721) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 安装脚本应始终在配置目录中创建子目录。这仅与使用自定义配置的 Docker 构建有关。[#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
* 修正 JSONEachRow、JSONCompactEachRow 和 RegexpRow 输入格式中的错误消息语法。[#17205](https://github.com/ClickHouse/ClickHouse/pull/17205) ([nico piderman](https://github.com/sneako)) 。
* 将 `SOURCE(CLICKHOUSE(...))` 的默认 `host` 和 `port` 参数设为当前实例，并将默认 `user` 值设为 `'default'`。[#16997](https://github.com/ClickHouse/ClickHouse/pull/16997) ([vdimir](https://github.com/vdimir)) 。
* 在执行 `ATTACH/DETACH TABLE <DICTIONARY>` 时，会抛出一条说明明确的错误消息。在此 PR 之前，`detach table <dict>` 虽然可以执行，但会导致内存中的元数据格式异常。[#16885](https://github.com/ClickHouse/ClickHouse/pull/16885) ([Amos Bird](https://github.com/amosbird)).
* 新增 cutToFirstSignificantSubdomainWithWWW()。[#16845](https://github.com/ClickHouse/ClickHouse/pull/16845) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果配置有误 (缺少 `metric_log`.`collect_interval_milliseconds`) ，server 启动时会因抛出异常而拒绝启动。[#16815](https://github.com/ClickHouse/ClickHouse/pull/16815) ([Ivan](https://github.com/abyss7)) 。
* 在缺少 distributed DDL 配置时，异常消息会更明确。此修复解决了 [#5075](https://github.com/ClickHouse/ClickHouse/issues/5075)。[#16769](https://github.com/ClickHouse/ClickHouse/pull/16769) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 可用性改进：当 `CODEC` 表达式在 `CREATE TABLE` 查询中位置不正确时，语法错误消息会提供更好的提示。此修复对应 [#12493](https://github.com/ClickHouse/ClickHouse/issues/12493)。[#16768](https://github.com/ClickHouse/ClickHouse/pull/16768) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 Distributed engine 启动时，删除 async INSERT 的空目录。[#16729](https://github.com/ClickHouse/ClickHouse/pull/16729) ([Azat Khuzhin](https://github.com/azat)) 。
* 针对在使用 nginx server 作为 proxy 时配合 S3 的一种变通方案。Nginx 目前不接受路径为空的 URL，例如 `http://domain.com?delete`，但原生 aws-sdk-cpp 会生成这种 URL。此提交使用了打过补丁的 aws-sdk-cpp 版本，在这类情况下会生成以 "/" 作为路径的 URL，例如 `http://domain.com/?delete`。[#16709](https://github.com/ClickHouse/ClickHouse/pull/16709) ([ianton-ru](https://github.com/ianton-ru)).
* 允许 `reinterpretAs*` 函数适用于相同大小的整数和浮点数。实现了 [16640](https://github.com/ClickHouse/ClickHouse/issues/16640)。[#16657](https://github.com/ClickHouse/ClickHouse/pull/16657) ([flynn](https://github.com/ucasFL)).
* 现在，可以在 `config.xml` 中修改 `<auxiliary_zookeepers>` 配置，并且无需重启 server 即可重新加载。[#16627](https://github.com/ClickHouse/ClickHouse/pull/16627) ([Amos Bird](https://github.com/amosbird)) 。
* 支持在与远程资源建立的 https 连接中使用 SNI。这样即可连接到要求 SNI 的 Cloudflare 服务器。此修复解决了 [#10055](https://github.com/ClickHouse/ClickHouse/issues/10055)。[#16252](https://github.com/ClickHouse/ClickHouse/pull/16252) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持连接到需要 SNI 的 `clickhouse-server` 安全端点。这在 `clickhouse-server` 部署于 TLS 代理之后时可以实现。[#16938](https://github.com/ClickHouse/ClickHouse/pull/16938) ([filimonov](https://github.com/filimonov)).
* 修复了创建 materialized view 循环时可能出现的栈溢出问题。此修复关闭了 [#15732](https://github.com/ClickHouse/ClickHouse/issues/15732)。[#16048](https://github.com/ClickHouse/ClickHouse/pull/16048) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 简化 MergeTree 表引擎家族后台任务处理的实现。用户侧应该不会看到任何明显变化。[#15983](https://github.com/ClickHouse/ClickHouse/pull/15983) ([alesapin](https://github.com/alesapin)).
* 改进了 MaterializeMySQL (实验性功能) 。当 MySQL 同步用户的同步权限有误时，抛出异常。[#15977](https://github.com/ClickHouse/ClickHouse/pull/15977) ([TCeason](https://github.com/TCeason)) 。
* 让 `indexOf()` 使用 BloomFilter。[#14977](https://github.com/ClickHouse/ClickHouse/pull/14977) ([achimbab](https://github.com/achimbab)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 使用 Floyd-Rivest 算法，它最适合 ClickHouse 中部分排序这一使用场景。基准测试见 [https://github.com/danlark1/miniselect](https://github.com/danlark1/miniselect) 和 [这里](https://drive.google.com/drive/folders/1DHEaeXgZuX6AJ9eByeZ8iQVQv0ueP8XM)。[#16825](https://github.com/ClickHouse/ClickHouse/pull/16825) ([Danila Kutenin](https://github.com/danlark1)).
* 现在，`ReplicatedMergeTree` 引擎家族为复制拉取操作使用独立的线程池。该线程池的大小由设置 `background_fetches_pool_size` 限制，可通过重启服务器进行调整。该设置的默认值为 3，这意味着最大并行拉取数为 3 (并且可以充分利用 10G 网络) 。修复了 #520。[#16390](https://github.com/ClickHouse/ClickHouse/pull/16390) ([alesapin](https://github.com/alesapin)).
* 修复了 `quantileTDigest` 状态无控制增长的问题。[#16680](https://github.com/ClickHouse/ClickHouse/pull/16680) ([hrissan](https://github.com/hrissan)).
* 为 `EXPLAIN` 添加了 `VIEW` 子查询的说明。限制了针对 `VIEW` 的 push down 优化。将 `Distributed` 的本地副本加入查询计划。[#14936](https://github.com/ClickHouse/ClickHouse/pull/14936) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在 max\_threads > 0 且 ORDER BY 中包含 expression 时，optimize\_read\_in\_order/optimize\_aggregation\_in\_order 的性能问题。[#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在大量 `MergeTree` 表上读取 `Merge` 表时的性能问题。修复了 [#7748](https://github.com/ClickHouse/ClickHouse/issues/7748)。[#16988](https://github.com/ClickHouse/ClickHouse/pull/16988) ([Anton Popov](https://github.com/CurtizJ)).
* 现在，在精确匹配时，我们可以安全地裁剪分区。一个典型场景是：假设表按 `intHash64(x) % 100` 分区，而查询条件中原样使用的是 `intHash64(x) % 100`，而不是 x。[#16253](https://github.com/ClickHouse/ClickHouse/pull/16253) ([Amos Bird](https://github.com/amosbird)).

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增 `EmbeddedRocksDB` 表引擎 (可用于字典) 。[#15073](https://github.com/ClickHouse/ClickHouse/pull/15073) ([sundyli](https://github.com/sundy-li)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 改进用于构建测试覆盖率的镜像。[#17233](https://github.com/ClickHouse/ClickHouse/pull/17233) ([alesapin](https://github.com/alesapin)).
* 将内置时区数据更新到 2020d 版本 (同时将 cctz 更新到最新的 master) 。[#17204](https://github.com/ClickHouse/ClickHouse/pull/17204) ([filimonov](https://github.com/filimonov)).
* 修复 Poco 中的 UBSan 报告。此更改关闭了 [#12719](https://github.com/ClickHouse/ClickHouse/issues/12719)。[#16765](https://github.com/ClickHouse/ClickHouse/pull/16765) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 不要使用 UBSan 对第三方库进行插桩。[#16764](https://github.com/ClickHouse/ClickHouse/pull/16764) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复缓存字典中的 UBSan 报告。此更改关闭了 [#12641](https://github.com/ClickHouse/ClickHouse/issues/12641)。[#16763](https://github.com/ClickHouse/ClickHouse/pull/16763) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复尝试将无穷大的浮点数转换为整数时触发的 UBSan 报告。此更改关闭了 [#14190](https://github.com/ClickHouse/ClickHouse/issues/14190)。[#16677](https://github.com/ClickHouse/ClickHouse/pull/16677) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="clickhouse-release-2011">
  ## ClickHouse 20.11 版本发布
</div>

<div id="clickhouse-release-v2011716-stable-2021-03-02">
  ### ClickHouse 版本发布 v20.11.7.16-稳定版本，2021-03-02
</div>

<div id="improvement">
  #### 改进
</div>

* 在 `clickhouse-server` 镜像中，显式将 clickhouse 用户和用户组的 uid / gid 设为固定值 (101) 。[#19096](https://github.com/ClickHouse/ClickHouse/pull/19096) ([filimonov](https://github.com/filimonov)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复 BloomFilter 索引崩溃问题。修复了 [#19757](https://github.com/ClickHouse/ClickHouse/issues/19757)。[#19884](https://github.com/ClickHouse/ClickHouse/pull/19884) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 如果启用了 system.text\_log，则可能会发生死锁。此问题已在 [#19874](https://github.com/ClickHouse/ClickHouse/issues/19874) 中修复。[#19875](https://github.com/ClickHouse/ClickHouse/pull/19875) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在先前版本中，函数 arrayEnumerateUniq 的异常参数可能会导致崩溃或陷入无限循环。此修复解决了 [#19787](https://github.com/ClickHouse/ClickHouse/issues/19787)。[#19788](https://github.com/ClickHouse/ClickHouse/pull/19788) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在对算术类型与字符串类型进行精确比较时出现的栈溢出问题。[#19773](https://github.com/ClickHouse/ClickHouse/pull/19773) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `bitmapAndnot` 函数中的段错误。修复了 [#19668](https://github.com/ClickHouse/ClickHouse/issues/19668)。[#19713](https://github.com/ClickHouse/ClickHouse/pull/19713) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 某些涉及大整数的函数可能会导致段错误。大整数属于 Experimental 功能。此项修复关闭了 [#19667](https://github.com/ClickHouse/ClickHouse/issues/19667)。[#19672](https://github.com/ClickHouse/ClickHouse/pull/19672) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 修复函数 `neighbor` 在 `LowCardinality` 参数下返回结果错误的问题。修复 [#10333](https://github.com/ClickHouse/ClickHouse/issues/10333)。[#19617](https://github.com/ClickHouse/ClickHouse/pull/19617) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复断开连接后 Connection 中 CompressedWriteBuffer 的释放后使用 (use-after-free) 问题。[#19599](https://github.com/ClickHouse/ClickHouse/pull/19599) ([Azat Khuzhin](https://github.com/azat)) 。
* `DROP/DETACH TABLE table ON CLUSTER cluster SYNC` 查询可能会挂起，此问题已修复。修复了 [#19568](https://github.com/ClickHouse/ClickHouse/issues/19568)。[#19572](https://github.com/ClickHouse/ClickHouse/pull/19572) ([tavplubix](https://github.com/tavplubix)) 。
* 修复查询 `CREATE DICTIONARY` 中 `id` 表达式的问题。[#19571](https://github.com/ClickHouse/ClickHouse/pull/19571) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复将 `merge&#95;tree&#95;min&#95;rows&#95;for&#95;concurrent&#95;read/merge&#95;tree&#95;min&#95;bytes&#95;for&#95;concurrent&#95;read` 设为 `0/UINT64&#95;MAX` 时出现的 SIGSEGV。 [#19528](https://github.com/ClickHouse/ClickHouse/pull/19528) ([Azat Khuzhin](https://github.com/azat)).
* 如果使用精心构造的参数调用 `addMonth` 函数，则可能导致缓冲区溢出 (发生在内存读取时) 。此修复解决了 [#19441](https://github.com/ClickHouse/ClickHouse/issues/19441)。此修复解决了 [#19413](https://github.com/ClickHouse/ClickHouse/issues/19413)。[#19472](https://github.com/ClickHouse/ClickHouse/pull/19472) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果某个文件中出现空数据块，则将 Distributed 批次标记为损坏。[#19449](https://github.com/ClickHouse/ClickHouse/pull/19449) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 Uber H3 库中可能存在的缓冲区溢出问题。参见 [https://github.com/uber/h3/issues/392。此项修复关闭了](https://github.com/uber/h3/issues/392。此项修复关闭了) [#19219](https://github.com/ClickHouse/ClickHouse/issues/19219)。[#19383](https://github.com/ClickHouse/ClickHouse/pull/19383) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 system.parts \_state 列的问题 (由于顺序错误，查询该列时会出现 LOGICAL\_ERROR) 。[#19346](https://github.com/ClickHouse/ClickHouse/pull/19346) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复错误 `Cannot convert column now64() because it is constant but values of constants are different in source and result`。这是 [#7156](https://github.com/ClickHouse/ClickHouse/issues/7156) 的后续修复。[#19316](https://github.com/ClickHouse/ClickHouse/pull/19316) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复了一个问题：并发执行 `ALTER` 和 `DROP` 查询时，处理 ReplicatedMergeTree 表可能会卡住。[#19237](https://github.com/ClickHouse/ClickHouse/pull/19237) ([alesapin](https://github.com/alesapin)).
* 修复了读取 `ORC` 格式文件时无限读取的问题 (该问题是在 [#10580](https://github.com/ClickHouse/ClickHouse/issues/10580) 中引入的) 。修复 [#19095](https://github.com/ClickHouse/ClickHouse/issues/19095)。[#19134](https://github.com/ClickHouse/ClickHouse/pull/19134) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个启动时的 bug：当 ClickHouse 无法从 `LowCardinality(Nullable(...))` 中读取压缩编解码器时，会抛出 `Attempt to read after EOF` 异常。修复了 [#18340](https://github.com/ClickHouse/ClickHouse/issues/18340)。[#19101](https://github.com/ClickHouse/ClickHouse/pull/19101) ([alesapin](https://github.com/alesapin)) 。
* 修复了通过 HTTP 接口使用 `Template` 或 `CustomSeparated` 格式插入数据时出现的 `There is no checkpoint` 错误。修复 [#19021](https://github.com/ClickHouse/ClickHouse/issues/19021)。[#19072](https://github.com/ClickHouse/ClickHouse/pull/19072) ([tavplubix](https://github.com/tavplubix)).
* 限制对使用旧语法创建的 `MergeTree` 表执行 `MODIFY TTL` 查询。此前该查询虽然会执行成功，但实际上不会生效。[#19064](https://github.com/ClickHouse/ClickHouse/pull/19064) ([Anton Popov](https://github.com/CurtizJ)) 。
* 确保 `groupUniqArray` 对枚举类型参数返回正确的类型。此修复关闭了 [#17875](https://github.com/ClickHouse/ClickHouse/issues/17875)。[#19019](https://github.com/ClickHouse/ClickHouse/pull/19019) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了将函数 `ignore` 与 `LowCardinality` 参数一起使用时，可能出现的错误 `Expected single dictionary argument for function`。修复 [#14275](https://github.com/ClickHouse/ClickHouse/issues/14275)。[#19016](https://github.com/ClickHouse/ClickHouse/pull/19016) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了向使用 `TinyLog` 引擎的表中插入 `LowCardinality` 列时的问题。修复了 [#18629](https://github.com/ClickHouse/ClickHouse/issues/18629)。[#19010](https://github.com/ClickHouse/ClickHouse/pull/19010) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 禁用 `optimize_move_functions_out_of_any`，因为该优化并非总是正确。此修复关闭了 [#18051](https://github.com/ClickHouse/ClickHouse/issues/18051)。此修复关闭了 [#18973](https://github.com/ClickHouse/ClickHouse/issues/18973)。[#18981](https://github.com/ClickHouse/ClickHouse/pull/18981) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在关闭时极少出现的死锁。[#18977](https://github.com/ClickHouse/ClickHouse/pull/18977) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了变更包含某些转义文本时 (例如 `ALTER ... UPDATE e = CAST('foo', 'Enum8(\'foo\' = 1')`) 序列化错误的问题。修复 [#18878](https://github.com/ClickHouse/ClickHouse/issues/18878)。[#18944](https://github.com/ClickHouse/ClickHouse/pull/18944) ([alesapin](https://github.com/alesapin)) 。
* Attach 分区时应重置变更。[#18804](https://github.com/ClickHouse/ClickHouse/issues/18804)。[#18935](https://github.com/ClickHouse/ClickHouse/pull/18935) ([fastio](https://github.com/fastio)) 。
* 修复了 `clickhouse-local` 在关闭时可能卡住的问题。此修复解决了 [#18891](https://github.com/ClickHouse/ClickHouse/issues/18891)。[#18893](https://github.com/ClickHouse/ClickHouse/pull/18893) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 \*If 组合器与一元函数及 Nullable 类型一起使用时的问题。 [#18806](https://github.com/ClickHouse/ClickHouse/pull/18806) ([Azat Khuzhin](https://github.com/azat)).
* 如果全局设置 `network_compression_method` 被设为非默认值，服务器可能会拒绝异步分布式 INSERT。此修复解决了 [#18741](https://github.com/ClickHouse/ClickHouse/issues/18741)。[#18776](https://github.com/ClickHouse/ClickHouse/pull/18776) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在尝试将 `NULL` 从 `Nullable(String)` CAST 为 `Nullable(Decimal(P, S))` 时出现的 `Attempt to read after eof` 错误。现在，函数 `CAST` 在无法从可空字符串中解析出 decimal 时会返回 `NULL`。修复 [#7690](https://github.com/ClickHouse/ClickHouse/issues/7690)。[#18718](https://github.com/ClickHouse/ClickHouse/pull/18718) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复 Logger 参数数量不匹配的问题。[#18717](https://github.com/ClickHouse/ClickHouse/pull/18717) ([sundyli](https://github.com/sundy-li)).
* 新增对 FixedString 数据类型的支持。在将数据从 MySQL 复制到 ClickHouse 时，会出现此异常："Code: 50, e.displayText() = DB::Exception: Unsupported type FixedString(1)"。此补丁修复了 bug [#18450](https://github.com/ClickHouse/ClickHouse/issues/18450)，也修复了 [#6556](https://github.com/ClickHouse/ClickHouse/issues/6556)。[#18553](https://github.com/ClickHouse/ClickHouse/pull/18553) ([awesomeleo](https://github.com/awesomeleo)) 。
* 修复在包含 `RIGHT` 或 `FULL` JOIN 的子查询后使用 `ORDER BY` 时，可能出现的 `Pipeline stuck` 错误。[#18550](https://github.com/ClickHouse/ClickHouse/pull/18550) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了一个 bug：终止相应变更后，`ALTER` 查询可能会卡住。由 Thread Fuzzer 发现。[#18518](https://github.com/ClickHouse/ClickHouse/pull/18518) ([alesapin](https://github.com/alesapin)).
* 在合并期间禁用使用 AIO 的写入，因为这可能会在极少数情况下导致合并时主键列数据损坏。[#18481](https://github.com/ClickHouse/ClickHouse/pull/18481) ([alesapin](https://github.com/alesapin)).
* 当结果无法计算时，在分析阶段禁用子查询的常量折叠。[#18446](https://github.com/ClickHouse/ClickHouse/pull/18446) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了对 `Nullable(String)` 类型参数执行 `toType(...)` 函数 (`toDate`、`toUInt32` 等) 时出现的 `value is too short` 错误。现在，这类函数在解析出错时会返回 `NULL`，而不再抛出异常。修复 [#7673](https://github.com/ClickHouse/ClickHouse/issues/7673)。[#18445](https://github.com/ClickHouse/ClickHouse/pull/18445) ([tavplubix](https://github.com/tavplubix)) 。
* 限制从 wide parts 到 compact parts 的合并操作。在 vertical merge 的情况下，这会导致生成的结果 part 损坏。[#18381](https://github.com/ClickHouse/ClickHouse/pull/18381) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了表 `system.settings_profile_elements` 的填充问题。此 PR 修复了 [#18231](https://github.com/ClickHouse/ClickHouse/issues/18231)。[#18379](https://github.com/ClickHouse/ClickHouse/pull/18379) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了带常量参数的二元函数在索引分析中的问题，该问题会导致查询结果错误。此修复对应 [#18364](https://github.com/ClickHouse/ClickHouse/issues/18364)。[#18373](https://github.com/ClickHouse/ClickHouse/pull/18373) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在使用两级聚合时，带有 `Distinct` 组合器的聚合函数可能崩溃的问题。修复 [#17682](https://github.com/ClickHouse/ClickHouse/issues/17682)。[#18365](https://github.com/ClickHouse/ClickHouse/pull/18365) ([Anton Popov](https://github.com/CurtizJ)) 。
* 现在，即使只能从 `table` 中选择任意一列，也可以执行 `SELECT count() FROM table`。此 PR 修复了 [#10639](https://github.com/ClickHouse/ClickHouse/issues/10639)。[#18233](https://github.com/ClickHouse/ClickHouse/pull/18233) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* `SELECT JOIN` 现在要求对每个参与 join 的表都具有 `SELECT` 权限。此 PR 修复了 [#17654](https://github.com/ClickHouse/ClickHouse/issues/17654)。[#18232](https://github.com/ClickHouse/ClickHouse/pull/18232) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在发生读取 backoff 时，从 `MergeTree*` 读取可能导致查询结果不完整的问题 (日志中会出现消息 `<Debug> MergeTreeReadPool: Will lower number of threads`) 。该问题是在 [#16423](https://github.com/ClickHouse/ClickHouse/issues/16423) 中引入的。修复了 [#18137](https://github.com/ClickHouse/ClickHouse/issues/18137)。[#18216](https://github.com/ClickHouse/ClickHouse/pull/18216) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复查询 `MODIFY COLUMN ... REMOVE TTL` 未实际移除列的生存时间 (TTL) 时的错误。[#18130](https://github.com/ClickHouse/ClickHouse/pull/18130) ([alesapin](https://github.com/alesapin)).
* 修复了谓词优化器中非确定性函数的问题。此修复解决了 [#17244](https://github.com/ClickHouse/ClickHouse/issues/17244)。[#17273](https://github.com/ClickHouse/ClickHouse/pull/17273) ([Winter Zhang](https://github.com/zhang2014)) 。
* 变更在 `MOVE` 或 `REPLACE PARTITION` 之后，或在极少数情况下于 `DETACH` 或 `DROP PARTITION` 之后，可能会因等待某个不存在的分片而卡住。此问题已修复。[#15537](https://github.com/ClickHouse/ClickHouse/pull/15537) ([tavplubix](https://github.com/tavplubix)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 将时区信息更新为 2020e。[#18531](https://github.com/ClickHouse/ClickHouse/pull/18531) ([alesapin](https://github.com/alesapin)).

<div id="clickhouse-release-v201166-stable-2020-12-24">
  ### ClickHouse 版本发布 v20.11.6.6-稳定版本，2020-12-24
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在采用双 `IPv4/IPv6 stack` 的机器上，server 无法访问 `clickhouse-odbc-bridge` 进程的问题；同时修复了在使用格式错误的查询更新 ODBC 字典时出现的问题和/或引发崩溃的情况。这可能解决了 [#14489](https://github.com/ClickHouse/ClickHouse/issues/14489)。[#18278](https://github.com/ClickHouse/ClickHouse/pull/18278) ([Denis Glazachev](https://github.com/traceon)) 。
* 已修复枚举与 Int 类型之间的键比较问题。此修复解决了 [#17989](https://github.com/ClickHouse/ClickHouse/issues/17989)。[#18214](https://github.com/ClickHouse/ClickHouse/pull/18214) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `MaterializeMySQL` 数据库引擎中唯一键转换时发生崩溃的问题。此修复解决了 [#18186](https://github.com/ClickHouse/ClickHouse/issues/18186) 和 [#16372](https://github.com/ClickHouse/ClickHouse/issues/16372)  [#18211](https://github.com/ClickHouse/ClickHouse/pull/18211) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了 S3 URL 解析时出现的 `std::out_of_range: basic_string` 问题。[#18059](https://github.com/ClickHouse/ClickHouse/pull/18059) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了以下问题：由于 MaterializeMySQL 不支持转换 MySQL 前缀索引，导致某些表无法从 MySQL 同步到 ClickHouse。此修复解决了 [#15187](https://github.com/ClickHouse/ClickHouse/issues/15187) 和 [#17912](https://github.com/ClickHouse/ClickHouse/issues/17912)  [#17944](https://github.com/ClickHouse/ClickHouse/pull/17944) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了一个问题：当查询包含 `ARRAY JOIN` 时，查询优化会产生错误结果。[#17887](https://github.com/ClickHouse/ClickHouse/pull/17887) ([sundyli](https://github.com/sundy-li)).
* 修复了 `topK` 聚合函数中可能出现的段错误。关闭了 [#17404](https://github.com/ClickHouse/ClickHouse/issues/17404)。[#17845](https://github.com/ClickHouse/ClickHouse/pull/17845) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 如果禁用了 `in_memory_parts_enable_wal`，则不要从 WAL 中恢复 parts。[#17802](https://github.com/ClickHouse/ClickHouse/pull/17802) ([detailyang](https://github.com/detailyang)) 。
* 修复了 ClickHouse 无法恢复与 MySQL 服务器连接的问题。[#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了 `optimize_trivial_count_query` 在使用分区条件时行为不一致的问题。[#17644](https://github.com/ClickHouse/ClickHouse/pull/17644) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 server 以守护进程模式运行时，`system.stack_trace` 表为空的问题。[#17630](https://github.com/ClickHouse/ClickHouse/pull/17630) ([Amos Bird](https://github.com/amosbird)).
* 修复了 MergeTree 表在后台可能记录 xxception `fmt::v7::format_error` 的问题。此修复解决了 [#17613](https://github.com/ClickHouse/ClickHouse/issues/17613)。[#17615](https://github.com/ClickHouse/ClickHouse/pull/17615) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `clickhouse-client` 在交互模式下处理多行查询时，单行注释被错误地延续到查询末尾的问题。此修复对应 [#13654](https://github.com/ClickHouse/ClickHouse/issues/13654)。[#17565](https://github.com/ClickHouse/ClickHouse/pull/17565) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个问题：在极少数情况下，服务器可能会停止接受连接。[#17542](https://github.com/ClickHouse/ClickHouse/pull/17542) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了这样一个问题：当对应的变更在其他副本上被终止时，alter 查询会卡住。此修复对应于 [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953)。[#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)).
* 修复了 ClickHouse 低估标记缓存大小时的 bug。这种情况可能发生在存在大量带有标记的微小文件时。[#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)).
* 修复了启用设置 `optimize_redundant_functions_in_order_by` 时 `ORDER BY` 存在的问题。[#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了由于错误优化导致 `DISTINCT` 后仍可能出现重复项的问题。此修复解决了 [#17294](https://github.com/ClickHouse/ClickHouse/issues/17294)。[#17296](https://github.com/ClickHouse/ClickHouse/pull/17296) ([li chengxiang](https://github.com/chengxianglibra))。[#17439](https://github.com/ClickHouse/ClickHouse/pull/17439) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复了从包含 `LowCardinality` 类型的 `JOIN` 表读取数据时发生崩溃的问题。此修复解决了 [#17228](https://github.com/ClickHouse/ClickHouse/issues/17228)。[#17397](https://github.com/ClickHouse/ClickHouse/pull/17397) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了子查询中存在 const 列时 set 索引失效的问题。此修复解决了 [#17246](https://github.com/ClickHouse/ClickHouse/issues/17246)。[#17249](https://github.com/ClickHouse/ClickHouse/pull/17249) ([Amos Bird](https://github.com/amosbird)).
* 修复了在索引比较的类型不同时，可能导致索引分析错误的问题。此修复解决了 [#17122](https://github.com/ClickHouse/ClickHouse/issues/17122)。[#17145](https://github.com/ClickHouse/ClickHouse/pull/17145) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了导致崩溃的 `ColumnConst` 比较问题。此修复对应 [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088)。[#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)).
* 修复了一个 bug：在非 leader 的 `ReplicatedMergeTreeTables` 上，`ON CLUSTER` 查询可能会永久卡住。 [#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
* 修复了 fuzzer 发现的 `fuzzBits` 函数中的问题。此修复解决了 [#16980](https://github.com/ClickHouse/ClickHouse/issues/16980)。[#17051](https://github.com/ClickHouse/ClickHouse/pull/17051) ([hexiaoting](https://github.com/hexiaoting)) 。
* 避免对那些可能在执行过程中被取消的远程查询 (例如带有 `LIMIT` 的查询) 报出不必要的网络错误。[#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了从 double 转换时，大整数 (128 位、256 位) 结果错误的问题。[#16986](https://github.com/ClickHouse/ClickHouse/pull/16986) ([Mike](https://github.com/myrrc)).
* 发生错误时，重新解析 `format_avro_schema_registry_url` 的 IP。[#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)).
* 修复了一个可能导致服务器崩溃的问题：在 `ALTER TABLE ... MODIFY COLUMN ... NewType` 之后，如果 `SELECT` 的 `WHERE` 表达式引用了正在修改的列，且该 alter 尚未完成，就可能发生崩溃。[#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)) 。
* 在 `clickhouse-git-import` 中，Blame 信息未被正确计算。[#16959](https://github.com/ClickHouse/ClickHouse/pull/16959) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用单调函数时的 ORDER BY 优化问题。修复了 [#16107](https://github.com/ClickHouse/ClickHouse/issues/16107)。[#16956](https://github.com/ClickHouse/ClickHouse/pull/16956) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在启用设置 `optimize_aggregators_of_group_by_keys` 且使用 joins 时，group by 优化中的问题。此修复解决了 [#12604](https://github.com/ClickHouse/ClickHouse/issues/12604)。[#16951](https://github.com/ClickHouse/ClickHouse/pull/16951) ([Anton Popov](https://github.com/CurtizJ)) 。
* 安装脚本应始终在配置目录中创建子目录。这仅适用于使用自定义配置的 Docker 构建。[#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
* 修复了带有 `ORDER BY` 的查询中可能出现的 `Illegal type of argument` 错误。此修复解决了 [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580)。[#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果没有数据写入 WriteBufferFromS3，则会中止分段上传。[#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了在不传任何参数时使用 `any` 导致崩溃的问题。此修复对应 [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803)。[#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了这样一个问题：通过 MySQL 协议执行 `INSERT` 查询时，ClickHouse 之前总是返回 0，而不是受影响的行数。此修复解决了 [#16605](https://github.com/ClickHouse/ClickHouse/issues/16605)。[#16715](https://github.com/ClickHouse/ClickHouse/pull/16715) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 TDigest 无限制增长的问题。[#16680](https://github.com/ClickHouse/ClickHouse/pull/16680) ([hrissan](https://github.com/hrissan)) 。
* 修复了在聚合函数中使用后缀 `if` 时远程查询失败的问题。此项修复解决了 [#16574](https://github.com/ClickHouse/ClickHouse/issues/16574)、[#16231](https://github.com/ClickHouse/ClickHouse/issues/16231) 和 [#16610](https://github.com/ClickHouse/ClickHouse/pull/16610) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `select_sequential_consistency` 在优化后的简单计数查询和 system.tables 上导致行为不一致的问题。[#16309](https://github.com/ClickHouse/ClickHouse/pull/16309) ([Hao Chen](https://github.com/haoch)) 。
* 使用 ColumnTransformer 替换不存在的列时会抛出错误。[#16183](https://github.com/ClickHouse/ClickHouse/pull/16183) ([hexiaoting](https://github.com/hexiaoting)).

<div id="clickhouse-release-v201133-stable-2020-11-13">
  ### ClickHouse 版本发布 v20.11.3.3-稳定版本，2020-11-13
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了一个罕见的静默崩溃问题：在启用查询分析器且 ClickHouse 安装在使用某个 glibc 版本的操作系统上时，该 glibc 版本据称对某些函数的异步展开表存在缺陷。此修复解决了 [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301)。此修复解决了 [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098)。[#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。

<div id="clickhouse-release-v201121-2020-11-11">
  ### ClickHouse 版本发布 v20.11.2.1，2020-11-11
</div>

<div id="backward-incompatible-change">
  #### 向后不兼容变更
</div>

* 如果在 `distributed_ddl` 配置段中指定了某个 `profile`，那么该 profile 可能会在服务器启动时覆盖 `default` profile 的设置。此问题已修复；现在，分布式 DDL 查询的设置不应再影响全局服务器设置。[#16635](https://github.com/ClickHouse/ClickHouse/pull/16635) ([tavplubix](https://github.com/tavplubix)) 。
* 限制在键中使用不可比较的数据类型 (如 `AggregateFunction`)  (例如排序键、主键、分区键等) 。[#16601](https://github.com/ClickHouse/ClickHouse/pull/16601) ([alesapin](https://github.com/alesapin)) 。
* 移除 `ANALYZE` 和 `AST` 查询，并将设置 `enable_debug_queries` 标记为已废弃，因为它现在已成为功能完整的 `EXPLAIN` 查询的一部分。[#16536](https://github.com/ClickHouse/ClickHouse/pull/16536) ([Ivan](https://github.com/abyss7)) 。
* 聚合函数 `boundingRatio`、`rankCorr`、`retention`、`timeSeriesGroupSum`、`timeSeriesGroupRateSum`、`windowFunnel` 之前被错误地设置为不区分大小写。现在其名称已按设计改为区分大小写。只有 SQL 标准中规定的函数、为兼容其他 DBMS 而提供的函数，或与这类函数类似的函数，才应当不区分大小写。[#16407](https://github.com/ClickHouse/ClickHouse/pull/16407) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在数据不足时，`rankCorr` 函数将返回 nan。[#16124](https://github.com/ClickHouse/ClickHouse/issues/16124)。[#16135](https://github.com/ClickHouse/ClickHouse/pull/16135) ([hexiaoting](https://github.com/hexiaoting)) 。
* 从早于 20.5 的版本升级时，如果执行滚动更新，且集群中同时包含 20.5 及以上版本和低于 20.5 的版本，那么当旧版本的 ClickHouse 节点重启，并且在存在较新版本节点的情况下启动旧版本时，可能会导致 `Part ... intersects previous part` 错误。为避免此错误，请先在集群所有节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* 新增支持将 LDAP 作为本地不存在用户的用户目录。[#12736](https://github.com/ClickHouse/ClickHouse/pull/12736) ([Denis Glazachev](https://github.com/traceon)).
* 新增 `system.replicated_fetches` 表，用于显示当前正在进行的后台拉取操作。[#16428](https://github.com/ClickHouse/ClickHouse/pull/16428) ([alesapin](https://github.com/alesapin)) 。
* 新增设置 `date_time_output_format`。[#15845](https://github.com/ClickHouse/ClickHouse/pull/15845) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 为 ClickHouse 添加了一个简易的 Web UI。[#16158](https://github.com/ClickHouse/ClickHouse/pull/16158) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持一次读写单个 protobuf 消息 (无长度分隔符) 。[#15199](https://github.com/ClickHouse/ClickHouse/pull/15199) ([filimonov](https://github.com/filimonov)) 。
* 新增了对 OpenTelemetry 的初步支持。ClickHouse 现在可通过 Native 和 HTTP 协议接收 OpenTelemetry 的 traceparent 请求头，并在某些情况下将其继续向下游传递。已执行查询的 trace spans 会保存到 `system.opentelemetry_span_log` 表中。[#14195](https://github.com/ClickHouse/ClickHouse/pull/14195) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 允许在 `CREATE TABLE` 查询的列定义列表中指定主键。这是为了兼容其他 SQL 方言。[#15823](https://github.com/ClickHouse/ClickHouse/pull/15823) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 在带有 ORDER BY 的 SELECT 查询中实现了 `OFFSET offset_row_count {ROW | ROWS} FETCH {FIRST | NEXT} fetch_row_count {ROW | ROWS} {ONLY | WITH TIES}`。这是指定 `LIMIT` 的 SQL 标准方式。[#15855](https://github.com/ClickHouse/ClickHouse/pull/15855) ([hexiaoting](https://github.com/hexiaoting)).
* `errorCodeToName` 函数 - 返回 error 的变量名 (对分析 `query&#95;log` 及类似日志很有用) 。`system.errors` 表 - 显示 error 发生的次数 (遵循 `system_events_show_zero_values`) 。[#16438](https://github.com/ClickHouse/ClickHouse/pull/16438) ([Azat Khuzhin](https://github.com/azat)).
* 新增函数 `untuple`。这是一种特殊函数，可通过展开命名元组，在 SELECT 列表中引入新列。[#16242](https://github.com/ClickHouse/ClickHouse/pull/16242) ([Nikolai Kochetov](https://github.com/KochetovNicolai), [Amos Bird](https://github.com/amosbird)).
* 现在我们可以通过查询参数传入标识符。这些参数还可以用于表对象或列。[#16594](https://github.com/ClickHouse/ClickHouse/pull/16594) ([Amos Bird](https://github.com/amosbird)) 。
* 为 MergeTree BloomFilter 索引增加了对大整数 (UInt256、Int128、Int256) 和 UUID 数据类型的支持。大整数是一项实验性功能。[#16642](https://github.com/ClickHouse/ClickHouse/pull/16642) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 添加 `farmFingerprint64` 函数 (非加密的字符串哈希) 。 [#16570](https://github.com/ClickHouse/ClickHouse/pull/16570) ([Jacob Hayes](https://github.com/JacobHayes)).
* 新增 `log_queries_min_query_duration_ms`：只有耗时超过该设置值的查询才会写入 `query_log`/`query_thread_log` (即类似于 mysql 中的 `slow_query_log`) 。[#16529](https://github.com/ClickHouse/ClickHouse/pull/16529) ([Azat Khuzhin](https://github.com/azat)) 。
* 可基于 `Alpine` 创建 Docker 镜像。使用预编译的二进制文件以及来自 Ubuntu 20.04 的 glibc 组件。[#16479](https://github.com/ClickHouse/ClickHouse/pull/16479) ([filimonov](https://github.com/filimonov)).
* 新增了 `toUUIDOrNull` 和 `toUUIDOrZero` 转换函数。[#16337](https://github.com/ClickHouse/ClickHouse/pull/16337) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增 `max_concurrent_queries_for_all_users` 设置，具体使用场景请参见 [#6636](https://github.com/ClickHouse/ClickHouse/issues/6636)。[#16154](https://github.com/ClickHouse/ClickHouse/pull/16154) ([nvartolomei](https://github.com/nvartolomei)) 。
* 为 clickhouse-client 新增了一个 `print_query_id` 选项，可用于生成包含客户端生成的当前查询 id 的任意字符串。此外，clickhouse-client 现在默认会打印查询 id。[#15809](https://github.com/ClickHouse/ClickHouse/pull/15809) ([Amos Bird](https://github.com/amosbird)) 。
* 新增 `tid` 和 `logTrace` 函数。此更改修复了 [#9434](https://github.com/ClickHouse/ClickHouse/issues/9434)。[#15803](https://github.com/ClickHouse/ClickHouse/pull/15803) ([flynn](https://github.com/ucasFL)).
* 新增函数 `formatReadableTimeDelta`，可将时间差格式化为易于理解的字符串…… [#15497](https://github.com/ClickHouse/ClickHouse/pull/15497) ([Filipe Caixeta](https://github.com/filipecaixeta)) 。
* 为多磁盘配置中的卷添加了 `disable_merges` 选项。[#13956](https://github.com/ClickHouse/ClickHouse/pull/13956) ([Vladimir Chebotarev](https://github.com/excitoon)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增函数 `encrypt`、`aes_encrypt_mysql`、`decrypt`、`aes_decrypt_mysql`。由于这些函数执行速度较慢，因此我们将其归类为 Experimental 功能。[#11844](https://github.com/ClickHouse/ClickHouse/pull/11844) ([Vasily Nemkov](https://github.com/Enmk)) 。

<div id="bug-fix">
  #### 缺陷修复
</div>

* 对 `system.distribution_queue` 中 data\_path 里的密码进行了掩码处理。[#16727](https://github.com/ClickHouse/ClickHouse/pull/16727) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在启用 `transform_null_in` 设置时，`IN` 运算符作用于多个列和元组的问题。修复 [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310)。[#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)) 。
* 如果被查询的表未启用采样，设置 `max_parallel_replicas` 将无法正常工作。此项修复解决了 [#5733](https://github.com/ClickHouse/ClickHouse/issues/5733)。[#16675](https://github.com/ClickHouse/ClickHouse/pull/16675) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在 `max_threads` > 0 且 `ORDER BY` 中包含表达式时，`optimize&#95;read&#95;in&#95;order`/`optimize&#95;aggregation&#95;in&#95;order` 出现的问题。[#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)) 。
* `DEFAULT` 表达式的计算可能会引发名称冲突 (不过这种情况极少发生) 。此问题已在 [#9359](https://github.com/ClickHouse/ClickHouse/issues/9359) 中修复。[#16612](https://github.com/ClickHouse/ClickHouse/pull/16612) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修正 `query_thread_log.query_duration_ms` 的单位。[#16563](https://github.com/ClickHouse/ClickHouse/pull/16563) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在使用 MySQL Master -> MySQL Slave -> ClickHouse MaterializeMySQL 引擎时的一个缺陷。`MaterializeMySQL` 是一项 Experimental 功能。[#16504](https://github.com/ClickHouse/ClickHouse/pull/16504) ([TCeason](https://github.com/TCeason)).
* 特意构造的 `round` 函数参数在与 `Decimal` 一起使用时，会导致整数除零。此修复解决了 [#13338](https://github.com/ClickHouse/ClickHouse/issues/13338)。[#16451](https://github.com/ClickHouse/ClickHouse/pull/16451) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 Distributed 表的 DROP TABLE 问题 (与 INSERT 存在竞态条件) 。[#16409](https://github.com/ClickHouse/ClickHouse/pull/16409) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了复制队列中超大条目的处理问题。当表结构极其庞大 (接近 1 MB) 时，这类超大条目可能会出现在 ALTER 查询中。此修复对应 [#16307](https://github.com/ClickHouse/ClickHouse/issues/16307)。[#16332](https://github.com/ClickHouse/ClickHouse/pull/16332) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了行为不一致的问题：由于用于过滤的集合尚未创建，返回数据的一部分可能会被丢弃。 [#16308](https://github.com/ClickHouse/ClickHouse/pull/16308) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复 `sharding&#95;key` 中的 `dictGet` 问题 (以及类似场景，即函数上下文会被永久存储时) 。[#16205](https://github.com/ClickHouse/ClickHouse/pull/16205) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在尝试执行 `OPTIMIZE` 命令时 `clickhouse-local` 中抛出的异常。修复了 [#16076](https://github.com/ClickHouse/ClickHouse/issues/16076)。[#16192](https://github.com/ClickHouse/ClickHouse/pull/16192) ([filimonov](https://github.com/filimonov)).
* 修复了 [#15780](https://github.com/ClickHouse/ClickHouse/issues/15780) 中的回归问题。例如，`indexOf([1, 2, 3], toLowCardinality(1))` 现在会被禁止，但其实不应该这样。[#16038](https://github.com/ClickHouse/ClickHouse/pull/16038) ([Mike](https://github.com/myrrc)).
* 修复了 MySQL database 相关的问题。当作为 database engine 使用的 MySQL 服务器不可用时，某些查询会抛出异常，因为它们会尝试从已禁用的服务器获取表，但这其实并不必要。例如，查询 `SELECT ... FROM system.parts` 应当只作用于 MergeTree 表，完全不应访问 MySQL database。[#16032](https://github.com/ClickHouse/ClickHouse/pull/16032) ([Kruglov Pavel](https://github.com/Avogar)).
* 现在，当 `ALTER MODIFY COLUMN ... DEFAULT ...` 的默认值与列类型不兼容时，会抛出异常。修复了 [#15854](https://github.com/ClickHouse/ClickHouse/issues/15854)。[#15858](https://github.com/ClickHouse/ClickHouse/pull/15858) ([alesapin](https://github.com/alesapin)) 。
* 已修复 IPv4CIDRToRange/IPv6CIDRToRange 函数，使其可接受 const IP 列的值。[#15856](https://github.com/ClickHouse/ClickHouse/pull/15856) ([vladimir-golovchenko](https://github.com/vladimir-golovchenko)) 。

<div id="improvement">
  #### 改进
</div>

* 将 `INTERVAL '1 hour'` 视作与 `INTERVAL 1 HOUR` 等价，以兼容 Postgres 及类似系统。修复了 [#15637](https://github.com/ClickHouse/ClickHouse/issues/15637)。[#15978](https://github.com/ClickHouse/ClickHouse/pull/15978) ([flynn](https://github.com/ucasFL)) 。
* 支持在 CSV、TSV 和 JSON 输入格式中按数值 ID 解析枚举值。[#15685](https://github.com/ClickHouse/ClickHouse/pull/15685) ([vivarum](https://github.com/vivarum)).
* 改进了 JBOD 架构和 `MergeTree` 存储的读取任务调度。新增设置 `read_backoff_min_concurrency`，作为读取线程数的下限。[#16423](https://github.com/ClickHouse/ClickHouse/pull/16423) ([Amos Bird](https://github.com/amosbird)) 。
* 为 `Avro` 格式补充对 `LowCardinality` 的缺失支持。[#16521](https://github.com/ClickHouse/ClickHouse/pull/16521) ([Mike](https://github.com/myrrc)) 。
* 针对将 nginx 服务器用作 proxy 来使用 `S3` 的情况，提供了一种变通方案。Nginx 目前不接受 path 为空的 URL，例如 `http://domain.com?delete`，但原生 aws-sdk-cpp 会生成这种 URL。此提交使用了打补丁的 aws-sdk-cpp 版本，在这些情况下会生成以 "/" 作为 path 的 URL，例如 `http://domain.com/?delete`。[#16814](https://github.com/ClickHouse/ClickHouse/pull/16814) ([ianton-ru](https://github.com/ianton-ru)).
* 改进了对输入数据解析错误的诊断。在出现 `Cannot read all data` 错误时，会提供行号。[#16644](https://github.com/ClickHouse/ClickHouse/pull/16644) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 优化 `minMap` 和 `maxMap` 的行为，使其更符合预期。结果中将不再跳过零值。修复了 [#16087](https://github.com/ClickHouse/ClickHouse/issues/16087)。[#16631](https://github.com/ClickHouse/ClickHouse/pull/16631) ([Ildus Kurbangaliev](https://github.com/ildus)) 。
* 改进了在运行时更新 ZooKeeper 配置的方式。[#16630](https://github.com/ClickHouse/ClickHouse/pull/16630) ([sundyli](https://github.com/sundy-li)) 。
* 尽早应用 SETTINGS 子句。这样可以在查询中修改更多设置。此项改动解决了 [#3178](https://github.com/ClickHouse/ClickHouse/issues/3178)。[#16619](https://github.com/ClickHouse/ClickHouse/pull/16619) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 现在 `event_time_microseconds` 字段存储为 Decimal64，而非 UInt64。[#16617](https://github.com/ClickHouse/ClickHouse/pull/16617) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 现在，`APPLY` 列转换器中已可使用参数化函数。[#16589](https://github.com/ClickHouse/ClickHouse/pull/16589) ([Amos Bird](https://github.com/amosbird)) 。
* 改进了用于删除 `Atomic` 数据库中已删除表数据的后台任务调度。`Atomic` 数据库在表实际上没有数据目录时，不会创建指向表数据目录的损坏符号链接。[#16584](https://github.com/ClickHouse/ClickHouse/pull/16584) ([tavplubix](https://github.com/tavplubix)).
* `WITH` 部分中的子查询 (CTE) 现在可以按名称引用 `WITH` 部分中之前的子查询。[#16575](https://github.com/ClickHouse/ClickHouse/pull/16575) ([Amos Bird](https://github.com/amosbird)).
* 在 `system.query_thread_log` 中添加 current\_database。[#16558](https://github.com/ClickHouse/ClickHouse/pull/16558) ([Azat Khuzhin](https://github.com/azat)) 。
* 允许将当前实例中已提交或已过期的 parts 拉取到 detached 目录。这在从另一个集群迁移表，且采用 N 对 1 分片映射时非常有用。这也与当前的 fetchPartition 实现一致。[#16538](https://github.com/ClickHouse/ClickHouse/pull/16538) ([Amos Bird](https://github.com/amosbird)).
* 对 `RabbitMQ` 进行了多项改进：修复了 [#16263](https://github.com/ClickHouse/ClickHouse/issues/16263) 中的问题；还缩短了事件循环的生命周期，并增加了更高效的队列配置。[#16426](https://github.com/ClickHouse/ClickHouse/pull/16426) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 `quantileDeterministic` 函数中的调试断言。在之前的版本中，尽管并不存在实际的 bug，它仍可能通过网络多传输最多两倍的数据。此项修复解决了 [#15683](https://github.com/ClickHouse/ClickHouse/issues/15683)。[#16410](https://github.com/ClickHouse/ClickHouse/pull/16410) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 添加 `TablesToDropQueueSize` 指标。它等于已删除但仍在等待后台数据清理的表数量。[#16364](https://github.com/ClickHouse/ClickHouse/pull/16364) ([tavplubix](https://github.com/tavplubix)).
* 当客户端连接断开时，诊断信息会更明确。在之前的版本中，服务器日志中会记录 `Attempt to read after EOF` 和 `Broken pipe` 异常。在新版本中，则会记录一条信息消息：`Client has dropped the connection, cancel the query.`。 [#16329](https://github.com/ClickHouse/ClickHouse/pull/16329) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 增加了 Set/Join 表引擎对 total\_rows/total\_bytes (来自 system.tables) 的支持。[#16306](https://github.com/ClickHouse/ClickHouse/pull/16306) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，在 MergeTree 表引擎家族中，可以不使用 `ORDER BY` 而直接指定 `PRIMARY KEY`。已关闭 [#15591](https://github.com/ClickHouse/ClickHouse/issues/15591)。[#16284](https://github.com/ClickHouse/ClickHouse/pull/16284) ([alesapin](https://github.com/alesapin)).
* 如果系统中没有 tmp 文件夹 (例如 chroot、配置错误等) ，`clickhouse-local` 会在当前目录下创建一个临时子文件夹。[#16280](https://github.com/ClickHouse/ClickHouse/pull/16280) ([filimonov](https://github.com/filimonov)) 。
* 新增了对嵌套数据类型 (如命名元组) 作为子类型的支持。修复了 [#15587](https://github.com/ClickHouse/ClickHouse/issues/15587)。[#16262](https://github.com/ClickHouse/ClickHouse/pull/16262) ([Ivan](https://github.com/abyss7)).
* 支持在 `DROP DATABASE` 中使用 `database_atomic_wait_for_drop_and_detach_synchronously`/`NO DELAY`/`SYNC`。[#16127](https://github.com/ClickHouse/ClickHouse/pull/16127) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增 `allow_nondeterministic_optimize_skip_unused_shards` (允许在分片键中使用 `rand()` 或 `dictGet()` 等非确定性函数) 。[#16105](https://github.com/ClickHouse/ClickHouse/pull/16105) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了通过 HTTP 发起查询时的 `memory_profiler_step`/`max_untracked_memory` 问题 (包含测试) 。还修复了这样一个问题：即使在 xml 配置中全局调整该值也无效，因为这些设置实际上根本不会生效，只有默认值 (4MB) 会被[使用](https://github.com/ClickHouse/ClickHouse/blob/17731245336d8c84f75e4c0894c5797ed7732190/src/Common/ThreadStatus.h#L104)。修复了 HTTP 查询中最顶层 ThreadStatus 的 `query_id` 问题 (通过在读取 query\_id 后初始化 QueryScope) 。[#16101](https://github.com/ClickHouse/ClickHouse/pull/16101) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，无论集群配置中的 `<internal_replication>` 设置为何，都可以执行 `ALTER ... ON CLUSTER` 查询。[#16075](https://github.com/ClickHouse/ClickHouse/pull/16075) ([alesapin](https://github.com/alesapin)).
* 修复了一个罕见问题：`clickhouse-client` 在退出时可能会因加载建议功能而中止。此修复对应于 [#16035](https://github.com/ClickHouse/ClickHouse/issues/16035)。[#16047](https://github.com/ClickHouse/ClickHouse/pull/16047) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为具有复合键的 `Redis` 字典新增了对 `cache` 布局的支持。[#15985](https://github.com/ClickHouse/ClickHouse/pull/15985) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了配置错误 (`connections_with_failover_max_tries` 设为 0) 时查询卡死 (陷入无限循环) 的问题。[#15876](https://github.com/ClickHouse/ClickHouse/pull/15876) ([Azat Khuzhin](https://github.com/azat)).
* 将部分日志消息的级别从 information 调整为 debug，这样就不会在每次查询时都显示 information 消息。此更改关闭了 [#5293](https://github.com/ClickHouse/ClickHouse/issues/5293)。[#15816](https://github.com/ClickHouse/ClickHouse/pull/15816) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 移除 `MemoryTrackingInBackground*` 指标，以避免产生可能具有误导性的结果。此项修复解决了 [#15684](https://github.com/ClickHouse/ClickHouse/issues/15684)。[#15813](https://github.com/ClickHouse/ClickHouse/pull/15813) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `zookeeper-dump-tree` 工具增加重连机制。[#15711](https://github.com/ClickHouse/ClickHouse/pull/15711) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 允许在 `CREATE TABLE table AS table_function(...)` 查询中明确指定列列表。修复了 [#9249](https://github.com/ClickHouse/ClickHouse/issues/9249) 和 [#14214](https://github.com/ClickHouse/ClickHouse/issues/14214)。[#14295](https://github.com/ClickHouse/ClickHouse/pull/14295) ([tavplubix](https://github.com/tavplubix)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 在 `SELECT FINAL` 中，不再跨分区合并 parts。[#15938](https://github.com/ClickHouse/ClickHouse/pull/15938) ([Kruglov Pavel](https://github.com/Avogar)).
* 提升了 `-OrNull` 和 `-OrDefault` 聚合函数的性能。[#16661](https://github.com/ClickHouse/ClickHouse/pull/16661) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 提升了 `quantileMerge` 的性能。在之前的版本中，它的速度慢得令人难以忍受。此项改进还关闭了 [#1463](https://github.com/ClickHouse/ClickHouse/issues/1463)。[#16643](https://github.com/ClickHouse/ClickHouse/pull/16643) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 略微提升了逻辑函数的性能。[#16347](https://github.com/ClickHouse/ClickHouse/pull/16347) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 提升了 MergeTree 表引擎中 merges 分配的性能。用户应该感知不到这一变化。[#16191](https://github.com/ClickHouse/ClickHouse/pull/16191) ([alesapin](https://github.com/alesapin)).
* 通过预分配哈希表，加快了 hashed/sparse\_hashed 字典的加载速度。[#15454](https://github.com/ClickHouse/ClickHouse/pull/15454) ([Azat Khuzhin](https://github.com/azat)).
* 现在，原本简单的 count 优化变得稍微复杂了一些。包含精确分区表达式的谓词现在也可以被优化了。这也修复了 [#11092](https://github.com/ClickHouse/ClickHouse/issues/11092) 中的问题：当 `max_parallel_replicas > 1` 时会返回错误的 count。[#15074](https://github.com/ClickHouse/ClickHouse/pull/15074) ([Amos Bird](https://github.com/amosbird)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为无状态测试添加 flaky 检查。它会在合并前提前发现可能不稳定的功能测试。[#16238](https://github.com/ClickHouse/ClickHouse/pull/16238) ([alesapin](https://github.com/alesapin)).
* 为 `croaring` 使用正确的版本，而不是 amalgamation 版本。[#16285](https://github.com/ClickHouse/ClickHouse/pull/16285) ([sundyli](https://github.com/sundy-li)).
* 改进 `ya.make` 构建系统 (Arcadia) 的构建文件生成。[#16700](https://github.com/ClickHouse/ClickHouse/pull/16700) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为 `MaterializeMySQL` 数据库引擎添加 MySQL BinLog 文件检查工具。`MaterializeMySQL` 是一项 Experimental 功能。[#16223](https://github.com/ClickHouse/ClickHouse/pull/16223) ([Winter Zhang](https://github.com/zhang2014)).
* 检查非可执行文件是否被设置了可执行位。人们经常会不小心把来自 Windows 的文件作为可执行文件提交上来。[#15843](https://github.com/ClickHouse/ClickHouse/pull/15843) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 检查头文件中是否包含 `#pragma once`。[#15818](https://github.com/ClickHouse/ClickHouse/pull/15818) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 libhdfs3 中不合法的代码风格写法 `&vector[idx]`。这修复了 libcxx 的调试构建。另请参见 [https://github.com/ClickHouse-Extras/libhdfs3/pull/8](https://github.com/ClickHouse-Extras/libhdfs3/pull/8) 。[#15815](https://github.com/ClickHouse/ClickHouse/pull/15815) ([Amos Bird](https://github.com/amosbird)).
* 修复了 Mac OS 上一个杂项示例工具的构建。请注意，我们的 CI 不会在 Mac OS 上构建示例 (只构建 ClickHouse 可执行文件) ，所以它完全可能再次出问题。此更改修复了 [#15804](https://github.com/ClickHouse/ClickHouse/issues/15804)。[#15808](https://github.com/ClickHouse/ClickHouse/pull/15808) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 简化 Sys/V init 脚本。[#14135](https://github.com/ClickHouse/ClickHouse/pull/14135) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为 `db_generator` 添加了 `boost::program_options`，以提高其实用性。此更改关闭了 [#15940](https://github.com/ClickHouse/ClickHouse/issues/15940)。[#15973](https://github.com/ClickHouse/ClickHouse/pull/15973) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

<div id="clickhouse-release-2010">
  ## ClickHouse 发行版 20.10
</div>

<div id="clickhouse-release-v201074-stable-2020-12-24">
  ### ClickHouse 发行版 v20.10.7.4-稳定版本，2020-12-24
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在使用双 `IPv4/IPv6` 协议栈的机器上，server 无法访问 `clickhouse-odbc-bridge` 进程的问题；同时修复了在执行 ODBC 字典更新时，因使用格式错误的查询和/或引发崩溃的问题。这可能解决了 [#14489](https://github.com/ClickHouse/ClickHouse/issues/14489)。[#18278](https://github.com/ClickHouse/ClickHouse/pull/18278) ([Denis Glazachev](https://github.com/traceon)) 。
* 修复了 `枚举` 与 Int 类型之间的键比较问题。此项修复解决了 [#17989](https://github.com/ClickHouse/ClickHouse/issues/17989)。[#18214](https://github.com/ClickHouse/ClickHouse/pull/18214) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `MaterializeMySQL` database engine 中唯一键转换引发的崩溃问题。此修复解决了 [#18186](https://github.com/ClickHouse/ClickHouse/issues/18186) 和 [#16372](https://github.com/ClickHouse/ClickHouse/issues/16372)  [#18211](https://github.com/ClickHouse/ClickHouse/pull/18211) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了在解析 S3 URL 时出现的 `std::out_of_range: basic_string` 问题。[#18059](https://github.com/ClickHouse/ClickHouse/pull/18059) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了一个问题：由于 MaterializeMySQL 不支持转换 MySQL 前缀索引，导致某些表无法从 MySQL 同步到 ClickHouse。此修复解决了 [#15187](https://github.com/ClickHouse/ClickHouse/issues/15187) 和 [#17912](https://github.com/ClickHouse/ClickHouse/issues/17912)  [#17944](https://github.com/ClickHouse/ClickHouse/pull/17944) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复 `topK` 聚合函数中可能发生的段错误。此项修复关闭了 [#17404](https://github.com/ClickHouse/ClickHouse/issues/17404)。[#17845](https://github.com/ClickHouse/ClickHouse/pull/17845) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 如果 `in_memory_parts_enable_wal` 已禁用，则不要从 `WAL` 中恢复 parts。[#17802](https://github.com/ClickHouse/ClickHouse/pull/17802) ([detailyang](https://github.com/detailyang)).
* 修复了 ClickHouse 无法重新建立与 MySQL 服务器连接的问题。[#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了在守护进程模式下运行时 `system.stack_trace` 表为空的问题。[#17630](https://github.com/ClickHouse/ClickHouse/pull/17630) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在交互模式下使用 `clickhouse-client` 执行多行查询时，单行注释被错误地延续到整个查询末尾的问题。此修复解决了 [#13654](https://github.com/ClickHouse/ClickHouse/issues/13654)。[#17565](https://github.com/ClickHouse/ClickHouse/pull/17565) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在极少数情况下 server 可能停止接受连接的问题。[#17542](https://github.com/ClickHouse/ClickHouse/pull/17542) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了以下问题：当对应的变更在另一个副本上被终止时，`ALTER` 查询会挂起。此修复解决了 [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953)。[#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)) 。
* 修复了 ClickHouse 低估标记缓存大小时出现的错误。当存在大量带标记的小文件时，可能会发生这种情况。[#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)).
* 修复了启用设置 `optimize_redundant_functions_in_order_by` 时 `ORDER BY` 出现的问题。[#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `DISTINCT` 之后可能出现重复项的问题，其原因是错误的优化。修复了 [#17294](https://github.com/ClickHouse/ClickHouse/issues/17294)。[#17296](https://github.com/ClickHouse/ClickHouse/pull/17296) ([li chengxiang](https://github.com/chengxianglibra))。[#17439](https://github.com/ClickHouse/ClickHouse/pull/17439) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复了读取带有 `LowCardinality` 类型的 `JOIN` 表时发生的崩溃问题。此修复解决了 [#17228](https://github.com/ClickHouse/ClickHouse/issues/17228)。[#17397](https://github.com/ClickHouse/ClickHouse/pull/17397) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了子查询中存在常量列时 Set 索引失效的问题。详见 [#17246](https://github.com/ClickHouse/ClickHouse/issues/17246) 。 [#17249](https://github.com/ClickHouse/ClickHouse/pull/17249) ([Amos Bird](https://github.com/amosbird)).
* 修复了会导致崩溃的 `ColumnConst` 比较问题。此修复解决了 [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088)。[#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了一个 bug：对于非 leader 的 `ReplicatedMergeTreeTables`，`ON CLUSTER` 查询可能会一直卡住。[#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
* 修复了 fuzzer 发现的 `fuzzBits` 函数中的错误。此修复解决了 [#16980](https://github.com/ClickHouse/ClickHouse/issues/16980)。[#17051](https://github.com/ClickHouse/ClickHouse/pull/17051) ([hexiaoting](https://github.com/hexiaoting)) 。
* 避免远程查询在执行过程中被取消时产生不必要的网络错误，例如带有 `LIMIT` 的查询。[#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)).
* 修复了将 double 转换为大整数 (128 位和 256 位) 时结果错误的问题。[#16986](https://github.com/ClickHouse/ClickHouse/pull/16986) ([Mike](https://github.com/myrrc)).
* 发生错误时，重新解析 `format_avro_schema_registry_url` 的 IP。 [#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)).
* 修复了一个可能导致服务器崩溃的问题：在 `ALTER TABLE ... MODIFY COLUMN ... NewType` 之后，如果 `SELECT` 对正在修改的列使用了 `WHERE` 表达式，且该 alter 操作尚未完成。[#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)) 。
* 在 `clickhouse-git-import` 中，blame 信息计算有误。[#16959](https://github.com/ClickHouse/ClickHouse/pull/16959) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了对单调函数进行 ORDER BY 优化时的问题。此修复解决了 [#16107](https://github.com/ClickHouse/ClickHouse/issues/16107)。[#16956](https://github.com/ClickHouse/ClickHouse/pull/16956) ([Anton Popov](https://github.com/CurtizJ))。
* 修复了在启用设置 `optimize_aggregators_of_group_by_keys` 以及使用 JOIN 时，GROUP BY 的优化问题。这修复了 [#12604](https://github.com/ClickHouse/ClickHouse/issues/12604)。[#16951](https://github.com/ClickHouse/ClickHouse/pull/16951) ([Anton Popov](https://github.com/CurtizJ)) 。
* 安装脚本应始终在配置目录中创建子目录。这仅适用于使用自定义配置的 Docker 构建。[#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
* 修复了带有 `ORDER BY` 的查询中可能出现的错误 `Illegal type of argument`。此修复解决了 [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580)。[#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果未向 `WriteBufferFromS3` 写入任何数据，则中止分段上传。[#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 修复了在未传入任何参数时使用 `any` 导致崩溃的问题。此修复解决了 [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803)。[#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了以下问题：此前 ClickHouse 通过 MySQL 协议执行 `INSERT` 查询时，总是返回 0，而不是受影响的行数。此修复对应 [#16605](https://github.com/ClickHouse/ClickHouse/issues/16605)。[#16715](https://github.com/ClickHouse/ClickHouse/pull/16715) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `TDigest` 不受控增长的问题。[#16680](https://github.com/ClickHouse/ClickHouse/pull/16680) ([hrissan](https://github.com/hrissan)).
* 修复了在聚合函数中使用 `if` 后缀时远程查询失败的问题。此修复解决了 [#16574](https://github.com/ClickHouse/ClickHouse/issues/16574)、[#16231](https://github.com/ClickHouse/ClickHouse/issues/16231) 和 [#16610](https://github.com/ClickHouse/ClickHouse/pull/16610) ([Winter Zhang](https://github.com/zhang2014)) 。

<div id="clickhouse-release-v201041-stable-2020-11-13">
  ### ClickHouse 发行版 v20.10.4.1-稳定版本，2020-11-13
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在启用 query profiler，且 ClickHouse 安装在 glibc 某些版本 (据推测其某些函数的异步展开表存在问题) 的操作系统上时，偶发的静默崩溃问题。此修复解决了 [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301) 和 [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098)。[#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在启用 `transform_null_in` 设置时，多列和 Tuple 上的 `IN` operator 问题。修复了 [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310)。[#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在 max\_threads>0 且 ORDER BY 中包含 expression 时，optimize\_read\_in\_order/optimize\_aggregation\_in\_order 的问题。[#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)).
* 现在从输入中解析 AVRO 时，会从类型中移除 LowCardinality。修复了 [#16188](https://github.com/ClickHouse/ClickHouse/issues/16188)。[#16521](https://github.com/ClickHouse/ClickHouse/pull/16521) ([Mike](https://github.com/myrrc)).
* 修复了在使用 MySQL Master -> MySQL Slave -> ClickHouse MaterializeMySQL Engine，且 MySQL Slave 上启用 `slave_parallel_worker` 时，metadata 快速增长的问题，方法是正确缩减 GTID 集合。此修复解决了 [#15951](https://github.com/ClickHouse/ClickHouse/issues/15951)。[#16504](https://github.com/ClickHouse/ClickHouse/pull/16504) ([TCeason](https://github.com/TCeason)).
* 修复了 Distributed 的 DROP TABLE 问题 (与 INSERT 存在竞态条件) 。[#16409](https://github.com/ClickHouse/ClickHouse/pull/16409) ([Azat Khuzhin](https://github.com/azat)).
* 修复了复制队列中超大 entries 的处理问题。如果表结构特别大 (接近 1 MB) ，在 ALTER 查询中可能会出现超大 entries。此修复解决了 [#16307](https://github.com/ClickHouse/ClickHouse/issues/16307)。[#16332](https://github.com/ClickHouse/ClickHouse/pull/16332) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 MySQL database 的一个问题。当用作 database engine 的 MySQL 服务器不可用时，某些查询会抛出异常，因为它们会尝试从已禁用的 server 获取表，但这其实没有必要。例如，查询 `SELECT ... FROM system.parts` 应当只作用于 MergeTree 表，完全不应访问 MySQL database。[#16032](https://github.com/ClickHouse/ClickHouse/pull/16032) ([Kruglov Pavel](https://github.com/Avogar)).

<div id="improvement">
  #### 改进
</div>

* 针对通过 nginx 服务器作为代理使用 S3 的场景，提供了一个变通方案。Nginx 目前不接受路径为空的 URL，例如 [http://domain.com?delete，但原生](http://domain.com?delete，但原生) aws-sdk-cpp 会生成这种 URL。此提交使用了打过补丁的 aws-sdk-cpp 版本，在这种情况下会使用 "/" 作为路径，例如 [http://domain.com/?delete。\[#16813](http://domain.com/?delete。\[#16813)]\([https://github.com/ClickHouse/ClickHouse/pull/16813](https://github.com/ClickHouse/ClickHouse/pull/16813)) ([ianton-ru](https://github.com/ianton-ru)).

<div id="clickhouse-release-v2010330-2020-10-28">
  ### ClickHouse 发行版 v20.10.3.30，2020-10-28
</div>

<div id="backward-incompatible-change-2">
  #### 向后不兼容的变更
</div>

* 将 `multiple_joins_rewriter_version` 标记为废弃，并移除 joins rewriter 的第一个版本。[#15472](https://github.com/ClickHouse/ClickHouse/pull/15472) ([Artem Zuikov](https://github.com/4ertus2)).
* 将 `format_regexp_escaping_rule` 设置的默认值 (与 `Regexp` format 相关) 更改为 `Raw` (即将整个子模式作为一个值读取) ，使其行为更符合用户预期。[#15426](https://github.com/ClickHouse/ClickHouse/pull/15426) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在 SQL 中新增对嵌套多行注释 `/* comment /* comment */ */` 的支持。这符合 SQL 标准。[#14655](https://github.com/ClickHouse/ClickHouse/pull/14655) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了 MergeTree settings (`max_replicated_merges_with_ttl_in_queue` 和 `max_number_of_merges_with_ttl_in_pool`) ，用于控制 background pool 和 replicated queue 中带有 TTL 的 merges 数量。只有在使用 delete TTL 时，此更改才会与旧版本不兼容。否则，复制仍将保持兼容。如果一次性更新所有 shard 副本，或者在完成所有副本更新前执行 `SYSTEM STOP TTL MERGES`，则可以避免不兼容问题。如果 replication queue 中出现不兼容的 entry，首先执行 `SYSTEM STOP TTL MERGES`，然后对分配了不兼容 TTL merge 的分区执行 `ALTER TABLE ... DETACH PARTITION ...`。随后在单个副本上将其重新 Attach。[#14490](https://github.com/ClickHouse/ClickHouse/pull/14490) ([alesapin](https://github.com/alesapin)).
* 从早于 20.5 的版本升级时，如果执行滚动更新，并且 cluster 中同时存在 20.5 及以上版本和低于 20.5 的版本，那么当旧版本的 ClickHouse 节点重启，且旧版本在新版本节点存在的情况下启动时，可能会导致 `Part ... intersects previous part` 错误。为防止此错误，请先在所有 cluster 节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* 后台数据重压缩。为 MergeTree 表引擎家族新增了指定 `TTL ... RECOMPRESS codec_name` 的功能。[#14494](https://github.com/ClickHouse/ClickHouse/pull/14494) ([alesapin](https://github.com/alesapin)).
* 新增并行 quorum 插入功能。关闭 [#15601](https://github.com/ClickHouse/ClickHouse/issues/15601)。[#15601](https://github.com/ClickHouse/ClickHouse/pull/15601) ([Latysheva Alexandra](https://github.com/alexelex)) 。
* 用于进一步增强数据持久性保障的设置。对非复制表部署很有用。[#11948](https://github.com/ClickHouse/ClickHouse/pull/11948) ([Anton Popov](https://github.com/CurtizJ)).
* 当重复的块被写入某个本地尚不存在该块的副本时 (即尚未从其他副本拉取到本地) ，不要忽略它，而应将其写入本地，以达到与成功复制相同的效果。[#11684](https://github.com/ClickHouse/ClickHouse/pull/11684) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 现在支持使用 `WITH <identifier> AS (subquery) ... ` 在查询上下文中引入命名子查询。此更改关闭了 [#2416](https://github.com/ClickHouse/ClickHouse/issues/2416)。此更改关闭了 [#4967](https://github.com/ClickHouse/ClickHouse/issues/4967)。[#14771](https://github.com/ClickHouse/ClickHouse/pull/14771) ([Amos Bird](https://github.com/amosbird)).
* 引入 `enable_global_with_statement` 设置，将第一个 select 的 `WITH` 语句传递到同一级别的其他 select 查询中，并使 `WITH` 语句中的别名对同级子查询可见。[#15451](https://github.com/ClickHouse/ClickHouse/pull/15451) ([Amos Bird](https://github.com/amosbird)) 。
* 增强了集群间查询执行的安全性 (使用 initial\_user 作为当前查询用户) 。[#13156](https://github.com/ClickHouse/ClickHouse/pull/13156) ([Azat Khuzhin](https://github.com/azat)). [#15551](https://github.com/ClickHouse/ClickHouse/pull/15551) ([Azat Khuzhin](https://github.com/azat)).
* 新增了移除列属性和表生存时间 (TTL) 的功能。引入了查询 `ALTER TABLE MODIFY COLUMN col_name REMOVE what_to_remove` 和 `ALTER TABLE REMOVE TTL`。这两种操作都是轻量级的，并且在元数据层面执行。[#14742](https://github.com/ClickHouse/ClickHouse/pull/14742) ([alesapin](https://github.com/alesapin)).
* 新增了 `RawBLOB` 格式。该格式用于输入或输出单个值，不进行任何转义或分隔符处理。此项更新关闭了 [#15349](https://github.com/ClickHouse/ClickHouse/issues/15349)。[#15364](https://github.com/ClickHouse/ClickHouse/pull/15364) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增 `reinterpretAsUUID` 函数，支持将大端字节字符串转换为 UUID。[#15480](https://github.com/ClickHouse/ClickHouse/pull/15480) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 新增 `force_data_skipping_indices` 设置。[#15642](https://github.com/ClickHouse/ClickHouse/pull/15642) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增设置 `output_format_pretty_row_numbers`，用于在 Pretty 格式中为结果编号。此更改修复了 [#15350](https://github.com/ClickHouse/ClickHouse/issues/15350)。[#15443](https://github.com/ClickHouse/ClickHouse/pull/15443) ([flynn](https://github.com/ucasFL)).
* 新增了查询混淆工具。借助该工具，可以共享更多查询，以便开展更充分的测试。此项改动关闭了 [#15268](https://github.com/ClickHouse/ClickHouse/issues/15268)。[#15321](https://github.com/ClickHouse/ClickHouse/pull/15321) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增表函数 `null('structure')`。[#14797](https://github.com/ClickHouse/ClickHouse/pull/14797) ([vxider](https://github.com/Vxider)) 。
* 新增了 `formatReadableQuantity` 函数，便于以更适合人类阅读的方式显示大数字。[#14725](https://github.com/ClickHouse/ClickHouse/pull/14725) ([Artem Hnilov](https://github.com/BooBSD)) 。
* 新增格式 `LineAsString`，可接受由换行符分隔的一系列行，并将每一行作为一个整体解析为单个 String 字段。[#14703](https://github.com/ClickHouse/ClickHouse/pull/14703) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)), [#13846](https://github.com/ClickHouse/ClickHouse/pull/13846) ([hexiaoting](https://github.com/hexiaoting)).
* 新增 `JSONStrings` format，可将数据输出为字符串数组。[#14333](https://github.com/ClickHouse/ClickHouse/pull/14333) ([hcz](https://github.com/hczhcz)) 。
* 为 `Regexp` 格式新增对 "Raw" 列格式的支持。这样无需任何转义规则，即可直接将整个子模式提取出来。[#15363](https://github.com/ClickHouse/ClickHouse/pull/15363) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 允许为 `TSV` 输出格式配置 `NULL` 表示形式。它由设置 `output_format_tsv_null_representation` 控制，默认值为 `\N`。这解决了 [#9375](https://github.com/ClickHouse/ClickHouse/issues/9375)。请注意，该设置仅控制输出格式，而 `\N` 是 `TSV` 输入格式唯一支持的 `NULL` 表示形式。[#14586](https://github.com/ClickHouse/ClickHouse/pull/14586) ([Kruglov Pavel](https://github.com/Avogar)).
* 支持 `MaterializeMySQL` 的 Decimal 数据类型。`MaterializeMySQL` 是一项 Experimental 功能。[#14535](https://github.com/ClickHouse/ClickHouse/pull/14535) ([Winter Zhang](https://github.com/zhang2014)).
* 新增特性：`SHOW DATABASES LIKE 'xxx'`。[#14521](https://github.com/ClickHouse/ClickHouse/pull/14521) ([hexiaoting](https://github.com/hexiaoting)) 。
* 新增了一个脚本，可将 (任意) Git 仓库作为示例数据集导入 ClickHouse。[#14471](https://github.com/ClickHouse/ClickHouse/pull/14471) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 现在，INSERT 语句的列列表中可以使用带列转换器的星号 (及其变体) 。[#14453](https://github.com/ClickHouse/ClickHouse/pull/14453) ([Amos Bird](https://github.com/amosbird)) 。
* 新增面向分布式查询的查询复杂度限制设置 `max_rows_to_read_leaf`、`max_bytes_to_read_leaf`，用于限制叶节点上可读取的最大行数/字节数。该限制仅适用于本地读取，*不包括* 根节点上的最终合并阶段。[#14221](https://github.com/ClickHouse/ClickHouse/pull/14221) ([Roman Khavronenko](https://github.com/hagen1778)) 。
* 允许用户在配置文件的 `<replicated_merge_tree>` 部分为 `ReplicatedMergeTree*` 存储指定设置。其工作方式与 `<merge_tree>` 部分类似。对于 `ReplicatedMergeTree*` 存储，`<merge_tree>` 和 `<replicated_merge_tree>` 中的设置会同时生效，但 `<replicated_merge_tree>` 中的设置优先级更高。新增了 `system.replicated_merge_tree_settings` 表。[#13573](https://github.com/ClickHouse/ClickHouse/pull/13573) ([Amos Bird](https://github.com/amosbird)) 。
* 添加了 `mapPopulateSeries` 函数。[#13166](https://github.com/ClickHouse/ClickHouse/pull/13166) ([Ildus Kurbangaliev](https://github.com/ildus)) 。
* 支持的 MySQL 类型：`decimal` (映射为 ClickHouse `Decimal`) 以及带有子秒级精度的 `datetime` (映射为 `DateTime64`) 。[#11512](https://github.com/ClickHouse/ClickHouse/pull/11512) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 为 `system.text_log`、`system.trace_log`、`system.query_log` 和 `system.query_thread_log` 表新增 `event_time_microseconds` 字段。[#14760](https://github.com/ClickHouse/ClickHouse/pull/14760) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 在 `system.asynchronous_metric_log` 和 `system.metric_log` 表中新增 `event_time_microseconds`。[#14514](https://github.com/ClickHouse/ClickHouse/pull/14514) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 在 `system.query_log` 和 `system.query_thread_log` 表中新增 `query_start_time_microseconds` 字段。[#14252](https://github.com/ClickHouse/ClickHouse/pull/14252) ([Bharat Nallan](https://github.com/bharatnc)) 。

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了无论限制为何，内存都可能被过度分配的问题。此修复关闭了 [#14560](https://github.com/ClickHouse/ClickHouse/issues/14560)。[#16206](https://github.com/ClickHouse/ClickHouse/pull/16206) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 `executable` 字典源卡顿的问题。在早期版本中，使用某些格式 (例如 `JSONEachRow`) 时，子进程在至少输出一些内容之前，数据不会被传送给它。此项修复关闭了 [#1697](https://github.com/ClickHouse/ClickHouse/issues/1697)。此项修复关闭了 [#2455](https://github.com/ClickHouse/ClickHouse/issues/2455)。[#14525](https://github.com/ClickHouse/ClickHouse/pull/14525) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了函数 `dictGet` 在发生异常时出现 double free 的问题。这种情况可能发生在字典加载出错时。[#16429](https://github.com/ClickHouse/ClickHouse/pull/16429) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了带有 totals/rollup/cube 修饰符的 group by，以及作用于 group by 键的 min/max 函数相关问题。修复 [#16393](https://github.com/ClickHouse/ClickHouse/issues/16393)。[#16397](https://github.com/ClickHouse/ClickHouse/pull/16397) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在 `prefer&#95;localhost&#95;replica=0` 且启用 `internal&#95;replication` 时异步 Distributed INSERT 的问题。[#16358](https://github.com/ClickHouse/ClickHouse/pull/16358) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 TwoLevelStringHashTable 实现中的一处严重错误，可能会导致内存泄漏。[#16264](https://github.com/ClickHouse/ClickHouse/pull/16264) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 lambda 表达式中某些错误聚合导致的段错误。[#16082](https://github.com/ClickHouse/ClickHouse/pull/16082) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 `ReplicatedVersionedCollapsingMergeTree` 的 `ALTER MODIFY ... ORDER BY` 查询挂起问题。此修复解决了 [#15980](https://github.com/ClickHouse/ClickHouse/issues/15980)。[#16011](https://github.com/ClickHouse/ClickHouse/pull/16011) ([alesapin](https://github.com/alesapin)).
* `MaterializeMySQL` (Experimental 功能) ：修复 collate 名称和 charset 名称解析器，并支持字符串类型的 `length = 0`。[#16008](https://github.com/ClickHouse/ClickHouse/pull/16008) ([Winter Zhang](https://github.com/zhang2014)) 。
* 现已支持对具有复杂键的字典使用 `direct` 布局。[#16007](https://github.com/ClickHouse/ClickHouse/pull/16007) ([Anton Popov](https://github.com/CurtizJ)) 。
* 防止在一段时间未活动后发生复制错误时，副本卡住 5–10 分钟。[#15987](https://github.com/ClickHouse/ClickHouse/pull/15987) ([filimonov](https://github.com/filimonov)).
* 修复了在向 MaterializedView 插入数据或从中查询数据时，并发删除目标表导致的罕见段错误 (适用于 Atomic 数据库引擎) 。[#15984](https://github.com/ClickHouse/ClickHouse/pull/15984) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 profile 解析中的歧义：`CREATE USER ... SETTINGS profile readonly` 现在会被视为使用名为 `readonly` 的 profile，而不是名为 `profile` 且带有 readonly 约束的设置项。此修复见 [#15628](https://github.com/ClickHouse/ClickHouse/issues/15628)。[#15982](https://github.com/ClickHouse/ClickHouse/pull/15982) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* `MaterializeMySQL` (Experimental 功能) ：修复了创建 database 失败时发生崩溃的问题。[#15954](https://github.com/ClickHouse/ClickHouse/pull/15954) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在表被并发重命名时，`DROP TABLE IF EXISTS` 因出现 `Table ... does not exist` 错误而失败的问题 (适用于 Atomic 数据库引擎) 。修复了并发执行某些涉及多个表的 DDL 查询 (如 `DROP DATABASE` 和 `RENAME TABLE`) 时极少出现的死锁问题——还修复了在并发执行 `DROP/DETACH TABLE` 时，`DROP/DETACH DATABASE` 因 `Table ... does not exist` 而失败的问题。[#15934](https://github.com/ClickHouse/ClickHouse/pull/15934) ([tavplubix](https://github.com/tavplubix)).
* 修复了以下问题：当查询包含 `WHERE`、`PREWHERE` 和 `GLOBAL IN` 时，从 `Distributed` 表查询会错误地返回空结果。修复 [#15792](https://github.com/ClickHouse/ClickHouse/issues/15792)。[#15933](https://github.com/ClickHouse/ClickHouse/pull/15933) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 [#12513](https://github.com/ClickHouse/ClickHouse/issues/12513)：重新分析查询时，具有相同别名的不同表达式的问题。[#15886](https://github.com/ClickHouse/ClickHouse/pull/15886) ([Winter Zhang](https://github.com/zhang2014)).
* 修复 RBAC 实现中在极少数情况下可能发生的死锁。[#15875](https://github.com/ClickHouse/ClickHouse/pull/15875) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复在执行 `ALTER MODIFY COLUMN` 查询后，执行 `SELECT ... ORDER BY DESC` 查询时出现的 `Block structure mismatch` 异常。修复 [#15800](https://github.com/ClickHouse/ClickHouse/issues/15800)。[#15852](https://github.com/ClickHouse/ClickHouse/pull/15852) ([alesapin](https://github.com/alesapin)) 。
* `MaterializeMySQL` (Experimental 功能) ：修复 `select count()` 结果不准确的问题。[#15767](https://github.com/ClickHouse/ClickHouse/pull/15767) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了某些仅选择虚拟列的查询场景。此前可能会抛出 `Not found column _nothing in block` 异常。修复 [#12298](https://github.com/ClickHouse/ClickHouse/issues/12298)。[#15756](https://github.com/ClickHouse/ClickHouse/pull/15756) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 Atomic database 中带内部表的 materialized view 删除问题 (由于对 MV 的内部表递归执行 DROP TABLE，导致工作线程挂起，进而使后续所有 DROP TABLE 都卡住) 。[#15743](https://github.com/ClickHouse/ClickHouse/pull/15743) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果首次尝试失败，则可将分片移动到另一块磁盘/卷。 [#15723](https://github.com/ClickHouse/ClickHouse/pull/15723) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了在向 `MATERIALIZED VIEW` 插入数据时，如果 `MV` 的查询包含 `ARRAY JOIN`，可能出现的 `Cannot find column` 错误。[#15717](https://github.com/ClickHouse/ClickHouse/pull/15717) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `max_replicated_logs_to_keep` 设置默认值过低的问题，这可能导致副本过于频繁地丢失。通过选择最新的副本进行克隆，改进了丢失副本的恢复流程。同时，不再从丢失的副本中删除旧的 parts，而是将其 detach。[#15701](https://github.com/ClickHouse/ClickHouse/pull/15701) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 MySQL 字典和表中的一个罕见竞态条件。[#15686](https://github.com/ClickHouse/ClickHouse/pull/15686) ([alesapin](https://github.com/alesapin)).
* 修复 AMQP-CPP 中一个 (无害的) 竞态条件。[#15667](https://github.com/ClickHouse/ClickHouse/pull/15667) ([alesapin](https://github.com/alesapin)).
* 修复错误 `Cannot add simple transform to empty Pipe`：当从 `Buffer` 表读取数据，且其结构与目标表不同时，如果目标表的查询返回空结果，就可能发生该错误。修复了 [#15529](https://github.com/ClickHouse/ClickHouse/issues/15529)。[#15662](https://github.com/ClickHouse/ClickHouse/pull/15662) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在向使用 S3 的 MergeTree 插入数据时，现已可正确处理错误。基于 S3 的 MergeTree 是一项 Experimental 功能。[#15657](https://github.com/ClickHouse/ClickHouse/pull/15657) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了 S3 表函数中的一个问题：未将 URL 中的区域应用到 S3 客户端配置。[#15646](https://github.com/ClickHouse/ClickHouse/pull/15646) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了查询计划中 `ReadFromStorage` 步骤里资源的销毁顺序。在极少数情况下，这可能导致崩溃。可能与 [#15610](https://github.com/ClickHouse/ClickHouse/issues/15610) 有关。[#15645](https://github.com/ClickHouse/ClickHouse/pull/15645) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 在分离只读表时，扣减 `ReadonlyReplica` 指标值。[#15592](https://github.com/ClickHouse/ClickHouse/pull/15592) ([sundyli](https://github.com/sundy-li)) 。
* 修复了在 `VALUES`、`LIMIT` 或 `IN` 运算符右侧使用 `JSON*` 函数结果时出现的 `Element ... is not a constant expression` 错误。[#15589](https://github.com/ClickHouse/ClickHouse/pull/15589) ([tavplubix](https://github.com/tavplubix)) 。
* 发生异常时，查询会更快结束。若发生异常，则会取消远程副本上的执行。[#15578](https://github.com/ClickHouse/ClickHouse/pull/15578) ([Azat Khuzhin](https://github.com/azat)) 。
* 防止出现错误消息 `Could not calculate available disk space (statvfs), errno: 4, strerror: Interrupted system call`。此修复解决了 [#15541](https://github.com/ClickHouse/ClickHouse/issues/15541)。[#15557](https://github.com/ClickHouse/ClickHouse/pull/15557) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在带有 IN 和 Distributed 表的查询中，当发起节点上没有数据库时出现 `Database <db> does not exist.` 的问题。[#15538](https://github.com/ClickHouse/ClickHouse/pull/15538) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 变更可能会在 `MOVE` 或 `REPLACE PARTITION` 之后，或在极少数情况下于 `DETACH` 或 `DROP PARTITION` 之后，因等待某个不存在的分片而卡住。该问题已修复。 [#15537](https://github.com/ClickHouse/ClickHouse/pull/15537) ([tavplubix](https://github.com/tavplubix)).
* 修复了一个 bug：如果之前执行过使用相同模式的 `LIKE`，`ILIKE` 操作符就会变为区分大小写。 [#15536](https://github.com/ClickHouse/ClickHouse/pull/15536) ([alesapin](https://github.com/alesapin)).
* 修复了在选择数据中不存在、但依赖于其他同样不存在的列时出现的 `Missing columns` 错误。修复 [#15530](https://github.com/ClickHouse/ClickHouse/issues/15530)。[#15532](https://github.com/ClickHouse/ClickHouse/pull/15532) ([alesapin](https://github.com/alesapin)).
* 当向 ReplicatedMergeTree 传入单个参数时，会抛出错误，而不是将其忽略。[#15516](https://github.com/ClickHouse/ClickHouse/pull/15516) ([nvartolomei](https://github.com/nvartolomei)) 。
* 修复了 DDLWorker 中事件订阅的一个 bug，该问题在极少数情况下可能导致 `ON CLUSTER` 查询卡住。于 [#13450](https://github.com/ClickHouse/ClickHouse/issues/13450) 中引入。[#15477](https://github.com/ClickHouse/ClickHouse/pull/15477) ([alesapin](https://github.com/alesapin)) 。
* 当 `boundingRatio` 聚合函数的第二个参数类型不正确时，会报告恰当的错误。[#15407](https://github.com/ClickHouse/ClickHouse/pull/15407) ([detailyang](https://github.com/detailyang)).
* 修复 [#15365](https://github.com/ClickHouse/ClickHouse/issues/15365)：使用 MySQL 引擎 Attach 数据库时会抛出异常 (缺少查询上下文) 。[#15384](https://github.com/ClickHouse/ClickHouse/pull/15384) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在 select 查询中多次使用列转换器时的问题。[#15378](https://github.com/ClickHouse/ClickHouse/pull/15378) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `S3` 存储中的压缩问题。[#15376](https://github.com/ClickHouse/ClickHouse/pull/15376) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了一个 bug：像 `SELECT toStartOfDay(today())` 这样的查询会因报错提示 time\_zone 参数为空而失败。[#15319](https://github.com/ClickHouse/ClickHouse/pull/15319) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复了 MergeTree 表在重命名和后台清理期间出现的竞态条件。[#15304](https://github.com/ClickHouse/ClickHouse/pull/15304) ([alesapin](https://github.com/alesapin))。
* 修复了在启用系统日志时服务器启动期间出现的罕见竞态条件。 [#15300](https://github.com/ClickHouse/ClickHouse/pull/15300) ([alesapin](https://github.com/alesapin)).
* 修复了查询中包含大量针对同一 `MySQL` 引擎表的子查询时发生卡死的问题。此前，如果一个查询中包含超过 16 个针对同一 `MySQL` 表的子查询，就会一直卡死。 [#15299](https://github.com/ClickHouse/ClickHouse/pull/15299) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 QueryLog 中的 MSan 报告。字段 `memory_usage` 可能会使用未初始化的内存。[#15258](https://github.com/ClickHouse/ClickHouse/pull/15258) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在查询对 Merge 表执行 JOIN 时，GROUP BY 中出现 'Unknown identifier' 的问题。[#15242](https://github.com/ClickHouse/ClickHouse/pull/15242) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了使用 `joinGet` 和 `LowCardinality` 类型时实例崩溃的问题。该修复解决了 [#15214](https://github.com/ClickHouse/ClickHouse/issues/15214)。[#15220](https://github.com/ClickHouse/ClickHouse/pull/15220) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了表引擎 `Buffer` 中的一个缺陷：在执行 `ALTER` 查询后，无法将采用新结构的数据插入到 `Buffer` 中。修复了 [#15117](https://github.com/ClickHouse/ClickHouse/issues/15117)。[#15192](https://github.com/ClickHouse/ClickHouse/pull/15192) ([alesapin](https://github.com/alesapin)).
* 调整 MySQL 列定义数据包中的 Decimal 字段长度。[#15152](https://github.com/ClickHouse/ClickHouse/pull/15152) ([maqroll](https://github.com/maqroll)) 。
* 修复了 `join_algorithm='auto'` 中的 `Data compressed with different methods` 问题。 在 `join_algorithm='partial_merge'` 中，左侧表的连接键类型仍保留为 LowCardinality。[#15088](https://github.com/ClickHouse/ClickHouse/pull/15088) ([Artem Zuikov](https://github.com/4ertus2)).
* 更新 `jemalloc`，修复带有亲和性掩码的 `percpu_arena` 问题。[#15035](https://github.com/ClickHouse/ClickHouse/pull/15035) ([Azat Khuzhin](https://github.com/azat)). [#14957](https://github.com/ClickHouse/ClickHouse/pull/14957) ([Azat Khuzhin](https://github.com/azat)).
* 我们已经在 String 和 FixedString 之间采用了填充比较 ([https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/FunctionsComparison.h#L333](https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/FunctionsComparison.h#L333)) 。此 PR 将相同的逻辑应用于字段比较，修复了将 FixedString 用作主键时的问题。此修复对应 [#14908](https://github.com/ClickHouse/ClickHouse/issues/14908)。[#15033](https://github.com/ClickHouse/ClickHouse/pull/15033) ([Amos Bird](https://github.com/amosbird)) 。
* 如果使用精心构造的参数调用函数 `bar`，则可能发生缓冲区溢出。此修复已关闭 [#13926](https://github.com/ClickHouse/ClickHouse/issues/13926)。[#15028](https://github.com/ClickHouse/ClickHouse/pull/15028) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在 Mac OS 上的 Docker 中运行 clickhouse-server 时，Atomic database 执行 DDL 查询时出现的 `Cannot rename ... errno: 22, strerror: Invalid argument` 错误。[#15024](https://github.com/ClickHouse/ClickHouse/pull/15024) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了在 `RIGHT` 或 `FULL JOIN` 且 `join&#95;algorith=&#39;auto&#39;` 时，超出内存限制并需要将 HashJoin 切换为 MergeJoin 的情况下发生崩溃的问题。[#15002](https://github.com/ClickHouse/ClickHouse/pull/15002) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 现在，设置项 `number_of_free_entries_in_pool_to_execute_mutation` 和 `number_of_free_entries_in_pool_to_lower_max_size_of_merge` 现在可以等于 `background_pool_size`。[#14975](https://github.com/ClickHouse/ClickHouse/pull/14975) ([alesapin](https://github.com/alesapin)).
* 修复了子查询包含 `finalizeAggregation` 函数时谓词下推失效的问题。修复了 [#14847](https://github.com/ClickHouse/ClickHouse/issues/14847)。[#14937](https://github.com/ClickHouse/ClickHouse/pull/14937) ([filimonov](https://github.com/filimonov)).
* 在 `system.asynchronous_metrics` 中发布每个逻辑核心的 CPU 频率。这修复了 [#14923](https://github.com/ClickHouse/ClickHouse/issues/14923)。[#14924](https://github.com/ClickHouse/ClickHouse/pull/14924) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* `MaterializeMySQL` (Experimental 功能) ：修复了 `.metadata.tmp File exists` 错误。 [#14898](https://github.com/ClickHouse/ClickHouse/pull/14898) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了某些情况下调用 `extractAllGroups` 函数可能触发“Memory limit exceeded”错误的问题。此修复对应 [#13383](https://github.com/ClickHouse/ClickHouse/issues/13383)。[#14889](https://github.com/ClickHouse/ClickHouse/pull/14889) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了尝试使用文件描述符向 StorageFile 执行 INSERT 时导致的 SIGSEGV。[#14887](https://github.com/ClickHouse/ClickHouse/pull/14887) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `cache` 字典中的段错误 [#14837](https://github.com/ClickHouse/ClickHouse/issues/14837)。[#14879](https://github.com/ClickHouse/ClickHouse/pull/14879) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* `MaterializeMySQL` (Experimental 功能) ：修复了 MySQL binlog 事件解析中的一个 bug，该问题会导致 `MaterializeMySQL` database engine 中出现 `Attempt to read after eof` 和 `Packet payload is not fully read`。[#14852](https://github.com/ClickHouse/ClickHouse/pull/14852) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `SELECT` 查询中的一个少见错误：当被查询的列带有依赖于另一列的 `DEFAULT` 表达式，而该另一列同样带有 `DEFAULT`、未出现在 `SELECT` 查询中且磁盘上不存在时，就会触发该错误。部分修复了 [#14531](https://github.com/ClickHouse/ClickHouse/issues/14531)。[#14845](https://github.com/ClickHouse/ClickHouse/pull/14845) ([alesapin](https://github.com/alesapin)).
* 修复了一个问题：如果配置文件需要从 ZK 拉取 (使用 `from_zk` include 选项) ，server 在启动时与 ZooKeeper 通信过程中可能会卡住。此修复对应 [#14814](https://github.com/ClickHouse/ClickHouse/issues/14814)。[#14843](https://github.com/ClickHouse/ClickHouse/pull/14843) ([Alexander Kuzmenkov](https://github.com/akuzm)).
* 修复了有符号类型在缩窄 `Int -> Int` 转换时单调性检测错误的问题。该问题可能导致查询结果不正确。此缺陷在 [#14513](https://github.com/ClickHouse/ClickHouse/issues/14513) 中被发现。[#14783](https://github.com/ClickHouse/ClickHouse/pull/14783) ([Amos Bird](https://github.com/amosbird)) 。
* `Replace` 列转换器应将标识符替换为克隆的 AST。这修复了 [#14695](https://github.com/ClickHouse/ClickHouse/issues/14695)。[#14734](https://github.com/ClickHouse/ClickHouse/pull/14734) ([Amos Bird](https://github.com/amosbird)).
* 修复了执行 `ALTER ... MODIFY QUERY` 时，materialized view 元数据中默认数据库名称缺失的问题。[#14664](https://github.com/ClickHouse/ClickHouse/pull/14664) ([tavplubix](https://github.com/tavplubix)) 。
* 修复一个 bug：当 `ALTER UPDATE` 变更的赋值表达式中使用 `Nullable` 列和常量值 (如 `UPDATE x = 42`) 时，可能会导致列中的值不正确或发生段错误。修复了 [#13634](https://github.com/ClickHouse/ClickHouse/issues/13634)、[#14045](https://github.com/ClickHouse/ClickHouse/issues/14045)。[#14646](https://github.com/ClickHouse/ClickHouse/pull/14646) ([alesapin](https://github.com/alesapin)) 。
* 修复了因结果列的小数标度错误导致的 Decimal 乘法结果错误问题。[#14603](https://github.com/ClickHouse/ClickHouse/pull/14603) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复 `Nullable` `LowCardinality` 上的函数 `has`。[#14591](https://github.com/ClickHouse/ClickHouse/pull/14591) ([Mike](https://github.com/myrrc)).
* 修复了 StorageReplicatedMergeTree 引擎在 CreateQuery 期间发生 Zookeeper 异常后未清理数据目录的问题。[#14563](https://github.com/ClickHouse/ClickHouse/pull/14563) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复了带有组合器 `-Resample` 的函数中罕见的段错误；当参数非常大而导致溢出时，可能会出现此错误。[#14562](https://github.com/ClickHouse/ClickHouse/pull/14562) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了将 `Nullable(String)` 转换为枚举时的一个错误。该问题由 [#12745](https://github.com/ClickHouse/ClickHouse/pull/12745) 引入。此修复解决了 [#14435](https://github.com/ClickHouse/ClickHouse/issues/14435)。[#14530](https://github.com/ClickHouse/ClickHouse/pull/14530) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `Nullable` 列排序顺序错误的问题。此修复解决了 [#14344](https://github.com/ClickHouse/ClickHouse/issues/14344)。[#14495](https://github.com/ClickHouse/ClickHouse/pull/14495) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 `currentDatabase()` 函数无法用于 `ON CLUSTER` DDL 查询的问题。[#14211](https://github.com/ClickHouse/ClickHouse/pull/14211) ([Winter Zhang](https://github.com/zhang2014)) 。
* `MaterializeMySQL` (Experimental 功能) ：修复了 `MaterializeMySQL` 数据库引擎中的 `Packet payload is not fully read` 错误。[#14696](https://github.com/ClickHouse/ClickHouse/pull/14696) ([BohuTANG](https://github.com/BohuTANG)) 。

<div id="improvement">
  #### 改进
</div>

* 默认对新创建的数据库启用 `Atomic` 数据库引擎。[#15003](https://github.com/ClickHouse/ClickHouse/pull/15003) ([tavplubix](https://github.com/tavplubix)).
* 新增了为带有子类型的列指定专用编解码器 (如 `Delta`、`T64` 等) 的能力。实现了 [#12551](https://github.com/ClickHouse/ClickHouse/issues/12551)，修复了 [#11397](https://github.com/ClickHouse/ClickHouse/issues/11397) 和 [#4609](https://github.com/ClickHouse/ClickHouse/issues/4609)。[#15089](https://github.com/ClickHouse/ClickHouse/pull/15089) ([alesapin](https://github.com/alesapin)).
* 动态重载 ZooKeeper 配置。[#14678](https://github.com/ClickHouse/ClickHouse/pull/14678) ([sundyli](https://github.com/sundy-li)) 。
* 现在，无论集群配置中的 `<internal_replication>` 设置为何，都可以执行 `ALTER ... ON CLUSTER` 查询。[#16075](https://github.com/ClickHouse/ClickHouse/pull/16075) ([alesapin](https://github.com/alesapin)) 。
* 现在，`joinGet` 已支持多键查找。延续 [#12418](https://github.com/ClickHouse/ClickHouse/issues/12418)。[#13015](https://github.com/ClickHouse/ClickHouse/pull/13015) ([Amos Bird](https://github.com/amosbird)) 。
* 如果为 `Atomic` database 指定了 `NO DELAY` 或 `SYNC`，则等待 `DROP/DETACH TABLE` 真正完成。[#15448](https://github.com/ClickHouse/ClickHouse/pull/15448) ([tavplubix](https://github.com/tavplubix)).
* 现在可以通过 `ALTER` 查询修改 `VersionedCollapsingMergeTree` 的版本列类型。[#15442](https://github.com/ClickHouse/ClickHouse/pull/15442) ([alesapin](https://github.com/alesapin)) 。
* 在创建复制表时，展开 `zookeeper_path` 中的 `{database}`、`{table}` 和 `{uuid}` 宏。如果 `RENAME TABLE` 可能导致服务器重启后 `zookeeper_path` 损坏，则不允许执行该操作。修复了 [#6917](https://github.com/ClickHouse/ClickHouse/issues/6917)。[#15348](https://github.com/ClickHouse/ClickHouse/pull/15348) ([tavplubix](https://github.com/tavplubix)) 。
* 函数 `now` 现支持 timezone 参数。这修复了 [15264](https://github.com/ClickHouse/ClickHouse/issues/15264)。[#15285](https://github.com/ClickHouse/ClickHouse/pull/15285) ([flynn](https://github.com/ucasFL)).
* 在 `/docker-entrypoint-initdb.d/` 中的所有脚本执行完毕之前，不允许连接到 ClickHouse 服务器。 [#15244](https://github.com/ClickHouse/ClickHouse/pull/15244) ([Aleksei Kozharin](https://github.com/alekseik1)).
* 为 `EXPLAIN PLAN` 查询新增了 `optimize` 设置。启用后，将应用查询计划级别的优化。默认情况下已启用。[#15201](https://github.com/ClickHouse/ClickHouse/pull/15201) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修正了 CAST 参数数量错误时的异常消息。此更改关闭了 [#13992](https://github.com/ClickHouse/ClickHouse/issues/13992)。[#15029](https://github.com/ClickHouse/ClickHouse/pull/15029) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了在插入数据分区片段时禁用 TTL move 的选项。[#15000](https://github.com/ClickHouse/ClickHouse/pull/15000) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 执行变更时忽略键约束。如果没有这个拉取请求，在 `force_index_by_date = 1` 或 `force_primary_key = 1` 时将无法执行变更。[#14973](https://github.com/ClickHouse/ClickHouse/pull/14973) ([Amos Bird](https://github.com/amosbird)).
* 允许在此前因 ZooKeeper 会话过期导致删除失败后，再次删除 Replicated 表。此更改修复了 [#11891](https://github.com/ClickHouse/ClickHouse/issues/11891)。[#14926](https://github.com/ClickHouse/ClickHouse/pull/14926) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了对分布式表执行带 SETTINGS 的 SELECT 时出现过多设置约束违规的问题。[#14876](https://github.com/ClickHouse/ClickHouse/pull/14876) ([Amos Bird](https://github.com/amosbird)) 。
* 提供 `load_balancing_first_offset` 查询设置，用于显式指定哪个是第一个副本。它与 `FIRST_OR_RANDOM` 负载均衡策略配合使用，可用于控制副本的工作负载。[#14867](https://github.com/ClickHouse/ClickHouse/pull/14867) ([Amos Bird](https://github.com/amosbird)).
* 在 `EXPLAIN` 结果中展示 `SET` 和 `JOIN` 的子查询。[#14856](https://github.com/ClickHouse/ClickHouse/pull/14856) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 支持在 `Distributed` 存储中使用多卷存储配置。[#14839](https://github.com/ClickHouse/ClickHouse/pull/14839) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 基于同一个 timespec 构造 `query_start_time` 和 `query_start_time_microseconds`。[#14831](https://github.com/ClickHouse/ClickHouse/pull/14831) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 支持为 `StorageJoin` 和 `StorageSet` 禁用持久化，该功能由设置 `disable_set_and_join_persistency` 控制。此 PR 还解决了问题 [#6318](https://github.com/ClickHouse/ClickHouse/issues/6318)。[#14776](https://github.com/ClickHouse/ClickHouse/pull/14776) ([vxider](https://github.com/Vxider)) 。
* 现在，`COLUMNS` 可用于包裹一组列，并在之后应用列转换器。[#14775](https://github.com/ClickHouse/ClickHouse/pull/14775) ([Amos Bird](https://github.com/amosbird)) 。
* 向 `system.merges` 表中添加 `merge_algorithm`，以改进对合并过程的排查。[#14705](https://github.com/ClickHouse/ClickHouse/pull/14705) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了由 ZooKeeper exists watch 引起的潜在内存泄漏。[#14693](https://github.com/ClickHouse/ClickHouse/pull/14693) ([hustnn](https://github.com/hustnn)) 。
* 允许分布式 DDL 并行执行。[#14684](https://github.com/ClickHouse/ClickHouse/pull/14684) ([Azat Khuzhin](https://github.com/azat)) 。
* 添加 `QueryMemoryLimitExceeded` 事件计数器。此更改修复了 [#14589](https://github.com/ClickHouse/ClickHouse/issues/14589)。[#14647](https://github.com/ClickHouse/ClickHouse/pull/14647) ([fastio](https://github.com/fastio)) 。
* 修复了查询格式化中的一些尾随空白问题。[#14595](https://github.com/ClickHouse/ClickHouse/pull/14595) ([Azat Khuzhin](https://github.com/azat)) 。
* ClickHouse 对 partition expr 和 key expr 的处理方式不同。partition expr 用于构建包含相关列的 minmax 索引，而 primary key expr 则作为 expr 存储。有时，用户可能会按更粗的粒度对表进行分区，例如 `partition by i / 1000`。不过，二元运算符不具备单调性，这个 PR 尝试修复这一问题。它也可能让其他用例受益。[#14513](https://github.com/ClickHouse/ClickHouse/pull/14513) ([Amos Bird](https://github.com/amosbird)) 。
* 新增一个可跳过 `DiskS3` 访问检查的选项。`s3` 磁盘属于 Experimental 功能。[#14497](https://github.com/ClickHouse/ClickHouse/pull/14497) ([Pavel Kovalenko](https://github.com/Jokser)).
* 如果有正在进行的 S3 请求，则加快服务器关闭过程。[#14496](https://github.com/ClickHouse/ClickHouse/pull/14496) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* `SYSTEM RELOAD CONFIG` 现在在重新加载失败时会抛出异常，并继续使用之前的 users.xml。后台的周期性重新加载在失败时也会继续使用之前的 users.xml。[#14492](https://github.com/ClickHouse/ClickHouse/pull/14492) ([Vitaly Baranov](https://github.com/vitlibar)).
* 在 `clickhouse-client` 的脚本模式中，对于采用 VALUES 格式且内联数据的 INSERT 操作，除换行符外，现在还支持使用分号作为数据结束符。关闭 [#12288](https://github.com/ClickHouse/ClickHouse/issues/12288)。[#13192](https://github.com/ClickHouse/ClickHouse/pull/13192) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 支持在紧凑 parts 中使用自定义编解码器。[#12183](https://github.com/ClickHouse/ClickHouse/pull/12183) ([Anton Popov](https://github.com/CurtizJ)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 默认为小型 parts 启用 compact parts。这会让高频插入的处理效率略有提升 (4..100 倍) 。[#11913](https://github.com/ClickHouse/ClickHouse/pull/11913) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 提升 `quantileTDigest` 的性能。此修复解决了 [#2668](https://github.com/ClickHouse/ClickHouse/issues/2668)。[#15542](https://github.com/ClickHouse/ClickHouse/pull/15542) ([Kruglov Pavel](https://github.com/Avogar)).
* 显著降低 AggregatingInOrderTransform/optimize\_aggregation\_in\_order 的内存使用量。[#15543](https://github.com/ClickHouse/ClickHouse/pull/15543) ([Azat Khuzhin](https://github.com/azat)).
* 加快 256 位乘法运算。[#15418](https://github.com/ClickHouse/ClickHouse/pull/15418) ([Artem Zuikov](https://github.com/4ertus2)).
* 以 (u)int64\_t 作为宽整数的基本类型，从而提升 256 位类型的性能。原先宽整数使用 8 位类型作为基本类型。[#14859](https://github.com/ClickHouse/ClickHouse/pull/14859) ([Artem Zuikov](https://github.com/4ertus2)).
* 明确使用临时磁盘来存储 vertical merge 的临时数据。[#15639](https://github.com/ClickHouse/ClickHouse/pull/15639) ([Grigory Pervakov](https://github.com/GrigoryPervakov)).
* 使用一次 S3 DeleteObjects 请求，而不是在循环中多次调用 DeleteObject。功能没有任何变化，因此现有测试 (如 integration/test\_log\_family\_s3) 已可覆盖。[#15238](https://github.com/ClickHouse/ClickHouse/pull/15238) ([ianton-ru](https://github.com/ianton-ru)).
* 修复 `DateTime <op> DateTime` 误选较慢通用实现的问题。此修复解决了 [#15153](https://github.com/ClickHouse/ClickHouse/issues/15153)。[#15178](https://github.com/ClickHouse/ClickHouse/pull/15178) ([Amos Bird](https://github.com/amosbird)).
* 提升 `FixedString` 类型 GROUP BY 键的性能。[#15034](https://github.com/ClickHouse/ClickHouse/pull/15034) ([Amos Bird](https://github.com/amosbird)).
* 启动 clickhouse-server 时仅对代码段执行 `mlock`。在此前版本中，所有映射区域都会被锁定在内存中，包括调试信息。调试信息通常会拆分到单独文件中，但如果没有拆分，就会额外增加 2..3 GiB 的内存使用量。[#14929](https://github.com/ClickHouse/ClickHouse/pull/14929) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 由于链接时优化，ClickHouse 二进制文件变得更小了。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 现在，生产环境中的 ClickHouse 构建使用 clang-11。[#15239](https://github.com/ClickHouse/ClickHouse/pull/15239) ([alesapin](https://github.com/alesapin)) 。
* 现在，CI 已改用 clang-11 构建 ClickHouse。[#14846](https://github.com/ClickHouse/ClickHouse/pull/14846) ([alesapin](https://github.com/alesapin)) 。
* 将二进制构建 (Linux、Darwin、AArch64、FreeDSD) 切换为 clang-11。[#15622](https://github.com/ClickHouse/ClickHouse/pull/15622) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 现在所有测试镜像均使用 `llvm-symbolizer-11`。[#15069](https://github.com/ClickHouse/ClickHouse/pull/15069) ([alesapin](https://github.com/alesapin)) 。
* 允许使用 llvm-11 构建。[#15366](https://github.com/ClickHouse/ClickHouse/pull/15366) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 将 `clang-tidy-10` 切换为 `clang-tidy-11`。[#14922](https://github.com/ClickHouse/ClickHouse/pull/14922) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 默认使用 LLVM 的实验性 pass manager。[#15608](https://github.com/ClickHouse/ClickHouse/pull/15608) ([Danila Kutenin](https://github.com/danlark1)) 。
* 不允许任何 C++ 翻译单元的构建时间超过 10 分钟，或占用超过 10 GB 的内存。这修复了 [#14925](https://github.com/ClickHouse/ClickHouse/issues/14925)。[#15060](https://github.com/ClickHouse/ClickHouse/pull/15060) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 通过将测试运行和 profile 运行拆分开来，使性能测试更加稳定，也更具代表性。[#15027](https://github.com/ClickHouse/ClickHouse/pull/15027) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 尝试提高性能测试的可靠性。实现方式是在运行过程中使用 `madvise` 动态重新映射进程的可执行内存，以启用透明大页——这可以减少 iTLB 未命中的次数，而这正是性能测试不稳定的主要来源。[#14685](https://github.com/ClickHouse/ClickHouse/pull/14685) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 转换为 Python 3。此更改解决了 [#14886](https://github.com/ClickHouse/ClickHouse/issues/14886)。[#15007](https://github.com/ClickHouse/ClickHouse/pull/15007) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果服务器未响应，则让功能测试尽早失败。这解决了 [#15262](https://github.com/ClickHouse/ClickHouse/issues/15262)。[#15267](https://github.com/ClickHouse/ClickHouse/pull/15267) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 允许在无配置文件的情况下运行 AArch64 版本的 clickhouse-server。这为 [#15174](https://github.com/ClickHouse/ClickHouse/issues/15174) 提供了便利。[#15266](https://github.com/ClickHouse/ClickHouse/pull/15266) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 改进了 CI Docker 镜像：去掉了 ZooKeeper，并将测试配置的安装统一为单个脚本。[#15215](https://github.com/ClickHouse/ClickHouse/pull/15215) ([alesapin](https://github.com/alesapin)).
* 修复快速测试脚本中 CMake 选项传递的问题。修复了 [#14711](https://github.com/ClickHouse/ClickHouse/issues/14711) 中的错误。[#15155](https://github.com/ClickHouse/ClickHouse/pull/15155) ([alesapin](https://github.com/alesapin)) 。
* 新增了一个脚本，只需一条命令即可执行硬件基准测试。[#15115](https://github.com/ClickHouse/ClickHouse/pull/15115) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 将大型测试 `test_dictionaries_all_layouts_and_sources` 拆分成多个较小的测试。[#15110](https://github.com/ClickHouse/ClickHouse/pull/15110) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 可能修复了 base64 在支持 AVX-512 的服务器上的 MSan 报告问题。此修复解决了 [#14006](https://github.com/ClickHouse/ClickHouse/issues/14006)。[#15030](https://github.com/ClickHouse/ClickHouse/pull/15030) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 对所有集成测试 \*.py 文件中的代码进行了重新格式化和清理。[#14864](https://github.com/ClickHouse/ClickHouse/pull/14864) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复了在 CI 中发现的 MaterializeMySQL 空事务不稳定的测试用例。[#14854](https://github.com/ClickHouse/ClickHouse/pull/14854) ([Winter Zhang](https://github.com/zhang2014)).
* 尝试稍微提升构建速度。[#14808](https://github.com/ClickHouse/ClickHouse/pull/14808) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 通过删除未使用的头文件，小幅提升构建速度。[#14714](https://github.com/ClickHouse/ClickHouse/pull/14714) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 OSX 上的构建失败。[#14761](https://github.com/ClickHouse/ClickHouse/pull/14761) ([Winter Zhang](https://github.com/zhang2014)) 。
* 如果在操作系统中检测到 ccache，则默认在 cmake 中启用。 [#14575](https://github.com/ClickHouse/ClickHouse/pull/14575) ([alesapin](https://github.com/alesapin)).
* 通过 ClickHouse 仓库控制 CI 构建配置。[#14547](https://github.com/ClickHouse/ClickHouse/pull/14547) ([alesapin](https://github.com/alesapin)) 。
* 在 CMake 文件中：- 将部分选项说明移到了上方的注释中。- 将 `option` 默认值中的 0 和 1 分别替换为 `OFF` 和 `ON`。- 为这些选项补充了一些说明以及文档链接。- 替换了 `FUZZER` 选项 (另有一个 `ENABLE_FUZZING` 选项也会启用相同功能) 。- 移除了 `ENABLE_GTEST_LIBRARY` 选项，因为已有 `ENABLE_TESTS`。完整说明见 PR：[#14711](https://github.com/ClickHouse/ClickHouse/pull/14711) ([Mike](https://github.com/myrrc)) 。
* 将二进制文件稍微缩小了一些 (调试版本约 50 MB) 。[#14555](https://github.com/ClickHouse/ClickHouse/pull/14555) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 在 ConfigProcessor 中使用 std::filesystem::path 拼接文件路径。[#14558](https://github.com/ClickHouse/ClickHouse/pull/14558) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复使用负大整数调用 `bitShiftLeft()` 时触发的调试断言。[#14697](https://github.com/ClickHouse/ClickHouse/pull/14697) ([Artem Zuikov](https://github.com/4ertus2)) 。

<div id="clickhouse-release-209">
  ## ClickHouse 发行版 20.9
</div>

<div id="clickhouse-release-v209711-stable-2020-12-07">
  ### ClickHouse 发行版 v20.9.7.11-稳定版本，2020-12-07
</div>

<div id="performance-improvement">
  #### 性能改进
</div>

* 修复了在大量 `MergeTree` 表上从 `Merge` 表读取数据时的性能问题。修复 [#7748](https://github.com/ClickHouse/ClickHouse/issues/7748)。[#16988](https://github.com/ClickHouse/ClickHouse/pull/16988) ([Anton Popov](https://github.com/CurtizJ)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 如果禁用了 `in_memory_parts_enable_wal`，则不要从 WAL 中恢复 parts。[#17802](https://github.com/ClickHouse/ClickHouse/pull/17802) ([detailyang](https://github.com/detailyang)) 。
* 修复了向 `Distributed` 表插入数据时因空间不足导致的段错误。[#17737](https://github.com/ClickHouse/ClickHouse/pull/17737) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 ClickHouse 无法重新建立与 MySQL 服务器连接的问题。[#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了在 Windows Subsystem for Linux 上运行 ClickHouse 时，在 `Atomic` 数据库中执行 `RENAME` 查询出现 `Function not implemented` error 的问题。修复了 [#17661](https://github.com/ClickHouse/ClickHouse/issues/17661)。[#17664](https://github.com/ClickHouse/ClickHouse/pull/17664) ([tavplubix](https://github.com/tavplubix)) 。
* 当 `clickhouse-client` 以交互模式执行多行查询时，单行注释会被错误地延伸到整个查询末尾。此修复解决了 [#13654](https://github.com/ClickHouse/ClickHouse/issues/13654)。[#17565](https://github.com/ClickHouse/ClickHouse/pull/17565) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个问题：在极少数情况下，服务器可能会停止接受连接。[#17542](https://github.com/ClickHouse/ClickHouse/pull/17542) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了这样一个问题：当对应的变更在其他副本上被终止时，ALTER 查询会挂起。修复 [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953)。[#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)).
* 修复了 ClickHouse 低估标记缓存大小时出现的问题。在存在大量带有标记的小文件时，可能会发生这种情况。[#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)) 。
* 修复了在启用设置 `optimize_redundant_functions_in_order_by` 时 `ORDER BY` 中的问题。[#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了因错误优化导致 `DISTINCT` 之后可能出现重复项的问题。修复 [#17294](https://github.com/ClickHouse/ClickHouse/issues/17294)。[#17296](https://github.com/ClickHouse/ClickHouse/pull/17296) ([li chengxiang](https://github.com/chengxianglibra))。[#17439](https://github.com/ClickHouse/ClickHouse/pull/17439) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复从带有 `LowCardinality` 类型的 `JOIN` 表读取数据时发生崩溃的问题。修复了 [#17228](https://github.com/ClickHouse/ClickHouse/issues/17228)。[#17397](https://github.com/ClickHouse/ClickHouse/pull/17397) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了子查询中存在 const 列时 Set 索引失效的问题。此修复解决了 [#17246](https://github.com/ClickHouse/ClickHouse/issues/17246)。[#17249](https://github.com/ClickHouse/ClickHouse/pull/17249) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了导致崩溃的 ColumnConst 比较问题。此修复解决了 [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088)。[#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了以下崩溃问题：当 `some_table` 是通过 `AS table_function()` 创建时，执行 `CREATE TABLE ... AS some_table` 查询会导致崩溃。修复 [#16944](https://github.com/ClickHouse/ClickHouse/issues/16944)。[#17072](https://github.com/ClickHouse/ClickHouse/pull/17072) ([tavplubix](https://github.com/tavplubix)).
* 修复了函数 fuzzBits 的问题，相关 issue：[#16980](https://github.com/ClickHouse/ClickHouse/issues/16980)。[#17051](https://github.com/ClickHouse/ClickHouse/pull/17051) ([hexiaoting](https://github.com/hexiaoting)) 。
* 避免在执行过程中可能被取消的远程查询 (例如带有 `LIMIT` 的查询) 出现不必要的网络错误。[#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)) 。
* 小幅优化。[#16866](https://github.com/ClickHouse/ClickHouse/pull/16866) ([tavplubix](https://github.com/tavplubix)) 。
* 通过 MySQL 协议为 INSERT 查询返回受影响的行数。此前 ClickHouse 总是返回 0，现已修复。修复了 [#16605](https://github.com/ClickHouse/ClickHouse/issues/16605)。[#16715](https://github.com/ClickHouse/ClickHouse/pull/16715) ([Winter Zhang](https://github.com/zhang2014)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 将内嵌的时区数据更新至 2020d 版本 (同时将 cctz 更新到最新的 master 分支) 。[#17204](https://github.com/ClickHouse/ClickHouse/pull/17204) ([filimonov](https://github.com/filimonov)).

<div id="clickhouse-release-v209614-stable-2020-11-20">
  ### ClickHouse 发行版 v20.9.6.14-稳定版本，2020-11-20
</div>

<div id="improvement">
  #### 改进
</div>

* 现在可以连接到需要 SNI 的 `clickhouse-server` 安全端点。当 `clickhouse-server` 位于 TLS 代理之后时，即可实现这一点。[#16938](https://github.com/ClickHouse/ClickHouse/pull/16938) ([filimonov](https://github.com/filimonov)).
* 条件聚合函数 (例如：`avgIf`、`sumIf`、`maxIf`) 在没有匹配行且使用 Nullable 参数时，应返回 `NULL`。[#13964](https://github.com/ClickHouse/ClickHouse/pull/13964) ([Winter Zhang](https://github.com/zhang2014)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复 `ON CLUSTER` 查询在非 leader 的 ReplicatedMergeTreeTables 上可能永久卡住的问题。[#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
* 发生错误时，重新解析 `format_avro_schema_registry_url` 的 IP 地址。[#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)).
* 修复在执行 `ALTER TABLE ... MODIFY COLUMN ... NewType` 后可能导致 server 崩溃的问题：当 `SELECT` 的 `WHERE` 表达式引用了正在修改的列，且 alter 尚未完成时，会触发该问题。[#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)).
* 安装脚本现在始终会在配置目录中创建子目录。这仅与使用自定义配置的 Docker 构建有关。[#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
* 修复带有 `ORDER BY` 的查询可能出现 `Illegal type of argument` 错误的问题。修复了 [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580)。[#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 如果没有数据写入 WriteBufferFromS3，则中止分段上传。[#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复在不带任何参数使用 `any` 时发生崩溃的问题。这是对 [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803) 的修复。cc @azat。[#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)).
* 修复在启用 `transform_null_in` 设置时，多个列和 Tuple 上的 `IN` 运算符问题。修复了 [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310)。[#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在 max\_threads>0 且 `ORDER BY` 中包含表达式时，optimize\_read\_in\_order/optimize\_aggregation\_in\_order 的问题。[#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 [#16574](https://github.com/ClickHouse/ClickHouse/issues/16574) 和 [#16231](https://github.com/ClickHouse/ClickHouse/issues/16231)，解决了使用带有 'if' 后缀的聚合函数时远程查询失败的问题。[#16610](https://github.com/ClickHouse/ClickHouse/pull/16610) ([Winter Zhang](https://github.com/zhang2014)).
* 查询在发生异常时会更快结束。如果发生异常，则取消远程副本上的执行。[#15578](https://github.com/ClickHouse/ClickHouse/pull/15578) ([Azat Khuzhin](https://github.com/azat)).

<div id="clickhouse-release-v20955-stable-2020-11-13">
  ### ClickHouse 发行版 v20.9.5.5-稳定版本，2020-11-13
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了一个罕见的静默崩溃问题：当 query profiler 开启，且 ClickHouse 安装在使用某个 glibc 版本的操作系统上时，该版本中某些函数的异步展开表 (据推测) 存在缺陷。此修复解决了 [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301)。此修复解决了 [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098)。[#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在，在从输入中解析 AVRO 时，会从类型中移除 LowCardinality。修复了 [#16188](https://github.com/ClickHouse/ClickHouse/issues/16188)。[#16521](https://github.com/ClickHouse/ClickHouse/pull/16521) ([Mike](https://github.com/myrrc)).
* 通过正确收缩 GTID 集合，修复了在使用 MySQL Master -> MySQL Slave -> ClickHouse MaterializeMySQL Engine，且 MySQL Slave 上启用了 `slave_parallel_worker` 时元数据快速增长的问题。此修复解决了 [#15951](https://github.com/ClickHouse/ClickHouse/issues/15951)。[#16504](https://github.com/ClickHouse/ClickHouse/pull/16504) ([TCeason](https://github.com/TCeason)).
* 修复了 Distributed 的 DROP TABLE 问题 (与 INSERT 存在竞争条件) 。[#16409](https://github.com/ClickHouse/ClickHouse/pull/16409) ([Azat Khuzhin](https://github.com/azat)).
* 修复了复制队列中超大条目的处理问题。当表结构特别大 (接近 1 MB) 时，ALTER 查询中可能会出现这类超大条目。此修复解决了 [#16307](https://github.com/ClickHouse/ClickHouse/issues/16307)。[#16332](https://github.com/ClickHouse/ClickHouse/pull/16332) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了行为不一致的问题：由于用于过滤的 Set 未创建，部分返回数据可能会被丢弃。[#16308](https://github.com/ClickHouse/ClickHouse/pull/16308) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了 MySQL 数据库的一个缺陷。当作为 database engine 使用的 MySQL 服务器不可用时，某些查询会抛出异常，因为它们会尝试从已停用的服务器获取表，而这其实没有必要。例如，查询 `SELECT ... FROM system.parts` 应当只适用于 MergeTree 表，完全不应访问 MySQL 数据库。[#16032](https://github.com/ClickHouse/ClickHouse/pull/16032) ([Kruglov Pavel](https://github.com/Avogar)).

<div id="clickhouse-release-v209476-stable-2020-10-29">
  ### ClickHouse 发行版 v20.9.4.76-稳定版本 (2020-10-29)
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了函数 `dictGet` 在异常情况下发生重复释放的问题。如果字典加载时出错，就可能出现这种情况。[#16429](https://github.com/ClickHouse/ClickHouse/pull/16429) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `group by` 键上配合 `totals`/`rollup`/`cube` 修饰符以及 min/max 函数使用时的问题。修复了 [#16393](https://github.com/ClickHouse/ClickHouse/issues/16393)。[#16397](https://github.com/ClickHouse/ClickHouse/pull/16397) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复在 prefer\_localhost\_replica=0 和 internal\_replication 条件下异步 Distributed INSERT 的问题。[#16358](https://github.com/ClickHouse/ClickHouse/pull/16358) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 TwoLevelStringHashTable 实现中的一处严重错误代码，该问题可能导致内存泄漏。我很惊讶这个 bug 居然能潜伏这么久.... [#16264](https://github.com/ClickHouse/ClickHouse/pull/16264) ([Amos Bird](https://github.com/amosbird)).
* 修复了内存可能不受限制约束而被过度分配的问题。此修复关闭了 [#14560](https://github.com/ClickHouse/ClickHouse/issues/14560)。[#16206](https://github.com/ClickHouse/ClickHouse/pull/16206) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `ReplicatedVersionedCollapsingMergeTree` 中 `ALTER MODIFY ... ORDER BY` 查询卡住的问题。此修复解决了 [#15980](https://github.com/ClickHouse/ClickHouse/issues/15980)。[#16011](https://github.com/ClickHouse/ClickHouse/pull/16011) ([alesapin](https://github.com/alesapin)) 。
* 修复了排序规则名称和字符集名称的解析器，并支持字符串类型的 `length = 0`。[#16008](https://github.com/ClickHouse/ClickHouse/pull/16008) ([Winter Zhang](https://github.com/zhang2014)) 。
* 支持在具有复杂键的字典中使用 direct 布局。[#16007](https://github.com/ClickHouse/ClickHouse/pull/16007) ([Anton Popov](https://github.com/CurtizJ)).
* 防止副本在一段时间未活动后发生复制错误时卡住 5–10 分钟。[#15987](https://github.com/ClickHouse/ClickHouse/pull/15987) ([filimonov](https://github.com/filimonov)).
* 修复了在向 MaterializedView 插入数据或从中查询时并发 drop 目标表而偶发的段错误问题 (适用于 Atomic 数据库引擎) 。[#15984](https://github.com/ClickHouse/ClickHouse/pull/15984) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 profile 在解析中的歧义：`CREATE USER ... SETTINGS profile readonly` 现在会被视为使用了一个名为 `readonly` 的 profile，而不是一个名为 `profile` 且带有 readonly 约束的设置。这修复了 [#15628](https://github.com/ClickHouse/ClickHouse/issues/15628)。[#15982](https://github.com/ClickHouse/ClickHouse/pull/15982) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了创建数据库失败时导致崩溃的问题。[#15954](https://github.com/ClickHouse/ClickHouse/pull/15954) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在表被并发重命名时，`DROP TABLE IF EXISTS` 因报出 `Table ... does not exist` 错误而失败的问题 (适用于 atomic 数据库引擎) 。修复了并发执行某些涉及多个表的 DDL 查询 (如 `DROP DATABASE` 和 `RENAME TABLE`) 时罕见的死锁问题。修复了在并发执行 `DROP/DETACH TABLE` 时，`DROP/DETACH DATABASE` 因报出 `Table ... does not exist` 而失败的问题。[#15934](https://github.com/ClickHouse/ClickHouse/pull/15934) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了当对 `Distributed` 表的查询包含 `WHERE`、`PREWHERE` 和 `GLOBAL IN` 时返回错误空结果的问题。修复 [#15792](https://github.com/ClickHouse/ClickHouse/issues/15792)。[#15933](https://github.com/ClickHouse/ClickHouse/pull/15933) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 RBAC 中可能发生的死锁。[#15875](https://github.com/ClickHouse/ClickHouse/pull/15875) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在执行 `ALTER MODIFY COLUMN` 查询后，再执行 `SELECT ... ORDER BY DESC` 查询时出现的 `Block structure mismatch` 异常。修复 [#15800](https://github.com/ClickHouse/ClickHouse/issues/15800)。[#15852](https://github.com/ClickHouse/ClickHouse/pull/15852) ([alesapin](https://github.com/alesapin)).
* 修复 MaterializeMySQL 中 `select count()` 结果不准确的问题。[#15767](https://github.com/ClickHouse/ClickHouse/pull/15767) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了某些仅选择虚拟列的查询场景。此前可能会抛出 `Not found column _nothing in block` 异常。修复了 [#12298](https://github.com/ClickHouse/ClickHouse/issues/12298)。[#15756](https://github.com/ClickHouse/ClickHouse/pull/15756) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `max_replicated_logs_to_keep` 设置默认值过低的问题，否则可能导致副本过于频繁地进入丢失状态。丢失副本的恢复流程也得到了改进，会选择最新的副本进行克隆。同时，不再从丢失的副本中移除旧的 parts，而是将其 detach。[#15701](https://github.com/ClickHouse/ClickHouse/pull/15701) ([tavplubix](https://github.com/tavplubix)).
* 修复错误 `Cannot add simple transform to empty Pipe`：当从 `Buffer` 表读取数据，且其结构与目标表不同时，如果目标表的查询结果为空，就可能触发该错误。修复 [#15529](https://github.com/ClickHouse/ClickHouse/issues/15529)。[#15662](https://github.com/ClickHouse/ClickHouse/pull/15662) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 S3 表函数中通配符相关的错误：未将 URL 中的区域应用到 S3 客户端配置中。[#15646](https://github.com/ClickHouse/ClickHouse/pull/15646) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 在分离只读表时，递减 `ReadonlyReplica` 指标。修复了 [#15598](https://github.com/ClickHouse/ClickHouse/issues/15598)。[#15592](https://github.com/ClickHouse/ClickHouse/pull/15592) ([sundyli](https://github.com/sundy-li)) 。
* 向 ReplicatedMergeTree 传递单个参数时，将抛出错误，而不是忽略它。[#15516](https://github.com/ClickHouse/ClickHouse/pull/15516) ([nvartolomei](https://github.com/nvartolomei)) 。

<div id="improvement">
  #### 改进
</div>

* 现在无论集群配置中的 `<internal_replication>` 设置如何，都允许执行 `ALTER ... ON CLUSTER` 查询。[#16075](https://github.com/ClickHouse/ClickHouse/pull/16075) ([alesapin](https://github.com/alesapin))。
* 创建表时，会展开 `ReplicatedMergeTree` 参数中的 `{database}`、`{table}` 和 `{uuid}` 宏。[#16160](https://github.com/ClickHouse/ClickHouse/pull/16160) ([tavplubix](https://github.com/tavplubix))。

<div id="clickhouse-release-v209345-stable-2020-10-09">
  ### ClickHouse 发行版 v20.9.3.45-稳定版本 (2020-10-09)
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在向 `MATERIALIZED VIEW` 插入数据时，如果 `MV` 的查询包含 `ARRAY JOIN`，可能出现的 `Cannot find column` 错误。[#15717](https://github.com/ClickHouse/ClickHouse/pull/15717) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 AMQP-CPP 中的竞态条件。[#15667](https://github.com/ClickHouse/ClickHouse/pull/15667) ([alesapin](https://github.com/alesapin)) 。
* 修复了查询计划中 `ReadFromStorage` 步骤的资源销毁顺序问题。该问题在极少数情况下可能会导致崩溃。可能与 [#15610](https://github.com/ClickHouse/ClickHouse/issues/15610) 有关。[#15645](https://github.com/ClickHouse/ClickHouse/pull/15645) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `VALUES`、`LIMIT` 或 `IN` 运算符右侧使用 `JSON*` 函数返回结果时出现的 `Element ... is not a constant expression` 错误。 [#15589](https://github.com/ClickHouse/ClickHouse/pull/15589) ([tavplubix](https://github.com/tavplubix)).
* 防止出现错误信息 `Could not calculate available disk space (statvfs), errno: 4, strerror: Interrupted system call`。此修复解决了 [#15541](https://github.com/ClickHouse/ClickHouse/issues/15541)。[#15557](https://github.com/ClickHouse/ClickHouse/pull/15557) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 显著减少 AggregatingInOrderTransform/optimize\_aggregation\_in\_order 的内存占用。 [#15543](https://github.com/ClickHouse/ClickHouse/pull/15543) ([Azat Khuzhin](https://github.com/azat)).
* 变更可能会在 `MOVE` 或 `REPLACE PARTITION` 之后，或在极少数情况下于 `DETACH` 或 `DROP PARTITION` 之后，因等待某个不存在的 part 而卡住。该问题已修复。[#15537](https://github.com/ClickHouse/ClickHouse/pull/15537) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了一个 bug：如果之前执行过使用相同 `pattern` 的 `LIKE`，`ILIKE` 运算符就会变为区分大小写。[#15536](https://github.com/ClickHouse/ClickHouse/pull/15536) ([alesapin](https://github.com/alesapin))。
* 修复了这样一种 `Missing columns` 错误：选择的数据中缺少某些列，而这些列又依赖于数据中同样缺失的其他列。修复 [#15530](https://github.com/ClickHouse/ClickHouse/issues/15530)。[#15532](https://github.com/ClickHouse/ClickHouse/pull/15532) ([alesapin](https://github.com/alesapin)).
* 修复了 DDLWorker 中事件订阅的一个 bug，该问题在极少数情况下可能导致 `ON CLUSTER` 查询挂起。此问题由 [#13450](https://github.com/ClickHouse/ClickHouse/issues/13450) 引入。[#15477](https://github.com/ClickHouse/ClickHouse/pull/15477) ([alesapin](https://github.com/alesapin)).
* 当 `boundingRatio` 聚合函数的第二个参数类型不正确时，会正确报告错误。[#15407](https://github.com/ClickHouse/ClickHouse/pull/15407) ([detailyang](https://github.com/detailyang)) 。
* 修复了一个 bug：像 `SELECT toStartOfDay(today())` 这样的查询会因提示 time\_zone 参数为空而执行失败。[#15319](https://github.com/ClickHouse/ClickHouse/pull/15319) ([Bharat Nallan](https://github.com/bharatnc)).
* 修复了在 MergeTree 表重命名和后台清理过程中出现的竞态条件。[#15304](https://github.com/ClickHouse/ClickHouse/pull/15304) ([alesapin](https://github.com/alesapin)) 。
* 修复了在启用 system.logs 时，服务器启动期间偶发的竞态条件。[#15300](https://github.com/ClickHouse/ClickHouse/pull/15300) ([alesapin](https://github.com/alesapin)).
* 修复 QueryLog 中的 MSan 报告：字段 `memory_usage` 可能会使用未初始化的内存。[#15258](https://github.com/ClickHouse/ClickHouse/pull/15258) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复将 `joinGet` 与 LowCardinality 类型一起使用时实例崩溃的问题。此修复解决了 [#15214](https://github.com/ClickHouse/ClickHouse/issues/15214)。[#15220](https://github.com/ClickHouse/ClickHouse/pull/15220) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了表引擎 `Buffer` 中的一个问题：执行 `ALTER` 查询后，无法将采用新结构的数据插入 `Buffer`。修复了 [#15117](https://github.com/ClickHouse/ClickHouse/issues/15117)。[#15192](https://github.com/ClickHouse/ClickHouse/pull/15192) ([alesapin](https://github.com/alesapin)) 。
* 调整 mysql 列定义数据包中 decimals 字段的大小。[#15152](https://github.com/ClickHouse/ClickHouse/pull/15152) ([maqroll](https://github.com/maqroll)) 。
* 修复了在 Mac OS 上通过 docker 运行 clickhouse-server 时，在 Atomic 数据库中执行 DDL 查询出现的 `Cannot rename ... errno: 22, strerror: Invalid argument` 错误。[#15024](https://github.com/ClickHouse/ClickHouse/pull/15024) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了子查询包含 finalizeAggregation 函数时谓词下推无法生效的问题。修复 [#14847](https://github.com/ClickHouse/ClickHouse/issues/14847)。[#14937](https://github.com/ClickHouse/ClickHouse/pull/14937) ([filimonov](https://github.com/filimonov)) 。
* 修复了一个问题：如果需要从 ZK 拉取配置文件 (使用 `from_zk` include 选项) ，服务器在启动时与 ZooKeeper 通信过程中可能会卡住。此修复解决了 [#14814](https://github.com/ClickHouse/ClickHouse/issues/14814)。[#14843](https://github.com/ClickHouse/ClickHouse/pull/14843) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。

<div id="improvement">
  #### 改进
</div>

* 现在支持通过 `ALTER` 查询修改 `VersionedCollapsingMergeTree` 的版本列类型。[#15442](https://github.com/ClickHouse/ClickHouse/pull/15442) ([alesapin](https://github.com/alesapin)) 。

<div id="clickhouse-release-v209220-2020-09-22">
  ### ClickHouse 发行版 v20.9.2.20，2020-09-22
</div>

<div id="backward-incompatible-change-2">
  #### 向后不兼容的变更
</div>

* 从低于 20.5 的版本升级时，如果执行滚动更新，且集群中同时存在 20.5 或更高版本以及低于 20.5 的版本，那么当旧版本的 ClickHouse 节点在已有较新版本节点运行的情况下重启时，可能会导致 `Part ... intersects previous part` 错误。为避免此错误，请先在集群所有节点上安装较新的 clickhouse-server 软件包，然后再进行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* 新增列转换器 `EXCEPT`、`REPLACE`、`APPLY`，可用于选定的列列表 (在 `*` 或 `COLUMNS(...)` 之后) 。例如，可以写成 `SELECT * EXCEPT(URL) REPLACE(number + 1 AS number)`。再如：`select * apply(length) apply(max) from wide_string_table`，用于找出所有字符串列的最大长度。[#14233](https://github.com/ClickHouse/ClickHouse/pull/14233) ([Amos Bird](https://github.com/amosbird)).
* 新增聚合函数 `rankCorr`，用于计算秩相关系数。[#11769](https://github.com/ClickHouse/ClickHouse/pull/11769) ([antikvist](https://github.com/antikvist)) [#14411](https://github.com/ClickHouse/ClickHouse/pull/14411) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 新增表函数 `view`，可将子查询转换为表对象，便于传递查询。例如，它可用于 remote/cluster 表函数。[#12567](https://github.com/ClickHouse/ClickHouse/pull/12567) ([Amos Bird](https://github.com/amosbird)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了一个问题：当 `ALTER UPDATE` 变更的赋值表达式中包含 Nullable 列和常量值 (如 `UPDATE x = 42`) 时，可能导致列值错误或发生段错误。修复了 [#13634](https://github.com/ClickHouse/ClickHouse/issues/13634)、[#14045](https://github.com/ClickHouse/ClickHouse/issues/14045)。[#14646](https://github.com/ClickHouse/ClickHouse/pull/14646) ([alesapin](https://github.com/alesapin)) 。
* 修复了因 Decimal 乘法结果错误导致结果列小数标度错误的问题。[#14603](https://github.com/ClickHouse/ClickHouse/pull/14603) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了 `Nullable` 列排序顺序不正确的问题。此修复解决了 [#14344](https://github.com/ClickHouse/ClickHouse/issues/14344)。[#14495](https://github.com/ClickHouse/ClickHouse/pull/14495) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了在索引分析中，当 `FixedString` 类型的主键与长度更短的字符串比较时，比较结果不一致的问题。此修复对应 [#14908](https://github.com/ClickHouse/ClickHouse/issues/14908)。[#15033](https://github.com/ClickHouse/ClickHouse/pull/15033) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了一个 bug：如果表中的某些分区仅包含一个分片，会导致合并任务分配错误。[#14444](https://github.com/ClickHouse/ClickHouse/pull/14444) ([alesapin](https://github.com/alesapin)) 。
* 如果用特意构造的参数调用函数 `bar`，则可能发生缓冲区溢出。此修复关闭了 [#13926](https://github.com/ClickHouse/ClickHouse/issues/13926)。[#15028](https://github.com/ClickHouse/ClickHouse/pull/15028) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 `system.asynchronous_metrics` 中按每个逻辑核心提供 CPU 频率信息。此修复解决了 [#14923](https://github.com/ClickHouse/ClickHouse/issues/14923)。[#14924](https://github.com/ClickHouse/ClickHouse/pull/14924) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了使用 `MaterializeMySQL` 数据库引擎时出现的 `.metadata.tmp File exists` 错误。[#14898](https://github.com/ClickHouse/ClickHouse/pull/14898) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了某些调用 `extractAllGroups` 函数时可能触发“超出内存限制”错误的问题。此项修复对应 [#13383](https://github.com/ClickHouse/ClickHouse/issues/13383)。[#14889](https://github.com/ClickHouse/ClickHouse/pull/14889) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复尝试向 StorageFile(fd) 执行 INSERT 时触发的 SIGSEGV。 [#14887](https://github.com/ClickHouse/ClickHouse/pull/14887) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 `SELECT` 查询中的一个罕见错误：当查询的列带有 `DEFAULT` 表达式，且该表达式依赖于另一列，而另一列同样带有 `DEFAULT`、未出现在 SELECT 查询中且磁盘上不存在时，就会触发该错误。部分修复了 [#14531](https://github.com/ClickHouse/ClickHouse/issues/14531)。[#14845](https://github.com/ClickHouse/ClickHouse/pull/14845) ([alesapin](https://github.com/alesapin)) 。
* 修复了对有符号类型进行收窄 `Int -> Int` 转换时单调性检测错误的问题。该问题可能导致查询结果不正确。此 bug 在 [#14513](https://github.com/ClickHouse/ClickHouse/issues/14513) 中被发现。[#14783](https://github.com/ClickHouse/ClickHouse/pull/14783) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了执行 `ALTER ... MODIFY QUERY` 时，materialized view 元数据中缺失默认数据库名称的问题。[#14664](https://github.com/ClickHouse/ClickHouse/pull/14664) ([tavplubix](https://github.com/tavplubix)).
* 修复了在涉及 LowCardinality 和 Nullable 类型时，函数 `has` 可能返回错误结果的问题。[#14591](https://github.com/ClickHouse/ClickHouse/pull/14591) ([Mike](https://github.com/myrrc)).
* 在为使用 ReplicatedMergeTree Engine 的表执行 CREATE 查询时，如果发生 ZooKeeper 异常，则会清理数据目录。[#14563](https://github.com/ClickHouse/ClickHouse/pull/14563) ([Bharat Nallan](https://github.com/bharatnc)).
* 修复了带有组合器 `-Resample` 的函数中偶发的段错误，该错误可能会在参数极大导致溢出时出现。 [#14562](https://github.com/ClickHouse/ClickHouse/pull/14562) ([Anton Popov](https://github.com/CurtizJ)).
* 检查 `topK` aggregate function 中的数组大小是否发生溢出。如果没有这项检查，用户可能会发送带有精心构造参数的查询，进而导致 server 崩溃。此修复关闭了 [#14452](https://github.com/ClickHouse/ClickHouse/issues/14452)。[#14467](https://github.com/ClickHouse/ClickHouse/pull/14467) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 将 SysVinit 的 restart/start/stop/reload 操作转发给 systemd (如果使用了 systemd) 。[#14460](https://github.com/ClickHouse/ClickHouse/pull/14460) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果异常发生在 `PipelineExecutor` 本身内部，则停止查询执行。这可以避免极少数情况下查询可能会挂起。[#14334](https://github.com/ClickHouse/ClickHouse/pull/14334) [#14402](https://github.com/ClickHouse/ClickHouse/pull/14402) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了对通过 `AS table_function` 创建的表执行 `ALTER` 查询时发生的崩溃问题。修复 [#14212](https://github.com/ClickHouse/ClickHouse/issues/14212)。[#14326](https://github.com/ClickHouse/ClickHouse/pull/14326) ([alesapin](https://github.com/alesapin)) 。
* 修复使用 REFRESH 命令执行 ALTER LIVE VIEW 查询时发生的异常。LIVE VIEW 是一项 Experimental 功能。[#14320](https://github.com/ClickHouse/ClickHouse/pull/14320) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复带有嵌套解释器的查询在使用 EXPLAIN PIPELINE graph=1 时 QueryPlan 的生命周期问题。[#14315](https://github.com/ClickHouse/ClickHouse/pull/14315) ([Azat Khuzhin](https://github.com/azat)).
* 改进了对 SSD cache 复杂键外部字典中 tuple 大小的检查。此修复解决了 [#13981](https://github.com/ClickHouse/ClickHouse/issues/13981)。[#14313](https://github.com/ClickHouse/ClickHouse/pull/14313) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 禁止在 `ALIAS` 列类型上使用 `CODEC`。修复了 [#13911](https://github.com/ClickHouse/ClickHouse/issues/13911)。[#14263](https://github.com/ClickHouse/ClickHouse/pull/14263) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复在非全局级别执行 GRANT ALL 语句时的问题。[#13987](https://github.com/ClickHouse/ClickHouse/pull/13987) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了 lambda 中 `arrayJoin()` 的捕获问题 (此前会抛出带有逻辑错误信息的异常) 。[#13792](https://github.com/ClickHouse/ClickHouse/pull/13792) ([Azat Khuzhin](https://github.com/azat)).

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增 `db-generator` 工具，可根据给定的 SELECT 查询生成随机数据库。当用户只提供不完整的错误报告时，它可用于帮助复现问题。[#14442](https://github.com/ClickHouse/ClickHouse/pull/14442) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) [#10973](https://github.com/ClickHouse/ClickHouse/issues/10973) ([ZeDRoman](https://github.com/ZeDRoman)).

<div id="improvement">
  #### 改进
</div>

* 允许在 Distributed 存储中使用多卷存储配置。[#14839](https://github.com/ClickHouse/ClickHouse/pull/14839) ([Pavel Kovalenko](https://github.com/Jokser)).
* 禁止在 `toStartOf*` 类函数中使用空的 `time_zone` 参数。[#14509](https://github.com/ClickHouse/ClickHouse/pull/14509) ([Bharat Nallan](https://github.com/bharatnc)).
* 对于 `SET @@var = value` 这类查询，MySQL 处理程序现在会返回 `OK`。此类语句会被忽略。之所以需要这样做，是因为某些 MySQL 驱动会在握手后发送 `SET @@` 查询进行初始化，参见 [https://github.com/ClickHouse/ClickHouse/issues/9336#issuecomment-686222422](https://github.com/ClickHouse/ClickHouse/issues/9336#issuecomment-686222422) 。[#14469](https://github.com/ClickHouse/ClickHouse/pull/14469) ([BohuTANG](https://github.com/BohuTANG)).
* 现在，如果生存时间 (TTL) 之前未被物化，则会在 merge 期间应用。[#14438](https://github.com/ClickHouse/ClickHouse/pull/14438) ([alesapin](https://github.com/alesapin)).
* 现在 `clickhouse-obfuscator` 已支持 UUID 类型，如 [#13163](https://github.com/ClickHouse/ClickHouse/issues/13163) 中所提议。[#14409](https://github.com/ClickHouse/ClickHouse/pull/14409) ([dimarub2000](https://github.com/dimarub2000)).
* 新增设置 `system_events_show_zero_values`，如 [#11384](https://github.com/ClickHouse/ClickHouse/issues/11384) 中所提议。[#14404](https://github.com/ClickHouse/ClickHouse/pull/14404) ([dimarub2000](https://github.com/dimarub2000)).
* 在 `MaterializeMySQL` 中将主键隐式转换为非 NULL (与 `MySQL` 相同) 。修复了 [#14114](https://github.com/ClickHouse/ClickHouse/issues/14114)。[#14397](https://github.com/ClickHouse/ClickHouse/pull/14397) ([Winter Zhang](https://github.com/zhang2014)).
* 将 boost multiprecision 中的宽整数 (256 位) 替换为 [https://github.com/cerevra/int](https://github.com/cerevra/int) 的实现。256 位整数仍处于 Experimental 阶段。[#14229](https://github.com/ClickHouse/ClickHouse/pull/14229) ([Artem Zuikov](https://github.com/4ertus2)).
* 为 `system.part_log` 中的 parts 添加默认压缩 编解码器，名称为 `default_compression_codec`。[#14116](https://github.com/ClickHouse/ClickHouse/pull/14116) ([alesapin](https://github.com/alesapin)).
* 为 `DateTime` 类型添加 precision 参数。这样可以使用 `DateTime` 名称来代替 `DateTime64`。[#13761](https://github.com/ClickHouse/ClickHouse/pull/13761) ([Winter Zhang](https://github.com/zhang2014)).
* 为 `Redis` 外部字典添加了 requirepass 认证。[#13688](https://github.com/ClickHouse/ClickHouse/pull/13688) ([Ivan Torgashov](https://github.com/it1804)).
* `RabbitMQ` 引擎改进：增加了 connection 和 channel 故障处理、正确的提交、insert 失败处理、改进了 exchange、增强了 queue 持久性和 queue 恢复能力，并新增了 queue 设置。修复了测试。[#12761](https://github.com/ClickHouse/ClickHouse/pull/12761) ([Kseniia Sumarokova](https://github.com/kssenii)).
* compact parts 现已支持自定义 编解码器。[#12183](https://github.com/ClickHouse/ClickHouse/pull/12183) ([Anton Popov](https://github.com/CurtizJ)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 在启用 `optimize_skip_unused_shards` 和 `optimize_distributed_group_by_sharding_key` 时，优化了对带有 GROUP BY sharding\_key 的 Distributed 表执行 LIMIT/LIMIT BY/ORDER BY 查询的性能。[#10373](https://github.com/ClickHouse/ClickHouse/pull/10373) ([Azat Khuzhin](https://github.com/azat)).
* 支持并行为多个 `JOIN` 和 `IN` 创建 Set。这可能会略微提升包含多个不同 `IN subquery` 表达式的查询性能。[#14412](https://github.com/ClickHouse/ClickHouse/pull/14412) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 通过为每个消费者分配独立线程来提升 Kafka 引擎性能。并为流式引擎 (如 Kafka) 单独提供线程池。[#13939](https://github.com/ClickHouse/ClickHouse/pull/13939) ([fastio](https://github.com/fastio)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 通过移除 `Functions` 中的调试信息，减小调试构建的二进制体积。这只对 Yandex 内部一个仍在使用非常老旧链接器的项目有必要。[#14549](https://github.com/ClickHouse/ClickHouse/pull/14549) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为使用 clang 11 进行构建做好准备。[#14455](https://github.com/ClickHouse/ClickHouse/pull/14455) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复回移脚本中的逻辑。此前版本中，任何颜色为 100% 红色的标签都会触发它，这很奇怪。[#14433](https://github.com/ClickHouse/ClickHouse/pull/14433) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 集成测试使用默认的基础配置。对于实例，所有配置变更都通过 `main_configs`、`user_configs` 和 `dictionaries` 参数显式指定。[#13647](https://github.com/ClickHouse/ClickHouse/pull/13647) ([Ilya Yatsishin](https://github.com/qoega)).

<div id="clickhouse-release-208">
  ## ClickHouse 发行版 20.8
</div>

<div id="clickhouse-release-v208122-lts-2021-01-16">
  ### ClickHouse 发行版 v20.8.12.2-lts，2021-01-16
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了带一元函数和 Nullable 类型的 \*If 组合器问题。 [#18806](https://github.com/ClickHouse/ClickHouse/pull/18806) ([Azat Khuzhin](https://github.com/azat)).
* 限制从 wide 到 compact parts 的合并；在 vertical merge 情况下，这会导致结果 part 损坏。 [#18381](https://github.com/ClickHouse/ClickHouse/pull/18381) ([Anton Popov](https://github.com/CurtizJ)).

<div id="clickhouse-release-v2081117-lts-2020-12-25">
  ### ClickHouse 发行版 v20.8.11.17-lts，2020-12-25
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 在合并期间禁用使用 AIO 进行写入，因为这在极少数情况下可能会导致合并时主键列数据损坏。[#18481](https://github.com/ClickHouse/ClickHouse/pull/18481) ([alesapin](https://github.com/alesapin)).
* 修复了在执行 `toType(...)` 函数 (`toDate`、`toUInt32` 等) 且参数类型为 `Nullable(String)` 时出现的 `value is too short` 错误。现在，这类函数在发生解析错误时会返回 `NULL`，而不是抛出异常。修复了 [#7673](https://github.com/ClickHouse/ClickHouse/issues/7673)。[#18445](https://github.com/ClickHouse/ClickHouse/pull/18445) ([tavplubix](https://github.com/tavplubix)).
* 修复了在使用两级聚合时，带有 `Distinct` 组合器的聚合函数可能崩溃的问题。修复了 [#17682](https://github.com/ClickHouse/ClickHouse/issues/17682)。[#18365](https://github.com/ClickHouse/ClickHouse/pull/18365) ([Anton Popov](https://github.com/CurtizJ)).

<div id="clickhouse-release-v2081013-lts-2020-12-24">
  ### ClickHouse 发行版 v20.8.10.13-lts，2020-12-24
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 当使用数值大于 2^32 的 `logger.size` 参数配置服务器日志轮转时，日志无法被正确轮转。[#17905](https://github.com/ClickHouse/ClickHouse/pull/17905) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了 MergeTreeWriterSettings 中错误地用 `min_compress_block_size` 初始化 `max_compress_block_size` 的问题。[#17833](https://github.com/ClickHouse/ClickHouse/pull/17833) ([flynn](https://github.com/ucasFL)).
* 修复了 ClickHouse 无法恢复与 MySQL 服务器的连接的问题。 [#17681](https://github.com/ClickHouse/ClickHouse/pull/17681) ([Alexander Kazakov](https://github.com/Akazz)).
* 修复了这样一个问题：当对应的变更在另一副本上被终止时，`ALTER` 查询会挂起。此修复解决了 [#16953](https://github.com/ClickHouse/ClickHouse/issues/16953)。[#17499](https://github.com/ClickHouse/ClickHouse/pull/17499) ([alesapin](https://github.com/alesapin)).
* 修复了一个在 ClickHouse 低估标记缓存大小时会出现的错误。当存在大量带有标记的很小文件时，可能会出现该问题。[#17496](https://github.com/ClickHouse/ClickHouse/pull/17496) ([alesapin](https://github.com/alesapin)).
* 修复了启用设置 `optimize_redundant_functions_in_order_by` 时 `ORDER BY` 的相关问题。[#17471](https://github.com/ClickHouse/ClickHouse/pull/17471) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了会导致崩溃的 `ColumnConst` 比较问题。此修复解决了 [#17088](https://github.com/ClickHouse/ClickHouse/issues/17088)。[#17135](https://github.com/ClickHouse/ClickHouse/pull/17135) ([Amos Bird](https://github.com/amosbird)).
* 修复了一个问题：对于非 leader 的 ReplicatedMergeTree 表，`ON CLUSTER` 查询可能会一直挂起。[#17089](https://github.com/ClickHouse/ClickHouse/pull/17089) ([alesapin](https://github.com/alesapin)).
* 避免在执行过程中可能被取消的远程查询 (例如带有 `LIMIT` 的查询) 出现不必要的网络错误。[#17006](https://github.com/ClickHouse/ClickHouse/pull/17006) ([Azat Khuzhin](https://github.com/azat)).
* 发生错误时，重新解析 `format_avro_schema_registry_url` 的 IP 地址。[#16985](https://github.com/ClickHouse/ClickHouse/pull/16985) ([filimonov](https://github.com/filimonov)) 。
* 修复了这样一个可能导致 server 崩溃的问题：在 `ALTER TABLE ... MODIFY COLUMN ... NewType` 尚未完成时，如果对正在修改的列执行包含 `WHERE` expression 的 `SELECT`，就可能触发该问题。[#16968](https://github.com/ClickHouse/ClickHouse/pull/16968) ([Amos Bird](https://github.com/amosbird)).
* 安装脚本现在应始终在配置目录中创建子目录。这仅适用于使用自定义配置的 Docker 构建。[#16936](https://github.com/ClickHouse/ClickHouse/pull/16936) ([filimonov](https://github.com/filimonov)).
* 修复了带有 `ORDER BY` 的查询中可能出现的 `Illegal type of argument` 错误。修复 [#16580](https://github.com/ClickHouse/ClickHouse/issues/16580)。[#16928](https://github.com/ClickHouse/ClickHouse/pull/16928) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 如果未向 WriteBufferFromS3 写入任何数据，则中止分段上传。[#16840](https://github.com/ClickHouse/ClickHouse/pull/16840) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了在 `any` 不带任何参数时会发生崩溃的问题。此修复对应 [#16803](https://github.com/ClickHouse/ClickHouse/issues/16803)。[#16826](https://github.com/ClickHouse/ClickHouse/pull/16826) ([Amos Bird](https://github.com/amosbird)).
* 修复了在启用 `transform_null_in` 设置时，`IN` 运算符对多列和元组处理不正确的问题。修复了 [#15310](https://github.com/ClickHouse/ClickHouse/issues/15310)。[#16722](https://github.com/ClickHouse/ClickHouse/pull/16722) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在 max\_threads > 0 且 ORDER BY 中包含表达式时，`optimize_read_in_order/optimize_aggregation_in_order` 的行为不一致问题。 [#16637](https://github.com/ClickHouse/ClickHouse/pull/16637) ([Azat Khuzhin](https://github.com/azat)).
* 修复了当查询包含 `ARRAY JOIN` 时，查询优化导致结果错误的问题。[#17887](https://github.com/ClickHouse/ClickHouse/pull/17887) ([sundyli](https://github.com/sundy-li)).
* 发生异常时，查询会更快结束。如果发生异常，则取消远程副本上的执行。[#15578](https://github.com/ClickHouse/ClickHouse/pull/15578) ([Azat Khuzhin](https://github.com/azat)).

<div id="clickhouse-release-v20866-lts-2020-11-13">
  ### ClickHouse 发行版 v20.8.6.6-lts，2020-11-13
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了一个罕见的静默崩溃问题：当 query profiler 开启，且 ClickHouse 安装在 glibc 版本对某些函数的异步回溯表 (据称) 存在缺陷的操作系统上时，可能会出现此问题。此修复解决了 [#15301](https://github.com/ClickHouse/ClickHouse/issues/15301)。此修复解决了 [#13098](https://github.com/ClickHouse/ClickHouse/issues/13098)。[#16846](https://github.com/ClickHouse/ClickHouse/pull/16846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在在解析输入的 AVRO 数据时，会从类型中移除 LowCardinality。修复了 [#16188](https://github.com/ClickHouse/ClickHouse/issues/16188)。[#16521](https://github.com/ClickHouse/ClickHouse/pull/16521) ([Mike](https://github.com/myrrc)).
* 通过正确缩减 GTID 集合，修复了在使用 MySQL Master -> MySQL Slave -> ClickHouse MaterializeMySQL Engine，且在 MySQL Slave 上启用 `slave_parallel_worker` 时元数据快速增长的问题。此修复解决了 [#15951](https://github.com/ClickHouse/ClickHouse/issues/15951)。[#16504](https://github.com/ClickHouse/ClickHouse/pull/16504) ([TCeason](https://github.com/TCeason)).
* 修复了 Distributed 的 DROP TABLE 问题 (与 INSERT 存在竞态) 。[#16409](https://github.com/ClickHouse/ClickHouse/pull/16409) ([Azat Khuzhin](https://github.com/azat)).
* 修复了复制队列中超大条目的处理问题。如果表结构特别大 (接近 1 MB) ，ALTER 查询中可能会出现超大条目。此修复解决了 [#16307](https://github.com/ClickHouse/ClickHouse/issues/16307)。[#16332](https://github.com/ClickHouse/ClickHouse/pull/16332) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了这样一种不一致行为：由于用于过滤的 Set 未创建，返回数据中的一部分可能会被丢弃。[#16308](https://github.com/ClickHouse/ClickHouse/pull/16308) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了 MySQL 数据库的一个问题。当用作数据库引擎的 MySQL 服务器不可用时，某些查询会抛出异常，因为它们会尝试从已禁用的服务器获取表，而这其实并不必要。例如，查询 `SELECT ... FROM system.parts` 应当只对 MergeTree 表生效，完全不应访问 MySQL 数据库。[#16032](https://github.com/ClickHouse/ClickHouse/pull/16032) ([Kruglov Pavel](https://github.com/Avogar)).

<div id="clickhouse-release-v208545-lts-2020-10-29">
  ### ClickHouse 发行版 v20.8.5.45-lts，2020-10-29
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了函数 `dictGet` 在发生异常时可能出现的重复释放问题。如果字典加载失败，就可能发生这种情况。[#16429](https://github.com/ClickHouse/ClickHouse/pull/16429) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在 `group by` 键上使用 `totals`/`rollup`/`cube` 修饰符，以及对 `group by` 键应用 `min`/`max` 函数时的问题。修复了 [#16393](https://github.com/ClickHouse/ClickHouse/issues/16393)。[#16397](https://github.com/ClickHouse/ClickHouse/pull/16397) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复在 prefer\_localhost\_replica=0 和 internal\_replication 下异步 Distributed INSERT 的问题。[#16358](https://github.com/ClickHouse/ClickHouse/pull/16358) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在使用字符串键进行 `GROUP BY` 时可能出现的内存泄漏问题，该问题是由于 `TwoLevelStringHashTable` 实现中的错误导致的。[#16264](https://github.com/ClickHouse/ClickHouse/pull/16264) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了无论限制如何，内存都可能被过度分配的问题。此修复关闭了 [#14560](https://github.com/ClickHouse/ClickHouse/issues/14560)。[#16206](https://github.com/ClickHouse/ClickHouse/pull/16206) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `ReplicatedVersionedCollapsingMergeTree` 中 `ALTER MODIFY ... ORDER BY` 查询挂起的问题。此修复对应 [#15980](https://github.com/ClickHouse/ClickHouse/issues/15980)。[#16011](https://github.com/ClickHouse/ClickHouse/pull/16011) ([alesapin](https://github.com/alesapin)) 。
* 修复 collate 名称和字符集名称的解析，并支持字符串类型的 `length = 0`。[#16008](https://github.com/ClickHouse/ClickHouse/pull/16008) ([Winter Zhang](https://github.com/zhang2014)) 。
* 允许具有复杂键的字典使用 direct 布局。[#16007](https://github.com/ClickHouse/ClickHouse/pull/16007) ([Anton Popov](https://github.com/CurtizJ)).
* 防止副本在一段时间未活动后发生复制错误时卡住 5-10 分钟。[#15987](https://github.com/ClickHouse/ClickHouse/pull/15987) ([filimonov](https://github.com/filimonov)).
* 修复在向 MaterializedView 插入数据或从中查询时，并发删除目标表 (适用于 Atomic database engine) 导致的罕见段错误。[#15984](https://github.com/ClickHouse/ClickHouse/pull/15984) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 settings profile 解析中的歧义：`CREATE USER ... SETTINGS profile readonly` 现在会被视为使用名为 `readonly` 的 profile，而不是名为 `profile` 且带有 readonly 限制的设置。这修复了 [#15628](https://github.com/ClickHouse/ClickHouse/issues/15628)。[#15982](https://github.com/ClickHouse/ClickHouse/pull/15982) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了数据库创建失败时导致崩溃的问题。[#15954](https://github.com/ClickHouse/ClickHouse/pull/15954) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在并发重命名表时，`DROP TABLE IF EXISTS` 因报出 `Table ... does not exist` 错误而失败的问题 (针对 Atomic 数据库引擎) 。修复了并发执行某些涉及多个表的 DDL 查询 (如 `DROP DATABASE` 和 `RENAME TABLE`) 时罕见的死锁问题。修复了在并发执行 `DROP/DETACH TABLE` 时，`DROP/DETACH DATABASE` 因报出 `Table ... does not exist` 而失败的问题。[#15934](https://github.com/ClickHouse/ClickHouse/pull/15934) ([tavplubix](https://github.com/tavplubix)).
* 修复了在查询包含 `WHERE`、`PREWHERE` 和 `GLOBAL IN` 时，从 `Distributed` 表查询会错误返回空结果的问题。修复 [#15792](https://github.com/ClickHouse/ClickHouse/issues/15792)。[#15933](https://github.com/ClickHouse/ClickHouse/pull/15933) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 RBAC 中可能的死锁。[#15875](https://github.com/ClickHouse/ClickHouse/pull/15875) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在执行 `ALTER MODIFY COLUMN` 查询后，再执行 `SELECT ... ORDER BY DESC` 查询时出现的 `Block structure mismatch` 异常。修复 [#15800](https://github.com/ClickHouse/ClickHouse/issues/15800)。[#15852](https://github.com/ClickHouse/ClickHouse/pull/15852) ([alesapin](https://github.com/alesapin)).
* 修复了某些仅选择虚拟列的查询场景。此前可能会抛出 `Not found column _nothing in block` 异常。修复了 [#12298](https://github.com/ClickHouse/ClickHouse/issues/12298)。[#15756](https://github.com/ClickHouse/ClickHouse/pull/15756) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在向 `MATERIALIZED VIEW` 插入数据时可能出现的 `Cannot find column` 错误：如果 `MV` 的查询包含 `ARRAY JOIN`，就会触发该问题。[#15717](https://github.com/ClickHouse/ClickHouse/pull/15717) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了设置 `max_replicated_logs_to_keep` 的默认值过低的问题，这可能导致副本过于频繁地丢失。通过选择最新的副本进行克隆，改进了丢失副本的恢复流程。同时，不再从丢失的副本中删除旧的 parts，而是将其 detach。[#15701](https://github.com/ClickHouse/ClickHouse/pull/15701) ([tavplubix](https://github.com/tavplubix)).
* 修复错误 `Cannot add simple transform to empty Pipe`：从 `Buffer` 表读取数据时，如果其结构与目标表不同，且目标表的查询结果为空，就可能触发该错误。修复了 [#15529](https://github.com/ClickHouse/ClickHouse/issues/15529)。[#15662](https://github.com/ClickHouse/ClickHouse/pull/15662) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 S3 表函数中通配符相关的 bug，未将 URL 中的区域应用到 S3 客户端配置的问题。[#15646](https://github.com/ClickHouse/ClickHouse/pull/15646) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 在分离只读表时，减少 `ReadonlyReplica` 指标值。此项修复解决了 [#15598](https://github.com/ClickHouse/ClickHouse/issues/15598)。[#15592](https://github.com/ClickHouse/ClickHouse/pull/15592) ([sundyli](https://github.com/sundy-li)) 。
* 当向 ReplicatedMergeTree 传递单个参数时，会抛出错误，而不是将其忽略。[#15516](https://github.com/ClickHouse/ClickHouse/pull/15516) ([nvartolomei](https://github.com/nvartolomei)) 。

<div id="improvement">
  #### 改进
</div>

* 现在，无论集群配置中的 `<internal_replication>` 设置为何，都可以执行 `ALTER ... ON CLUSTER` 查询。[#16075](https://github.com/ClickHouse/ClickHouse/pull/16075) ([alesapin](https://github.com/alesapin)).
* 在创建表时，会展开 `ReplicatedMergeTree` 参数中的 `{database}`、`{table}` 和 `{uuid}` 宏。[#16159](https://github.com/ClickHouse/ClickHouse/pull/16159) ([tavplubix](https://github.com/tavplubix)).

<div id="clickhouse-release-v208411-lts-2020-10-09">
  ### ClickHouse 发行版 v20.8.4.11-lts，2020-10-09
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复查询计划中 `ReadFromStorage` 步骤的资源销毁顺序问题。极少数情况下，这可能会导致崩溃。可能与 [#15610](https://github.com/ClickHouse/ClickHouse/issues/15610) 有关。[#15645](https://github.com/ClickHouse/ClickHouse/pull/15645) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `VALUES`、`LIMIT` 或 `IN` 运算符右侧使用 `JSON*` 函数结果时出现的 `Element ... is not a constant expression` 错误。[#15589](https://github.com/ClickHouse/ClickHouse/pull/15589) ([tavplubix](https://github.com/tavplubix)) 。
* 防止出现错误信息 `Could not calculate available disk space (statvfs), errno: 4, strerror: Interrupted system call`。此修复解决了 [#15541](https://github.com/ClickHouse/ClickHouse/issues/15541)。[#15557](https://github.com/ClickHouse/ClickHouse/pull/15557) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 显著降低 AggregatingInOrderTransform/optimize\_aggregation\_in\_order 的内存占用。[#15543](https://github.com/ClickHouse/ClickHouse/pull/15543) ([Azat Khuzhin](https://github.com/azat)) 。
* 执行 `MOVE` 或 `REPLACE PARTITION` 后，变更可能会因等待某个不存在的数据分片而卡住；极少数情况下，在 `DETACH` 或 `DROP PARTITION` 后也会出现这种情况。现已修复。[#15537](https://github.com/ClickHouse/ClickHouse/pull/15537) ([tavplubix](https://github.com/tavplubix)).
* 修复了一个问题：如果此前执行过使用相同模式的 `LIKE`，`ILIKE` 运算符就会失去大小写不敏感特性。[#15536](https://github.com/ClickHouse/ClickHouse/pull/15536) ([alesapin](https://github.com/alesapin)) 。
* 修复了这样一种 `Missing columns` 错误：选择的数据中不存在某些列，而这些列又依赖于数据中其他同样不存在的列时，就会出现该错误。修复 [#15530](https://github.com/ClickHouse/ClickHouse/issues/15530)。[#15532](https://github.com/ClickHouse/ClickHouse/pull/15532) ([alesapin](https://github.com/alesapin)).
* 修复了 DDLWorker 中事件订阅的一个 bug，该问题在极少数情况下可能导致 `ON CLUSTER` 中的查询挂起。该问题是在 [#13450](https://github.com/ClickHouse/ClickHouse/issues/13450) 中引入的。[#15477](https://github.com/ClickHouse/ClickHouse/pull/15477) ([alesapin](https://github.com/alesapin)) 。
* 当 `boundingRatio` aggregate function 的第二个参数类型错误时，会正确报告 error。[#15407](https://github.com/ClickHouse/ClickHouse/pull/15407) ([detailyang](https://github.com/detailyang)).
* 修复了在 MergeTree 表重命名和后台清理过程中发生的竞态条件。[#15304](https://github.com/ClickHouse/ClickHouse/pull/15304) ([alesapin](https://github.com/alesapin)).
* 修复了在启用 system.logs 时服务器启动期间偶发的竞态条件问题。 [#15300](https://github.com/ClickHouse/ClickHouse/pull/15300) ([alesapin](https://github.com/alesapin)).
* 修复 QueryLog 中的 MSan 报告。字段 `memory_usage` 可能会使用未初始化的内存。[#15258](https://github.com/ClickHouse/ClickHouse/pull/15258) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在使用 `joinGet` 和 LowCardinality 类型时实例崩溃的问题。此修复解决了 [#15214](https://github.com/ClickHouse/ClickHouse/issues/15214)。[#15220](https://github.com/ClickHouse/ClickHouse/pull/15220) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了表引擎 `Buffer` 中的一个错误：在执行 `ALTER` 查询后，无法将采用新结构的数据插入 `Buffer`。修复了 [#15117](https://github.com/ClickHouse/ClickHouse/issues/15117)。[#15192](https://github.com/ClickHouse/ClickHouse/pull/15192) ([alesapin](https://github.com/alesapin)).
* 调整 MySQL 列定义数据包中 decimals 字段的大小。[#15152](https://github.com/ClickHouse/ClickHouse/pull/15152) ([maqroll](https://github.com/maqroll)) 。
* 我们已经在 String 和 FixedString 之间采用了填充比较 ([https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/FunctionsComparison.h#L333](https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/FunctionsComparison.h#L333)) 。此 PR 将相同的逻辑应用于 field 比较，从而修复了将 FixedString 用作主键时的问题。此修复对应 [#14908](https://github.com/ClickHouse/ClickHouse/issues/14908)。[#15033](https://github.com/ClickHouse/ClickHouse/pull/15033) ([Amos Bird](https://github.com/amosbird)) 。
* 如果使用精心构造的参数调用函数 `bar`，则可能发生缓冲区溢出。此修复已关闭 [#13926](https://github.com/ClickHouse/ClickHouse/issues/13926)。[#15028](https://github.com/ClickHouse/ClickHouse/pull/15028) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在 Mac OS 上的 Docker 中运行 clickhouse-server 时，在 Atomic 数据库执行 DDL 查询时出现的 `Cannot rename ... errno: 22, strerror: Invalid argument` 错误。[#15024](https://github.com/ClickHouse/ClickHouse/pull/15024) ([tavplubix](https://github.com/tavplubix)).
* 现在，设置 `number_of_free_entries_in_pool_to_execute_mutation` 和 `number_of_free_entries_in_pool_to_lower_max_size_of_merge` 可以设为与 `background_pool_size` 相同的值。[#14975](https://github.com/ClickHouse/ClickHouse/pull/14975) ([alesapin](https://github.com/alesapin)) 。
* 修复了子查询包含 finalizeAggregation 函数时谓词下推无法生效的问题。修复 [#14847](https://github.com/ClickHouse/ClickHouse/issues/14847)。[#14937](https://github.com/ClickHouse/ClickHouse/pull/14937) ([filimonov](https://github.com/filimonov)) 。
* 在 `system.asynchronous_metrics` 中发布每个逻辑核心的 CPU 频率。这修复了 [#14923](https://github.com/ClickHouse/ClickHouse/issues/14923)。[#14924](https://github.com/ClickHouse/ClickHouse/pull/14924) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了使用 `MaterializeMySQL` 数据库引擎时出现 `.metadata.tmp File exists` 错误的问题。[#14898](https://github.com/ClickHouse/ClickHouse/pull/14898) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了一个问题：如果需要从 ZK 拉取配置文件 (使用 `from_zk` include 选项) ，服务器在启动时与 ZooKeeper 通信时可能会卡住。此项修复对应 [#14814](https://github.com/ClickHouse/ClickHouse/issues/14814)。[#14843](https://github.com/ClickHouse/ClickHouse/pull/14843) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了有符号类型在进行收窄 `Int -> Int` cast 时单调性检测错误的问题。该问题可能导致查询结果错误。此 bug 在 [#14513](https://github.com/ClickHouse/ClickHouse/issues/14513) 中披露。[#14783](https://github.com/ClickHouse/ClickHouse/pull/14783) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `Nullable` 列排序顺序错误的问题。此修复解决了 [#14344](https://github.com/ClickHouse/ClickHouse/issues/14344)。[#14495](https://github.com/ClickHouse/ClickHouse/pull/14495) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。

<div id="improvement">
  #### 改进
</div>

* 现在可以通过 `ALTER` 查询修改 `VersionedCollapsingMergeTree` 的版本列类型。[#15442](https://github.com/ClickHouse/ClickHouse/pull/15442) ([alesapin](https://github.com/alesapin)) 。

<div id="clickhouse-release-v208318-stable-2020-09-18">
  ### ClickHouse 发行版 v20.8.3.18-稳定版本，2020-09-18
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了某些对 `extractAllGroups` 函数的调用可能触发“Memory limit exceeded”错误的问题。此修复解决了 [#13383](https://github.com/ClickHouse/ClickHouse/issues/13383)。[#14889](https://github.com/ClickHouse/ClickHouse/pull/14889) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了尝试向 StorageFile(fd) 执行 `INSERT` 时出现的 SIGSEGV 问题。[#14887](https://github.com/ClickHouse/ClickHouse/pull/14887) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 `SELECT` 查询中的一个罕见错误：当被查询的列带有依赖另一列的 `DEFAULT` 表达式，而该另一列同样带有 `DEFAULT`、未出现在 select 查询中且磁盘上也不存在时，就会出现该错误。部分修复了 [#14531](https://github.com/ClickHouse/ClickHouse/issues/14531)。[#14845](https://github.com/ClickHouse/ClickHouse/pull/14845) ([alesapin](https://github.com/alesapin)).
* 修复了执行 `ALTER ... MODIFY QUERY` 时，materialized view 元数据中缺少默认数据库名称的问题。[#14664](https://github.com/ClickHouse/ClickHouse/pull/14664) ([tavplubix](https://github.com/tavplubix)).
* 修复了一个问题：当 `ALTER UPDATE` 变更的赋值表达式中使用 Nullable 列和常量值 (例如 `UPDATE x = 42`) 时，可能导致列值错误或发生段错误。修复了 [#13634](https://github.com/ClickHouse/ClickHouse/issues/13634)、[#14045](https://github.com/ClickHouse/ClickHouse/issues/14045)。[#14646](https://github.com/ClickHouse/ClickHouse/pull/14646) ([alesapin](https://github.com/alesapin)).
* 修复了 Decimal 乘法结果错误的问题，其原因是结果列的 decimal 标度不正确。[#14603](https://github.com/ClickHouse/ClickHouse/pull/14603) ([Artem Zuikov](https://github.com/4ertus2)).
* 新增了一个检查器，因为无论调用 `lc->isNullable()` 还是调用 `ls->getDictionaryPtr()->isNullable()`，都无法返回正确结果。[#14591](https://github.com/ClickHouse/ClickHouse/pull/14591) ([myrrc](https://github.com/myrrc)).
* 修复了为 StorageReplicatedMergeTree engine 执行 CreateQuery 时，如果发生 Zookeeper 异常，未清理数据目录的问题。[#14563](https://github.com/ClickHouse/ClickHouse/pull/14563) ([Bharat Nallan](https://github.com/bharatnc)).
* 修复了带有 -Resample 组合器的函数中罕见的段错误，这种情况可能在参数极大导致溢出时出现。[#14562](https://github.com/ClickHouse/ClickHouse/pull/14562) ([Anton Popov](https://github.com/CurtizJ)).

<div id="improvement">
  #### 改进
</div>

* 在存在进行中的 S3 请求时，加快服务器关闭过程。 [#14858](https://github.com/ClickHouse/ClickHouse/pull/14858) ([Pavel Kovalenko](https://github.com/Jokser)).
* 允许在 Distributed 存储中使用多卷存储配置。 [#14839](https://github.com/ClickHouse/ClickHouse/pull/14839) ([Pavel Kovalenko](https://github.com/Jokser)).
* 在存在进行中的 S3 请求时，加快服务器关闭过程。 [#14496](https://github.com/ClickHouse/ClickHouse/pull/14496) ([Pavel Kovalenko](https://github.com/Jokser)).
* 支持在 compact parts 中使用自定义编解码器。 [#12183](https://github.com/ClickHouse/ClickHouse/pull/12183) ([Anton Popov](https://github.com/CurtizJ)).

<div id="clickhouse-release-v20823-stable-2020-09-08">
  ### ClickHouse 发行版 v20.8.2.3-稳定版本，2020-09-08
</div>

<div id="backward-incompatible-change-2">
  #### 向后不兼容的变更
</div>

* 现在，`OPTIMIZE FINAL` 查询不会再为创建生存时间 (TTL) 之前添加的 parts 重新计算 TTL。请使用一次 `ALTER TABLE ... MATERIALIZE TTL` 来计算它们；之后，`OPTIMIZE FINAL` 就会正确处理 TTL。此行为对复制表而言此前从未生效。[#14220](https://github.com/ClickHouse/ClickHouse/pull/14220) ([alesapin](https://github.com/alesapin)).
* 扩展了 `parallel_distributed_insert_select` 设置，新增了一个可将 `INSERT` 执行到本地表的选项。该设置的类型已从 `Bool` 变为 `UInt64`，因此不再支持 `false` 和 `true` 这两个值。如果你在服务器配置中使用了这些值，服务器将无法启动。请分别将它们替换为 `0` 和 `1`。[#14060](https://github.com/ClickHouse/ClickHouse/pull/14060) ([Azat Khuzhin](https://github.com/azat)).
* 移除了对 `ODBCDriver` 输入/输出格式的支持。这是一个已弃用的格式，曾用于与 ClickHouse ODBC 驱动程序通信，如今早已被 `ODBCDriver2` 格式取代。解决了 [#13629](https://github.com/ClickHouse/ClickHouse/issues/13629)。[#13847](https://github.com/ClickHouse/ClickHouse/pull/13847) ([hexiaoting](https://github.com/hexiaoting)).
* 从低于 20.5 的版本升级时，如果执行滚动更新，并且集群中同时存在 20.5 或更高版本以及低于 20.5 的版本，那么当旧版本的 ClickHouse 节点被重启，且旧版本是在有较新版本节点存在的情况下启动时，可能会导致 `Part ... intersects previous part` 错误。为避免此错误，请先在集群的所有节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* 新增支持：可为与 `config.xml` 中指定设置对应的列指定 `Default` 压缩编解码器。实现：[#9074](https://github.com/ClickHouse/ClickHouse/issues/9074)。[#14049](https://github.com/ClickHouse/ClickHouse/pull/14049) ([alesapin](https://github.com/alesapin)).
* 支持在 Kafka 中使用 `krb5` 和 `cyrus-sasl` 库进行 Kerberos 身份验证。[#12771](https://github.com/ClickHouse/ClickHouse/pull/12771) ([Ilya Golshtein](https://github.com/ilejn)).
* 新增函数 `normalizeQuery`，可将字面量、字面量序列和复杂别名替换为占位符。新增函数 `normalizedQueryHash`，可为相似查询返回相同的 64 位哈希值。这有助于分析查询日志。此更改关闭了 [#11271](https://github.com/ClickHouse/ClickHouse/issues/11271)。[#13816](https://github.com/ClickHouse/ClickHouse/pull/13816) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增 `time_zones` 表。[#13880](https://github.com/ClickHouse/ClickHouse/pull/13880) ([Bharat Nallan](https://github.com/bharatnc)).
* 新增函数 `defaultValueOfTypeName`，返回给定类型的默认值。[#13877](https://github.com/ClickHouse/ClickHouse/pull/13877) ([hcz](https://github.com/hczhcz)).
* 新增 `countDigits(x)` 函数，用于统计整数或 Decimal 列中的十进制位数。新增 `isDecimalOverflow(d, [p])` 函数，用于检查 Decimal 列中的值是否超出其自身 (或指定) 的精度范围。[#14151](https://github.com/ClickHouse/ClickHouse/pull/14151) ([Artem Zuikov](https://github.com/4ertus2)).
* 新增 `quantileExactLow` 和 `quantileExactHigh` 实现，并分别添加了对应的别名 `medianExactLow` 和 `medianExactHigh`。[#13818](https://github.com/ClickHouse/ClickHouse/pull/13818) ([Bharat Nallan](https://github.com/bharatnc)).
* 新增 `date_trunc` 函数，用于将日期/时间值截断到指定的日期/时间部分。[#13888](https://github.com/ClickHouse/ClickHouse/pull/13888) ([Vladimir Golovchenko](https://github.com/vladimir-golovchenko)).
* 在主配置中新增可选节 `<user_directories>`。[#13425](https://github.com/ClickHouse/ClickHouse/pull/13425) ([Vitaly Baranov](https://github.com/vitlibar)).
* 新增 `ALTER SAMPLE BY` 语句，允许更改表的 SAMPLE 子句。[#13280](https://github.com/ClickHouse/ClickHouse/pull/13280) ([Amos Bird](https://github.com/amosbird)).
* 函数 `position` 现在支持可选参数 `start_pos`。[#13237](https://github.com/ClickHouse/ClickHouse/pull/13237) ([vdimir](https://github.com/vdimir)).

<div id="bug-fix-23">
  #### 问题修复
</div>

* 修复了客户端在 interactive mode 下进度条遮挡可见数据的问题。此修复解决了 [#12562](https://github.com/ClickHouse/ClickHouse/issues/12562)、[#13369](https://github.com/ClickHouse/ClickHouse/issues/13369)、[#13584](https://github.com/ClickHouse/ClickHouse/issues/13584) 和 [#12964](https://github.com/ClickHouse/ClickHouse/issues/12964)。[#13691](https://github.com/ClickHouse/ClickHouse/pull/13691) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了按多个列排序时 `LowCardinality` 列排序顺序错误的问题。此修复解决了 [#13958](https://github.com/ClickHouse/ClickHouse/issues/13958)。[#14223](https://github.com/ClickHouse/ClickHouse/pull/14223) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 检查 `topK` 聚合函数中的数组大小溢出。若无此检查，用户可能会发送带有精心构造参数的查询，从而导致服务器崩溃。此修复关闭了 [#14452](https://github.com/ClickHouse/ClickHouse/issues/14452)。[#14467](https://github.com/ClickHouse/ClickHouse/pull/14467) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个缺陷：如果表中存在仅包含单个分片的分区，可能会导致错误的合并任务分配。[#14444](https://github.com/ClickHouse/ClickHouse/pull/14444) ([alesapin](https://github.com/alesapin)).
* 如果 `PipelineExecutor` 本身发生异常，则停止查询执行。这可以避免极少数情况下查询挂起。对 [#14334](https://github.com/ClickHouse/ClickHouse/issues/14334) 的延续修复。 [#14402](https://github.com/ClickHouse/ClickHouse/pull/14402) [#14334](https://github.com/ClickHouse/ClickHouse/pull/14334) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了对通过 `AS table_function` 创建的表执行 `ALTER` 查询时发生的崩溃。修复了 [#14212](https://github.com/ClickHouse/ClickHouse/issues/14212)。[#14326](https://github.com/ClickHouse/ClickHouse/pull/14326) ([alesapin](https://github.com/alesapin)).
* 修复了使用 REFRESH 命令执行 ALTER LIVE VIEW 查询时出现的异常。live view 属于 Experimental 功能。[#14320](https://github.com/ClickHouse/ClickHouse/pull/14320) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复带有嵌套解释器的查询在 QueryPlan 生命周期方面的问题 (适用于 EXPLAIN PIPELINE graph=1) 。[#14315](https://github.com/ClickHouse/ClickHouse/pull/14315) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `clickhouse-odbc-bridge` 在从某些外部源拉取 schema 时发生的段错误。此 PR 修复了 [#13861](https://github.com/ClickHouse/ClickHouse/issues/13861)。[#14267](https://github.com/ClickHouse/ClickHouse/pull/14267) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了由 [#12277](https://github.com/ClickHouse/ClickHouse/pull/12277) 引入的标记包含搜索中的崩溃问题。[#14225](https://github.com/ClickHouse/ClickHouse/pull/14225) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了创建包含命名元组的表时出现的问题。此修复解决了 [#13027](https://github.com/ClickHouse/ClickHouse/issues/13027)。[#14143](https://github.com/ClickHouse/ClickHouse/pull/14143) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复最小负十进制数的格式化错误。此修复解决了 [#14111](https://github.com/ClickHouse/ClickHouse/issues/14111)。[#14119](https://github.com/ClickHouse/ClickHouse/pull/14119) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复 `DistributedFilesToInsert` 指标在不应为零时被清零的问题。[#14095](https://github.com/ClickHouse/ClickHouse/pull/14095) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `pointInPolygon` 在将常量二维数组用作多边形时的问题。[#14079](https://github.com/ClickHouse/ClickHouse/pull/14079) ([Alexey Ilyukhov](https://github.com/livace)) 。
* 修复了 `Poco::Exception: no space left on device` 补充信息中错误的挂载点。[#14050](https://github.com/ClickHouse/ClickHouse/pull/14050) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了在非全局级别执行 `GRANT ALL` 语句时的问题。[#13987](https://github.com/ClickHouse/ClickHouse/pull/13987) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复解析器，使其拒绝将带有引擎的 create table 识别为表函数。[#13940](https://github.com/ClickHouse/ClickHouse/pull/13940) ([hcz](https://github.com/hczhcz)).
* 修复了在启用 `optimize_duplicate_order_by_and_distinct` 设置时，使用 `DISTINCT` 关键字且包含 UNION ALL 子查询的 select 查询结果错误的问题。[#13925](https://github.com/ClickHouse/ClickHouse/pull/13925) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了重命名 `Distributed` 表时可能出现的死锁问题。[#13922](https://github.com/ClickHouse/ClickHouse/pull/13922) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了按多列排序时 `FixedString` 列排序错误的问题。修复 [#13182](https://github.com/ClickHouse/ClickHouse/issues/13182)。[#13887](https://github.com/ClickHouse/ClickHouse/pull/13887) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复在使用非默认参数时，`topK`/`topKWeighted` 合并结果可能不准确的问题。[#13817](https://github.com/ClickHouse/ClickHouse/pull/13817) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了从带有 SET 类型 INDEX 的 MergeTree 表读取数据时，与 NULL 比较会失败的问题。此修复对应 [#13686](https://github.com/ClickHouse/ClickHouse/issues/13686)。[#13793](https://github.com/ClickHouse/ClickHouse/pull/13793) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 Lambda 中 `arrayJoin` 捕获的问题 (LOGICAL\_ERROR) 。[#13792](https://github.com/ClickHouse/ClickHouse/pull/13792) ([Azat Khuzhin](https://github.com/azat)) 。
* 为函数 `range` 添加 step 溢出检查。[#13790](https://github.com/ClickHouse/ClickHouse/pull/13790) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了并发执行 `DROP DATABASE` 和 `CREATE TABLE` 时出现的 `Directory not empty` 错误。[#13756](https://github.com/ClickHouse/ClickHouse/pull/13756) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `h3KRing` 函数增加范围检查。此修复解决了 [#13633](https://github.com/ClickHouse/ClickHouse/issues/13633)。[#13752](https://github.com/ClickHouse/ClickHouse/pull/13752) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 DETACH 与后台合并之间的竞态条件。detach 后，parts 可能会重新恢复。这是对 [#8602](https://github.com/ClickHouse/ClickHouse/issues/8602) 的后续；该 PR 并未修复此问题，但引入了一个在极少数情况下开始失败的测试，从而暴露了这个问题。[#13746](https://github.com/ClickHouse/ClickHouse/pull/13746) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复在 log\_queries\_min\_type > QUERY\_START 时，日志中 Settings.Names/Values 记录不正确的问题。[#13737](https://github.com/ClickHouse/ClickHouse/pull/13737) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 verbose=1 时 `/replicas_status` 端点返回的响应状态码问题。[#13722](https://github.com/ClickHouse/ClickHouse/pull/13722) ([javi santana](https://github.com/javisantana)) 。
* 修复了 `clickhouse-server.init` 在检查用户和组时的错误消息。[#13711](https://github.com/ClickHouse/ClickHouse/pull/13711) ([ylchou](https://github.com/ylchou)).
* 在 `optimize_move_functions_out_of_any` 设置下，不要将 any(arrayJoin()) 优化为 arrayJoin()。 [#13681](https://github.com/ClickHouse/ClickHouse/pull/13681) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在同时使用 StorageMerge 和 `set enable_optimize_predicate_expression=1` 时 JOIN 崩溃的问题。[#13679](https://github.com/ClickHouse/ClickHouse/pull/13679) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了与 `The value of 'number_of_free_entries_in_pool_to_lower_max_size_of_merge' setting` 相关的错误消息中的拼写错误。[#13678](https://github.com/ClickHouse/ClickHouse/pull/13678) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 并发执行 `ALTER ... REPLACE/MOVE PARTITION ...` 查询时，可能会导致死锁。该问题现已修复。[#13626](https://github.com/ClickHouse/ClickHouse/pull/13626) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了这样一种情况：缓存字典有时会返回默认值，而不是源中已有的值。[#13624](https://github.com/ClickHouse/ClickHouse/pull/13624) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复 compact parts 中二级索引损坏的问题。Compact parts 属于 Experimental 功能。[#13538](https://github.com/ClickHouse/ClickHouse/pull/13538) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了必须在单个副本上执行的查询在 `ON CLUSTER` 下过早超时的问题。修复了 [#6704](https://github.com/ClickHouse/ClickHouse/issues/6704)、[#7228](https://github.com/ClickHouse/ClickHouse/issues/7228)、[#13361](https://github.com/ClickHouse/ClickHouse/issues/13361)、[#11884](https://github.com/ClickHouse/ClickHouse/issues/11884)。[#13450](https://github.com/ClickHouse/ClickHouse/pull/13450) ([alesapin](https://github.com/alesapin)) 。
* 修复了函数 `netloc` 中的错误代码。此修复解决了 [#13335](https://github.com/ClickHouse/ClickHouse/issues/13335)。[#13446](https://github.com/ClickHouse/ClickHouse/pull/13446) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `StorageMemory` 中可能存在的竞争问题。[#13416](https://github.com/ClickHouse/ClickHouse/pull/13416) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 HTTP 协议中 `TSV/CSVWithNames` 格式请求头缺失或过多的问题。修复了 [#12504](https://github.com/ClickHouse/ClickHouse/issues/12504)。[#13343](https://github.com/ClickHouse/ClickHouse/pull/13343) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了当数据库或表名包含点号时，无法从 users.xml 正确解析行策略的问题。此修复解决了 [#5779](https://github.com/ClickHouse/ClickHouse/issues/5779) 和 [#12527](https://github.com/ClickHouse/ClickHouse/issues/12527)。[#13199](https://github.com/ClickHouse/ClickHouse/pull/13199) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在连接曾中断过一次后无法访问 `redis` 字典的问题。该问题可能发生在 `cache` 和 `direct` 字典布局中。[#13082](https://github.com/ClickHouse/ClickHouse/pull/13082) ([Anton Popov](https://github.com/CurtizJ)).
* 移除了使用 ClickHouseDictionarySource 查询远程表时不正确的身份验证访问检查。[#12756](https://github.com/ClickHouse/ClickHouse/pull/12756) ([sundyli](https://github.com/sundy-li)) 。
* 在某些情况下，为了进行公共子表达式消除，正确地区分子查询。[#8333](https://github.com/ClickHouse/ClickHouse/issues/8333). [#8367](https://github.com/ClickHouse/ClickHouse/pull/8367) ([Amos Bird](https://github.com/amosbird)).

<div id="improvement">
  #### 改进
</div>

* 禁止在 `ALIAS` 类型的列上使用 `CODEC`。修复 [#13911](https://github.com/ClickHouse/ClickHouse/issues/13911)。[#14263](https://github.com/ClickHouse/ClickHouse/pull/14263) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 等待字典更新完成时，应使用 `query_wait_timeout_milliseconds` 设置中指定的超时时间，而不是硬编码的值。[#14105](https://github.com/ClickHouse/ClickHouse/pull/14105) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 新增设置 `min_index_granularity_bytes`，防止因误设过低的 `index_granularity_bytes` 而意外创建表。[#14139](https://github.com/ClickHouse/ClickHouse/pull/14139) ([Bharat Nallan](https://github.com/bharatnc)).
* 现在可以从使用不同 ZooKeeper 的集群拉取分区：`ALTER TABLE table_name FETCH PARTITION partition_expr FROM 'zk-name:/path-in-zookeeper'`。这有助于将数据迁移到新集群。[#14155](https://github.com/ClickHouse/ClickHouse/pull/14155) ([Amos Bird](https://github.com/amosbird)) 。
* 如果 Memory 表是由大量极小的块构成的，性能会略有提升 (不过这种情况不太可能发生) 。该想法由 [Mark Papadakis](https://github.com/markpapadakis) 提出。关闭 [#14043](https://github.com/ClickHouse/ClickHouse/issues/14043)。[#14056](https://github.com/ClickHouse/ClickHouse/pull/14056) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 条件聚合函数 (例如：`avgIf`、`sumIf`、`maxIf`) 在没有匹配行且使用可空参数时应返回 `NULL`。[#13964](https://github.com/ClickHouse/ClickHouse/pull/13964) ([Winter Zhang](https://github.com/zhang2014)) 。
* 将 -Resample 组合器的限制提高到 1M。[#13947](https://github.com/ClickHouse/ClickHouse/pull/13947) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 修复了 AvroConfluent 格式中的一个错误：收到异常小且格式损坏的消息时，Kafka 表引擎会停止处理消息。[#13941](https://github.com/ClickHouse/ClickHouse/pull/13941) ([Gervasio Varela](https://github.com/gervarela)).
* 修复了长查询返回错误报错信息的问题。对于正确的查询，此前除了 `Max query size exceeded` 之外，还可能收到其他语法错误。[#13928](https://github.com/ClickHouse/ClickHouse/pull/13928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 改进了 `TabSeparated` 格式中 NULL 值的错误提示。[#13906](https://github.com/ClickHouse/ClickHouse/pull/13906) ([jiang tao](https://github.com/tomjiang1987)) 。
* 如果 Array 元素类型为 Float32/Float64，函数 `arrayCompact` 将按位比较 NaN。在之前的版本中，如果 Array 元素类型为 Float32/Float64，NaN 始终被视为不相等；而如果类型更复杂，例如 Nullable(Float64)，则 NaN 始终被视为相等。这样就解决了 [#13857](https://github.com/ClickHouse/ClickHouse/issues/13857)。[#13868](https://github.com/ClickHouse/ClickHouse/pull/13868) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `lgamma` 函数中的数据竞争。该问题仅在 `tsan` 中被发现，实际上并未产生任何副作用。[#13842](https://github.com/ClickHouse/ClickHouse/pull/13842) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 避免将数组作为字段处理时查询过慢，改为抛出异常。[#13753](https://github.com/ClickHouse/ClickHouse/pull/13753) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了 Redis requirepass 认证 (用于 Redis 字典源) 。[#13688](https://github.com/ClickHouse/ClickHouse/pull/13688) ([Ivan Torgashov](https://github.com/it1804)).
* 新增 MergeTree 预写日志 (WAL) 转储工具。WAL 是一项 Experimental 功能。 [#13640](https://github.com/ClickHouse/ClickHouse/pull/13640) ([BohuTANG](https://github.com/BohuTANG)) 。
* 在早期版本中，`lcm` 函数如果使用特意构造的参数调用，可能会在调试构建中触发断言失败。此项修复了 [#13368](https://github.com/ClickHouse/ClickHouse/issues/13368)。[#13510](https://github.com/ClickHouse/ClickHouse/pull/13510) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在更多情况下为 `toDate/toDateTime` 函数提供单调性。单调性信息用于索引分析 (更复杂的查询将能够使用索引) 。现在，对输入参数的饱和处理更加自然，从而提供了更好的单调性。[#13497](https://github.com/ClickHouse/ClickHouse/pull/13497) ([Amos Bird](https://github.com/amosbird)) 。
* 支持自定义设置使用复合标识符。自定义设置是 ClickHouse 代码库与其他代码库之间的集成接口 (对 ClickHouse 本身没有实际收益) [#13496](https://github.com/ClickHouse/ClickHouse/pull/13496) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 并行将 parts 从 DiskLocal 移动到 DiskS3。`DiskS3` 仍属 Experimental 功能。[#13459](https://github.com/ClickHouse/ClickHouse/pull/13459) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 默认启用混合粒度的 parts。 [#13449](https://github.com/ClickHouse/ClickHouse/pull/13449) ([alesapin](https://github.com/alesapin)) 。
* 在 S3 重定向中正确检查远程主机 (安全相关) 。[#13404](https://github.com/ClickHouse/ClickHouse/pull/13404) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 在 system.events 中添加 `QueryTimeMicroseconds`、`SelectQueryTimeMicroseconds` 和 `InsertQueryTimeMicroseconds`。[#13336](https://github.com/ClickHouse/ClickHouse/pull/13336) ([ianton-ru](https://github.com/ianton-ru)) 。
* 修复了 Decimal 的负指数过大时触发的调试断言问题。修复了 [#13188](https://github.com/ClickHouse/ClickHouse/issues/13188)。[#13228](https://github.com/ClickHouse/ClickHouse/pull/13228) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 DiskS3 新增了缓存层 (将标记和索引文件缓存到本地磁盘) 。`DiskS3` 是一项 Experimental 功能。[#13076](https://github.com/ClickHouse/ClickHouse/pull/13076) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 修复 readline，使其现在会将历史记录转储到文件。[#13600](https://github.com/ClickHouse/ClickHouse/pull/13600) ([Amos Bird](https://github.com/amosbird)).
* 默认使用 `Atomic` 引擎创建 `system` 数据库 (这是为在所有地方默认启用 `Atomic` 数据库引擎做准备) 。[#13680](https://github.com/ClickHouse/ClickHouse/pull/13680) ([tavplubix](https://github.com/tavplubix)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 对带有 `LowCardinality` 的超短查询做了轻微优化。[#14129](https://github.com/ClickHouse/ClickHouse/pull/14129) ([Anton Popov](https://github.com/CurtizJ)).
* 在设置 `max_insert_threads` 时，为表引擎 `Null`、`Memory`、`Distributed` 和 `Buffer` 启用并行 INSERT。[#14120](https://github.com/ClickHouse/ClickHouse/pull/14120) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 如果在扫描 parts 时超出 `max_rows_to_read` 限制，则立即失败。这样做是为了在已明确 `max_rows_to_read` 超限时，跳过对所有选中 parts 的范围扫描。对于涉及大量 parts 的查询，这项改动效果相当明显。[#13677](https://github.com/ClickHouse/ClickHouse/pull/13677) ([Roman Khavronenko](https://github.com/hagen1778)).
* 轻微提升了按 UInt8/UInt16 键进行聚合时的性能。[#13099](https://github.com/ClickHouse/ClickHouse/pull/13099) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 针对 `Array(LowCardinality(T))` 和右侧为常量参数的情况，优化了 `has()`、`indexOf()` 和 `countEqual()` 函数。[#12550](https://github.com/ClickHouse/ClickHouse/pull/12550) ([myrrc](https://github.com/myrrc)).
* 在执行简单的 `INSERT SELECT` 查询时，自动将 `max_threads` 设置为 1 或 `max_insert_threads`，并将 `max_block_size` 设置为 `min_insert_block_size_rows`。与 [#5907](https://github.com/ClickHouse/ClickHouse/issues/5907) 相关。[#12195](https://github.com/ClickHouse/ClickHouse/pull/12195) ([flynn](https://github.com/ucasFL)).

<div id="experimental-feature">
  #### Experimental 功能
</div>

* ClickHouse 现已可作为 MySQL 副本运行——由 `MaterializeMySQL` 数据库引擎实现。实现了 [#4006](https://github.com/ClickHouse/ClickHouse/issues/4006)。[#10851](https://github.com/ClickHouse/ClickHouse/pull/10851) ([Winter Zhang](https://github.com/zhang2014)) 。
* 新增类型 `Int128`、`Int256`、`UInt256` 及其相关函数。Decimal 扩展支持 Decimal256 (精度最高可达 76 位) 。这些新类型由设置 `allow_experimental_bigint_types` 控制。其运行极其缓慢，表现也很差。该实现尚不完整。请不要使用此功能。[#13097](https://github.com/ClickHouse/ClickHouse/pull/13097) ([Artem Zuikov](https://github.com/4ertus2)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 新增了 `clickhouse install` 脚本，在只有单个二进制文件时很有用。[#13528](https://github.com/ClickHouse/ClickHouse/pull/13528) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 允许在无配置的情况下运行 `clickhouse` 可执行文件。 [#13515](https://github.com/ClickHouse/ClickHouse/pull/13515) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 启用使用 `codespell` 检查代码中拼写错误。[#13513](https://github.com/ClickHouse/ClickHouse/pull/13513) [#13511](https://github.com/ClickHouse/ClickHouse/pull/13511) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 CI 中启用 ShellCheck，作为 `.sh` 测试的静态检查工具。这修复了 [#13168](https://github.com/ClickHouse/ClickHouse/issues/13168)。[#13530](https://github.com/ClickHouse/ClickHouse/pull/13530) [#13529](https://github.com/ClickHouse/ClickHouse/pull/13529) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增一个 CMake 选项，使配置过程在出错时直接失败，而不是自动重新配置，且默认启用。[#13687](https://github.com/ClickHouse/ClickHouse/pull/13687) ([Konstantin](https://github.com/podshumok)).
* 在 system.build\_options 中通过 TZDATA\_VERSION 暴露内置 tzdata 的版本。[#13648](https://github.com/ClickHouse/ClickHouse/pull/13648) ([filimonov](https://github.com/filimonov)) 。
* 改进了构建期间 `system.time&#95;zones` 表的生成。关闭 [#14209](https://github.com/ClickHouse/ClickHouse/issues/14209)。[#14215](https://github.com/ClickHouse/ClickHouse/pull/14215) ([filimonov](https://github.com/filimonov)) 。
* 使用软件包仓库中最新版本的 tzdata 构建 ClickHouse。[#13623](https://github.com/ClickHouse/ClickHouse/pull/13623) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持在 skip\_list.json 中编写 JS 风格的注释。[#14159](https://github.com/ClickHouse/ClickHouse/pull/14159) ([alesapin](https://github.com/alesapin)) 。
* 确保没有复制粘贴的 GPL 代码。[#13514](https://github.com/ClickHouse/ClickHouse/pull/13514) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 将测试用 Docker 镜像切换为使用 test-base 作为父级镜像。[#14167](https://github.com/ClickHouse/ClickHouse/pull/14167) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 在启动 docker-compose 集群时添加重试机制；增大 COMPOSE\_HTTP\_TIMEOUT。[#14112](https://github.com/ClickHouse/ClickHouse/pull/14112) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 在压力测试中启用 `system.text_log`，以发现更多 bug。[#13855](https://github.com/ClickHouse/ClickHouse/pull/13855) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* Testflows LDAP 模块：补充 openldap4 缺失的证书和 dhparam.pem。[#13780](https://github.com/ClickHouse/ClickHouse/pull/13780) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* ZooKeeper 无法在 CI 基础设施中的单元测试里可靠运行。从一开始就用单元测试来验证与真实 ZooKeeper 的交互就是个糟糕的主意 (单元测试本来就不该用于验证复杂的分布式系统) 。我们已经为此使用 integration tests，而且它们更适合这个目的。[#13745](https://github.com/ClickHouse/ClickHouse/pull/13745) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 添加了用于风格检查的 Docker 镜像。新增了一项风格检查，以确保所有 docker 和 docker compose 文件都位于 docker 目录中。[#13724](https://github.com/ClickHouse/ClickHouse/pull/13724) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 修复了 Mac OS 上 Cassandra 的构建问题。[#13708](https://github.com/ClickHouse/ClickHouse/pull/13708) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 修复共享构建的链接错误。[#13700](https://github.com/ClickHouse/ClickHouse/pull/13700) ([Amos Bird](https://github.com/amosbird)).
* 更新 LDAP 用户身份验证套件，检查其是否可与 RBAC 配合使用。[#13656](https://github.com/ClickHouse/ClickHouse/pull/13656) ([vzakaznikov](https://github.com/vzakaznikov)).
* 移除了 `contrib/aws` 中的 `-DENABLE_CURL_CLIENT`。[#13628](https://github.com/ClickHouse/ClickHouse/pull/13628) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 增加了 ClickHouse 节点健康检查的超时时间，并支持在发现不健康容器时转储 docker-compose 日志。[#13612](https://github.com/ClickHouse/ClickHouse/pull/13612) ([vzakaznikov](https://github.com/vzakaznikov)).
* 确认 [#10977](https://github.com/ClickHouse/ClickHouse/issues/10977) 无效。[#13539](https://github.com/ClickHouse/ClickHouse/pull/13539) ([Amos Bird](https://github.com/amosbird)) 。
* 跳过来自 robot-clickhouse 的 PR。[#13489](https://github.com/ClickHouse/ClickHouse/pull/13489) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 将 Dockerfiles 从 integration tests 移至 `docker/test` 目录。`runner` Docker 容器中提供了 docker\_compose 文件。Docker 镜像在 CI 中构建，而不是在 integration tests 中构建。[#13448](https://github.com/ClickHouse/ClickHouse/pull/13448) ([Ilya Yatsishin](https://github.com/qoega)) 。

<div id="clickhouse-release-207">
  ## ClickHouse 20.7 发行版
</div>

<div id="clickhouse-release-v207230-stable-2020-08-31">
  ### ClickHouse 发行版 v20.7.2.30-稳定版本，2020-08-31
</div>

<div id="backward-incompatible-change">
  #### 向后不兼容变更
</div>

* 当函数 `modulo` (运算符 `%`) 的参数中至少有一个是浮点数时，将直接基于浮点数计算除法余数，而不再先将两个参数都转换为整数。这样可使其行为与大多数 DBMS 保持一致。这也适用于 Date 和 DateTime 数据类型。新增别名 `mod`。此项关闭了 [#7323](https://github.com/ClickHouse/ClickHouse/issues/7323)。[#12585](https://github.com/ClickHouse/ClickHouse/pull/12585) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 弃用将零 Date/DateTime 值特殊输出为 `0000-00-00` 和 `0000-00-00 00:00:00` 的行为。[#12442](https://github.com/ClickHouse/ClickHouse/pull/12442) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 函数 `groupArrayMoving*` 此前无法用于分布式查询。其结果是在错误的数据类型中计算的 (未提升到最大类型) 。函数 `groupArrayMovingAvg` 返回的是整数，这与 `avg` 函数不一致。此项修复了 [#12568](https://github.com/ClickHouse/ClickHouse/issues/12568)。[#12622](https://github.com/ClickHouse/ClickHouse/pull/12622) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 MergeTree 设置增加合理性检查。如果设置不正确，服务器将拒绝启动或拒绝创建表，并向用户输出详细说明。[#13153](https://github.com/ClickHouse/ClickHouse/pull/13153) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 防止用户将 `background_pool_size` 设置为低于 `number_of_free_entries_in_pool_to_execute_mutation` 或 `number_of_free_entries_in_pool_to_lower_max_size_of_merge` 的值。在这些情况下，ALTER 将无法正常工作，或者 merge 的最大大小会被限制得过小。系统将抛出异常并说明应如何处理。此项关闭了 [#10897](https://github.com/ClickHouse/ClickHouse/issues/10897)。[#12728](https://github.com/ClickHouse/ClickHouse/pull/12728) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 从早于 20.5 的版本升级时，如果执行滚动更新，并且集群中同时存在 20.5 及以上版本和低于 20.5 的版本，那么当旧版本的 ClickHouse 节点在较新版本节点已存在的情况下重启时，可能会导致 `Part ... intersects previous part` 错误。为防止此错误，请先在所有集群节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* Polygon 字典类型，可高效执行“逆地理编码”查找——即在包含大量多边形 (世界地图) 的字典中根据坐标查找区域。它采用了经过精心优化的递归网格算法，以保持较低的 CPU 和内存占用。 [#9278](https://github.com/ClickHouse/ClickHouse/pull/9278) ([achulkov2](https://github.com/achulkov2)).
* 为预配置用户新增 LDAP 身份验证支持 (“Simple Bind”方法) 。 [#11234](https://github.com/ClickHouse/ClickHouse/pull/11234) ([Denis Glazachev](https://github.com/traceon)).
* 引入设置 `alter_partition_verbose_result`，可为某些类型的 `ALTER TABLE ... PARTITION ...` 查询输出所涉及 parts 的信息 (目前为 `ATTACH` 和 `FREEZE`) 。关闭 [#8076](https://github.com/ClickHouse/ClickHouse/issues/8076)。 [#13017](https://github.com/ClickHouse/ClickHouse/pull/13017) ([alesapin](https://github.com/alesapin)).
* 新增用于贝叶斯 A/B 测试的 `bayesAB` 函数。 [#12327](https://github.com/ClickHouse/ClickHouse/pull/12327) ([achimbab](https://github.com/achimbab)).
* 新增 `system.crash_log` 表，用于收集致命错误的堆栈跟踪。该表应为空。 [#12316](https://github.com/ClickHouse/ClickHouse/pull/12316) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增 HTTP 请求头 `X-ClickHouse-Database` 和 `X-ClickHouse-Format`，可用于设置默认数据库和输出格式。 [#12981](https://github.com/ClickHouse/ClickHouse/pull/12981) ([hcz](https://github.com/hczhcz)).
* 为 `SimpleAggregateFunction` 新增对 `minMap` 和 `maxMap` 函数的支持。 [#12662](https://github.com/ClickHouse/ClickHouse/pull/12662) ([Ildus Kurbangaliev](https://github.com/ildus)).
* 新增设置 `allow_non_metadata_alters`，用于限制执行会修改磁盘上数据的 `ALTER` 查询。默认禁用。关闭 [#11547](https://github.com/ClickHouse/ClickHouse/issues/11547)。 [#12635](https://github.com/ClickHouse/ClickHouse/pull/12635) ([alesapin](https://github.com/alesapin)).
* 新增 `formatRow` 函数，支持按给定格式将任意表达式转换为字符串。它对于处理 SQL 输出非常有用，并且与 `columns` 函数结合使用时十分灵活。 [#12574](https://github.com/ClickHouse/ClickHouse/pull/12574) ([Amos Bird](https://github.com/amosbird)).
* 为兼容 MySQL，新增 `FROM_UNIXTIME` 函数，参见 [12149](https://github.com/ClickHouse/ClickHouse/issues/12149)。 [#12484](https://github.com/ClickHouse/ClickHouse/pull/12484) ([flynn](https://github.com/ucasFL)).
* 如果启用了 `allow_nullable_key` 表设置，则允许在 MergeTree 表中使用 Nullable 类型作为键。关闭 [#5319](https://github.com/ClickHouse/ClickHouse/issues/5319)。 [#12433](https://github.com/ClickHouse/ClickHouse/pull/12433) ([Amos Bird](https://github.com/amosbird)).
* 新增与 [COS](https://intl.cloud.tencent.com/product/cos) 的集成。 [#12386](https://github.com/ClickHouse/ClickHouse/pull/12386) ([fastio](https://github.com/fastio)).
* 新增 `mapAdd` 和 `mapSubtract` 函数，用于对按键映射的值执行加减运算。 [#11735](https://github.com/ClickHouse/ClickHouse/pull/11735) ([Ildus Kurbangaliev](https://github.com/ildus)).

<div id="bug-fix-23">
  #### 问题修复
</div>

* 修复了必须在单个副本上执行的查询中 `ON CLUSTER` 过早超时的问题。修复了 [#6704](https://github.com/ClickHouse/ClickHouse/issues/6704)、[#7228](https://github.com/ClickHouse/ClickHouse/issues/7228)、[#13361](https://github.com/ClickHouse/ClickHouse/issues/13361)、[#11884](https://github.com/ClickHouse/ClickHouse/issues/11884)。[#13450](https://github.com/ClickHouse/ClickHouse/pull/13450) ([alesapin](https://github.com/alesapin))。
* 修复了由 [#12277](https://github.com/ClickHouse/ClickHouse/pull/12277) 引入的标记包含搜索中的崩溃问题。[#14225](https://github.com/ClickHouse/ClickHouse/pull/14225) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `cache` 布局外部字典中的竞态条件，该问题可能导致服务器崩溃。[#12566](https://github.com/ClickHouse/ClickHouse/pull/12566) ([alesapin](https://github.com/alesapin)) 。
* 修复了客户端在交互模式下进度条遮挡可见数据的问题。此修复解决了 [#12562](https://github.com/ClickHouse/ClickHouse/issues/12562)、[#13369](https://github.com/ClickHouse/ClickHouse/issues/13369)、[#13584](https://github.com/ClickHouse/ClickHouse/issues/13584) 和 [#12964](https://github.com/ClickHouse/ClickHouse/issues/12964)。[#13691](https://github.com/ClickHouse/ClickHouse/pull/13691) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在使用 ORDER BY 按多个列排序时，`LowCardinality` 列排序顺序错误的问题。此修复解决了 [#13958](https://github.com/ClickHouse/ClickHouse/issues/13958)。[#14223](https://github.com/ClickHouse/ClickHouse/pull/14223) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 移除了硬编码的超时设置，此前它会错误地覆盖缓存字典的 `query_wait_timeout_milliseconds` 设置。[#14105](https://github.com/ClickHouse/ClickHouse/pull/14105) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了 `Poco::Exception: no space left on device` 附加信息中的错误挂载点。[#14050](https://github.com/ClickHouse/ClickHouse/pull/14050) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了在启用 `optimize_duplicate_order_by_and_distinct` 设置时，若子查询也包含 `DISTINCT`，对带有 `DISTINCT` 关键字的 select 查询进行错误优化的问题。[#13925](https://github.com/ClickHouse/ClickHouse/pull/13925) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了重命名 `Distributed` 表时可能发生的死锁。[#13922](https://github.com/ClickHouse/ClickHouse/pull/13922) ([tavplubix](https://github.com/tavplubix)).
* 修复了在使用 ORDER BY 按多列排序时，`FixedString` 列排序不正确的问题。修复 [#13182](https://github.com/ClickHouse/ClickHouse/issues/13182)。[#13887](https://github.com/ClickHouse/ClickHouse/pull/13887) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `topK`/`topKWeighted` 聚合在使用非默认参数时精度可能偏低的问题。[#13817](https://github.com/ClickHouse/ClickHouse/pull/13817) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了从带有 SET 类型 INDEX 的 MergeTree 表读取数据时，与 NULL 比较会失败的问题。此修复对应 [#13686](https://github.com/ClickHouse/ClickHouse/issues/13686)。[#13793](https://github.com/ClickHouse/ClickHouse/pull/13793) ([Amos Bird](https://github.com/amosbird)) 。
* 修复函数 `range()` 中 `step` 参数的溢出问题。[#13790](https://github.com/ClickHouse/ClickHouse/pull/13790) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了并发执行 `DROP DATABASE` 和 `CREATE TABLE` 时出现的 `Directory not empty` 错误。 [#13756](https://github.com/ClickHouse/ClickHouse/pull/13756) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `h3KRing` 函数添加范围检查，修复了 [#13633](https://github.com/ClickHouse/ClickHouse/issues/13633)。[#13752](https://github.com/ClickHouse/ClickHouse/pull/13752) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 DETACH 与后台合并之间的竞态条件。执行 detach 后，parts 可能会重新出现。这是 [#8602](https://github.com/ClickHouse/ClickHouse/issues/8602) 的后续；该修复并未解决这个问题，但引入了一项测试，该测试在极少数情况下开始失败，从而暴露了这个问题。[#13746](https://github.com/ClickHouse/ClickHouse/pull/13746) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了当 `log_queries_min_type` 大于 `QUERY_START` 时，日志中 Settings.Names/Values 的问题。[#13737](https://github.com/ClickHouse/ClickHouse/pull/13737) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在检查用户和组时 `clickhouse-server.init` 中不正确的消息。[#13711](https://github.com/ClickHouse/ClickHouse/pull/13711) ([ylchou](https://github.com/ylchou)).
* 在 `optimize_move_functions_out_of_any` 启用时，不要将 `any(arrayJoin())` 优化为 `arrayJoin()`。 [#13681](https://github.com/ClickHouse/ClickHouse/pull/13681) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了并发执行 `ALTER ... REPLACE/MOVE PARTITION ...` 查询时可能发生的死锁问题。[#13626](https://github.com/ClickHouse/ClickHouse/pull/13626) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 cache 类型字典在某些情况下会返回默认值，而不是 source 中已有值的问题。[#13624](https://github.com/ClickHouse/ClickHouse/pull/13624) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复 compact parts 中二级索引损坏的问题 (compact parts 是一项 Experimental 功能) 。[#13538](https://github.com/ClickHouse/ClickHouse/pull/13538) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了函数 `netloc` 中的错误代码。此修复解决了 [#13335](https://github.com/ClickHouse/ClickHouse/issues/13335)。[#13446](https://github.com/ClickHouse/ClickHouse/pull/13446) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了将 Unix 时间戳作为参数传入 `parseDateTimeBestEffort` 函数时出现的解析错误。此修复解决了 [#13362](https://github.com/ClickHouse/ClickHouse/issues/13362)。[#13441](https://github.com/ClickHouse/ClickHouse/pull/13441) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了比较包含 `NULL` 元素的元组时返回类型无效的问题。修复了 [#12461](https://github.com/ClickHouse/ClickHouse/issues/12461)。[#13420](https://github.com/ClickHouse/ClickHouse/pull/13420) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了错误优化导致的问题：在启用 `SET optimize_move_functions_out_of_any = 1` 且 `any()` 内包含别名时，会报 `aggregate function any(x) is found inside another aggregate function in query` 错误。 [#13419](https://github.com/ClickHouse/ClickHouse/pull/13419) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复 `StorageMemory` 中可能存在的竞态条件。[#13416](https://github.com/ClickHouse/ClickHouse/pull/13416) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在查询返回零行时 `Arrow` 和 `Parquet` format 输出为空的问题，因为对于这些 format 来说，空输出是无效的。[#13399](https://github.com/ClickHouse/ClickHouse/pull/13399) ([hcz](https://github.com/hczhcz)).
* 修复了 `ORDER BY` 子句中包含常量列和主键前缀时的 select 查询问题。[#13396](https://github.com/ClickHouse/ClickHouse/pull/13396) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 clickhouse-local 中的 `PrettyCompactMonoBlock`。修复 `PrettyCompactMonoBlock` 中 extremes/totals 的问题。修复了 [#7746](https://github.com/ClickHouse/ClickHouse/issues/7746)。[#13394](https://github.com/ClickHouse/ClickHouse/pull/13394) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 system.text\_log 中的死锁问题。[#12452](https://github.com/ClickHouse/ClickHouse/pull/12452) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。这是 [#12339](https://github.com/ClickHouse/ClickHouse/issues/12339) 的一部分，并修复了 [#12325](https://github.com/ClickHouse/ClickHouse/issues/12325)。[#13386](https://github.com/ClickHouse/ClickHouse/pull/13386) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 `File(TSVWithNames*)` (请求头会被重复写入) 的问题；修复了 `clickhouse-local --format CSVWithNames*` (缺少请求头，在 [#12197](https://github.com/ClickHouse/ClickHouse/issues/12197) 之后失效) 的问题；修复了零行时 `clickhouse-local --format CSVWithNames*` 缺少请求头的问题。[#13343](https://github.com/ClickHouse/ClickHouse/pull/13343) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了函数 `groupArrayMovingSum` 在反序列化空状态时发生的段错误。修复 [#13339](https://github.com/ClickHouse/ClickHouse/issues/13339)。[#13341](https://github.com/ClickHouse/ClickHouse/pull/13341) ([alesapin](https://github.com/alesapin)).
* 在 `JOIN ON` 部分使用 `arrayJoin()` 函数时抛出错误。[#13330](https://github.com/ClickHouse/ClickHouse/pull/13330) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复 `LEFT ASOF JOIN` 在 `join_use_nulls=1` 时发生崩溃的问题。[#13291](https://github.com/ClickHouse/ClickHouse/pull/13291) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了在查询来自延迟副本时可能出现的错误 `Totals having transform was already added to pipeline`。[#13290](https://github.com/ClickHouse/ClickHouse/pull/13290) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果用户向函数 `h3ToChildren` 传入特意构造的参数，server 可能会崩溃。此修复解决了 [#13275](https://github.com/ClickHouse/ClickHouse/issues/13275)。[#13277](https://github.com/ClickHouse/ClickHouse/pull/13277) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在包含 `NaN` 值的 Float 类型上调用 `uniqExact`、`topK`、`sumDistinct` 及类似聚合函数时，可能出现的性能较低和结果略有偏差的问题。该问题还会在 debug 构建中触发断言。此修复解决了 [#12491](https://github.com/ClickHouse/ClickHouse/issues/12491)。[#13254](https://github.com/ClickHouse/ClickHouse/pull/13254) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 KeyCondition 中的断言问题：当主键包含带单调函数的表达式，且查询中包含与类型不同的常量的比较时，会触发该问题。此修复解决了 [#12465](https://github.com/ClickHouse/ClickHouse/issues/12465)。[#13251](https://github.com/ClickHouse/ClickHouse/pull/13251) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 对于在函数 roundUpToPowerOfTwoOrZero() 中最高有效位 (MSB) 已置位的数字，返回其原值。这可防止数组大小溢出时出现潜在错误。[#13234](https://github.com/ClickHouse/ClickHouse/pull/13234) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了函数 if 在 cond 为非字面量 NULL 的 Nullable constexpr 时的问题。修复了 [#12463](https://github.com/ClickHouse/ClickHouse/issues/12463)。[#13226](https://github.com/ClickHouse/ClickHouse/pull/13226) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 修复了 `arrayElement` 函数中的断言错误：当数组元素为 Nullable，且数组下标也为 Nullable 时会触发该错误。此修复解决了 [#12172](https://github.com/ClickHouse/ClickHouse/issues/12172)。[#13224](https://github.com/ClickHouse/ClickHouse/pull/13224) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 DateTime64 转换函数在使用常量参数时的问题。[#13205](https://github.com/ClickHouse/ClickHouse/pull/13205) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了当数据库或表名中包含点号时，无法从 users.xml 中解析行策略的问题。此修复对应 [#5779](https://github.com/ClickHouse/ClickHouse/issues/5779) 和 [#12527](https://github.com/ClickHouse/ClickHouse/issues/12527)。[#13199](https://github.com/ClickHouse/ClickHouse/pull/13199) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在连接曾断开一次后无法访问 `redis` 字典的问题。该问题可能发生在 `cache` 和 `direct` 字典布局中。[#13082](https://github.com/ClickHouse/ClickHouse/pull/13082) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了函数导致的错误索引分析。该问题可能会导致从 `MergeTree` 表读取时跳过某些数据分区片段。修复 [#13060](https://github.com/ClickHouse/ClickHouse/issues/13060)。修复 [#12406](https://github.com/ClickHouse/ClickHouse/issues/12406)。[#13081](https://github.com/ClickHouse/ClickHouse/pull/13081) ([Anton Popov](https://github.com/CurtizJ)).
* 修复远程查询中出现的错误 `Cannot convert column because it is constant but values of constants are different in source and result`：这类查询在单次查询范围内使用的是确定性函数，但在不同查询之间并不确定，例如 `now()`、`now64()`、`randConstant()`。修复了 [#11327](https://github.com/ClickHouse/ClickHouse/issues/11327)。[#13075](https://github.com/ClickHouse/ClickHouse/pull/13075) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在查询包含 `ORDER BY` Tuple 且 `LIMIT` 较小时可能发生崩溃的问题。修复 [#12623](https://github.com/ClickHouse/ClickHouse/issues/12623)。[#13009](https://github.com/ClickHouse/ClickHouse/pull/13009) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复包含 `UNION` 和 `JOIN` 的查询出现的 `Block structure mismatch` 错误。修复 [#12602](https://github.com/ClickHouse/ClickHouse/issues/12602)。[#12989](https://github.com/ClickHouse/ClickHouse/pull/12989) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修正了 `merge_with_ttl_timeout` 的逻辑问题：此前当过期在同一时间间隔内影响到多个分区时，该逻辑无法正常工作。 (贡献者：@excitoon) 。[#12982](https://github.com/ClickHouse/ClickHouse/pull/12982) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了通过 DDL 查询创建的范围哈希字典中列重复的问题。此修复对应 [#10605](https://github.com/ClickHouse/ClickHouse/issues/10605)。[#12857](https://github.com/ClickHouse/ClickHouse/pull/12857) ([alesapin](https://github.com/alesapin)) 。
* 修复了从本地副本执行 SELECT 查询时线程数被不必要限制的问题。[#12840](https://github.com/ClickHouse/ClickHouse/pull/12840) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复一个罕见缺陷：当 `ALTER DELETE` 和 `ALTER MODIFY COLUMN` 查询同时作为一次变更执行时，会导致 `count.txt` 中的行数不正确，进而造成分片中的数据错误。此外，还修复了 `ALTER RENAME COLUMN` 和 `ALTER ADD COLUMN` 同时执行时的一个小问题。[#12760](https://github.com/ClickHouse/ClickHouse/pull/12760) ([alesapin](https://github.com/alesapin)).
* 使用 `clickhouse` 字典源查询远程表时，所用凭据有误。[#12756](https://github.com/ClickHouse/ClickHouse/pull/12756) ([sundyli](https://github.com/sundy-li)).
* 修复 `CAST(Nullable(String), Enum())`。[#12745](https://github.com/ClickHouse/ClickHouse/pull/12745) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了大型元组的性能问题：它们在 `IN` 子句中会被解释为函数。即用户出于某种难以理解的原因，写成 `WHERE x IN tuple(1, 2, ...)` 而不是 `WHERE x IN (1, 2, ...)` 的情况。[#12700](https://github.com/ClickHouse/ClickHouse/pull/12700) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 `input&#95;format&#95;parallel&#95;parsing` 的内存跟踪问题 (通过将线程关联到组) 。[#12672](https://github.com/ClickHouse/ClickHouse/pull/12672) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 `any(func(<lambda>))` 情况下错误应用的优化 `optimize_move_functions_out_of_any=1`。 [#12664](https://github.com/ClickHouse/ClickHouse/pull/12664) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了 [#10572](https://github.com/ClickHouse/ClickHouse/issues/10572) 中布隆过滤器索引在使用常量表达式时的问题。[#12659](https://github.com/ClickHouse/ClickHouse/pull/12659) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 StorageKafka 在 broker 不可用时 (以及不止这种情况) 发生的 SIGSEGV。[#12658](https://github.com/ClickHouse/ClickHouse/pull/12658) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了对带有 `Array(UUID)` 参数的 `if` 函数的支持。此修复解决了 [#11066](https://github.com/ClickHouse/ClickHouse/issues/11066)。[#12648](https://github.com/ClickHouse/ClickHouse/pull/12648) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* CREATE USER IF NOT EXISTS 现在在用户已存在时不再抛出异常。此修复解决了 [#12507](https://github.com/ClickHouse/ClickHouse/issues/12507)。[#12646](https://github.com/ClickHouse/ClickHouse/pull/12646) ([Vitaly Baranov](https://github.com/vitlibar)).
* 在一些意外情况下，执行 `ALTER ... UPDATE` 时可能会抛出 `There is no supertype...` 异常 (例如对 UInt64 列做减法时) 。此项修复了 [#7306](https://github.com/ClickHouse/ClickHouse/issues/7306)。此项修复了 [#4165](https://github.com/ClickHouse/ClickHouse/issues/4165)。[#12633](https://github.com/ClickHouse/ClickHouse/pull/12633) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用外部排序的查询可能出现的 `Pipeline stuck` 错误。修复 [#12617](https://github.com/ClickHouse/ClickHouse/issues/12617)。[#12618](https://github.com/ClickHouse/ClickHouse/pull/12618) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `OPTIMIZE DEDUPLICATE` 的错误：`Output of TreeExecutor is not sorted`。修复 [#11572](https://github.com/ClickHouse/ClickHouse/issues/11572)。[#12613](https://github.com/ClickHouse/ClickHouse/pull/12613) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在查询优化过程中，函数 `any` 结果的别名可能丢失的问题。[#12593](https://github.com/ClickHouse/ClickHouse/pull/12593) ([Anton Popov](https://github.com/CurtizJ)).
* 在 DROP TABLE 时删除分布式表中的数据 (异步 INSERT 产生的块) 。[#12556](https://github.com/ClickHouse/ClickHouse/pull/12556) ([Azat Khuzhin](https://github.com/azat)).
* 现在，当文件 `checksums.txt` 缺失时，ClickHouse 会重新计算 parts 的校验和。该问题自 [#9827](https://github.com/ClickHouse/ClickHouse/issues/9827) 起一直存在。[#12545](https://github.com/ClickHouse/ClickHouse/pull/12545) ([alesapin](https://github.com/alesapin)) 。
* 修复了在 `enable_mixed_granularity_parts=1` 时，执行 `ALTER DELETE` 查询后旧 parts 损坏的问题。修复 [#12536](https://github.com/ClickHouse/ClickHouse/issues/12536)。[#12543](https://github.com/ClickHouse/ClickHouse/pull/12543) ([alesapin](https://github.com/alesapin)) 。
* 修复了 live view 表中的竞态条件，该问题可能导致数据重复。LIVE VIEW 是一项 Experimental 功能。 [#12519](https://github.com/ClickHouse/ClickHouse/pull/12519) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 修复了 `AggregateFunction(avg, ...)` 值的 binary format 向后兼容性。此修复解决了 [#12342](https://github.com/ClickHouse/ClickHouse/issues/12342)。[#12486](https://github.com/ClickHouse/ClickHouse/pull/12486) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用字典进行 JOIN 时，若连接条件基于字典键表达式而导致的崩溃问题：`t JOIN dict ON expr(dict.id) = t.id`。在这种情况下禁用字典连接优化。[#12458](https://github.com/ClickHouse/ClickHouse/pull/12458) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了在指定非常大的 LIMIT 或 OFFSET 时发生的溢出问题。此修复解决了 [#10470](https://github.com/ClickHouse/ClickHouse/issues/10470)。此修复解决了 [#11372](https://github.com/ClickHouse/ClickHouse/issues/11372)。[#12427](https://github.com/ClickHouse/ClickHouse/pull/12427) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* kafka：修复了当批次中间存在带有错误的消息时发生 SIGSEGV 的问题。 [#12302](https://github.com/ClickHouse/ClickHouse/pull/12302) ([Azat Khuzhin](https://github.com/azat)).

<div id="improvement">
  #### 改进
</div>

* 在 ZooKeeper 中保留更少的日志。在服务器/表/插入操作较多且存在离线副本时，避免 ZooKeeper 节点过度膨胀。[#13100](https://github.com/ClickHouse/ClickHouse/pull/13100) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在，如果在 ALTER 或变更期间发生错误，异常将转发给客户端。已关闭 [#11329](https://github.com/ClickHouse/ClickHouse/issues/11329)。[#12666](https://github.com/ClickHouse/ClickHouse/pull/12666) ([alesapin](https://github.com/alesapin)) 。
* 将 `QueryTimeMicroseconds`、`SelectQueryTimeMicroseconds` 和 `InsertQueryTimeMicroseconds` 添加到 `system.events`、system.metrics、processes、query\_log 等中。[#13028](https://github.com/ClickHouse/ClickHouse/pull/13028) ([ianton-ru](https://github.com/ianton-ru)) 。
* 在 `system.events` 中添加了 `SelectedRows` 和 `SelectedBytes`，system.metrics、processes、query\_log 等中也已添加。[#12638](https://github.com/ClickHouse/ClickHouse/pull/12638) ([ianton-ru](https://github.com/ianton-ru)) 。
* 在 `system.query_log` 中新增了 `current_database` 信息。[#12652](https://github.com/ClickHouse/ClickHouse/pull/12652) ([Amos Bird](https://github.com/amosbird)) 。
* 支持将 `TabSeparatedRaw` 作为输入格式。[#12009](https://github.com/ClickHouse/ClickHouse/pull/12009) ([hcz](https://github.com/hczhcz)).
* 现在，`joinGet` 已支持多键查找。[#12418](https://github.com/ClickHouse/ClickHouse/pull/12418) ([Amos Bird](https://github.com/amosbird)) 。
* 支持对包含 NULL 的 Arrays 使用 `*Map` 聚合函数。修复了 [#13157](https://github.com/ClickHouse/ClickHouse/issues/13157)。[#13225](https://github.com/ClickHouse/ClickHouse/pull/13225) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 避免在解析 DateTime 值时发生 overflow，否则会在其 timezone 中导致负的 Unix timestamp (例如 Moscow 时区中的 `1970-01-01 00:00:00`) 。现在会改为截断到零。此项修复了 [#3470](https://github.com/ClickHouse/ClickHouse/issues/3470)。此项修复了 [#4172](https://github.com/ClickHouse/ClickHouse/issues/4172)。[#12443](https://github.com/ClickHouse/ClickHouse/pull/12443) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* AvroConfluent：跳过 Kafka 墓碑记录 - 支持跳过损坏记录 [#13203](https://github.com/ClickHouse/ClickHouse/pull/13203) ([Andrew Onyshchuk](https://github.com/oandrew)) 。
* 修复长查询返回错误报错信息的问题。对于正确的查询，原本可能会收到除 `Max query size exceeded` 之外的语法错误。 [#13928](https://github.com/ClickHouse/ClickHouse/pull/13928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复 `lgamma` 函数中的数据竞争。该竞争条件仅在 `tsan` 中检测到，实际上并未造成任何副作用。[#13842](https://github.com/ClickHouse/ClickHouse/pull/13842) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 ATTACH/ALTER/CREATE QUOTA 语句中 'Week' 时间间隔的格式化错误。[#13417](https://github.com/ClickHouse/ClickHouse/pull/13417) ([vladimir-golovchenko](https://github.com/vladimir-golovchenko)) 。
* 现在，在处理 compact part 时遇到损坏的 parts，也会将其报告出来。Compact parts 是一项 Experimental 功能。[#13282](https://github.com/ClickHouse/ClickHouse/pull/13282) ([Amos Bird](https://github.com/amosbird)).
* 修复了 `geohashesInBox` 中的断言问题。此修复解决了 [#12554](https://github.com/ClickHouse/ClickHouse/issues/12554)。[#13229](https://github.com/ClickHouse/ClickHouse/pull/13229) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `parseDateTimeBestEffort` 中的 assert。此修复解决了 [#12649](https://github.com/ClickHouse/ClickHouse/issues/12649)。[#13227](https://github.com/ClickHouse/ClickHouse/pull/13227) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 对 Processors/PipelineExecutor 做了一项小优化：在合适的时候跳出循环。 [#13058](https://github.com/ClickHouse/ClickHouse/pull/13058) ([Mark Papadakis](https://github.com/markpapadakis)).
* 支持省略 TABLE 关键字执行 TRUNCATE 表。[#12653](https://github.com/ClickHouse/ClickHouse/pull/12653) ([Winter Zhang](https://github.com/zhang2014)).
* 修复默认会覆盖 EXPLAIN 查询 format 的问题。此修复解决了 [#12541](https://github.com/ClickHouse/ClickHouse/issues/12432)。[#12541](https://github.com/ClickHouse/ClickHouse/pull/12541) ([BohuTANG](https://github.com/BohuTANG)) 。
* 支持以更标准的方式指定 JOIN 的 kind 和 type：使用 `LEFT SEMI JOIN` 而不是 `SEMI LEFT JOIN`。目前这两种写法都正确。[#12520](https://github.com/ClickHouse/ClickHouse/pull/12520) ([Artem Zuikov](https://github.com/4ertus2)).
* 将 `multiple_joins_rewriter_version` 的默认值改为 2。这样会启用新的多 JOIN 重写器，该重写器能够识别列名。[#12469](https://github.com/ClickHouse/ClickHouse/pull/12469) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 为 S3 存储请求新增了若干指标。[#12464](https://github.com/ClickHouse/ClickHouse/pull/12464) ([ianton-ru](https://github.com/ianton-ru)).
* 为带有 `--secure` 参数的 clickhouse-benchmark 使用正确的默认安全端口。此项修复解决了 [#11044](https://github.com/ClickHouse/ClickHouse/issues/11044)。[#12440](https://github.com/ClickHouse/ClickHouse/pull/12440) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 `Log`、`TinyLog` 和 `StripeLog` 引擎中，插入出错时会执行回滚。在之前的版本中，插入错误会导致表状态不一致 (这符合文档说明，对这些表引擎而言属于正常情况) 。此修复解决了 [#12402](https://github.com/ClickHouse/ClickHouse/issues/12402)。[#12426](https://github.com/ClickHouse/ClickHouse/pull/12426) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `Atomic` 数据库引擎实现 `RENAME DATABASE` 和 `RENAME DICTIONARY` - 添加隐式 `{uuid}` 宏，可在 `ReplicatedMergeTree` 的 ZooKeeper 路径中使用。它适用于 `CREATE ... ON CLUSTER ...` 查询。将 `show_table_uuid_in_table_create_query_if_not_nil` 设置为 `true` 即可使用。- 将 `ReplicatedMergeTree` 的引擎参数设为可选，默认使用 `/clickhouse/tables/{uuid}/{shard}/` 和 `{replica}`。关闭 [#12135](https://github.com/ClickHouse/ClickHouse/issues/12135)。- 小修复。- 这些变更破坏了 `Atomic` 数据库引擎的向后兼容性。此前创建的 `Atomic` 数据库必须手动转换为新格式。`Atomic` 数据库是一项实验性功能。[#12343](https://github.com/ClickHouse/ClickHouse/pull/12343) ([tavplubix](https://github.com/tavplubix)).
* 将 `AWSAuthV4Signer` 拆分到单独的 logger 中，并移除了日志消息中过多的 `AWSClient: AWSClient`。[#12320](https://github.com/ClickHouse/ClickHouse/pull/12320) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 改进了磁盘访问存储中的异常提示信息。[#12625](https://github.com/ClickHouse/ClickHouse/pull/12625) ([alesapin](https://github.com/alesapin)) 。
* 当函数 `in` 的参数数量无效时，会提供更清晰的异常信息。[#12529](https://github.com/ClickHouse/ClickHouse/pull/12529) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了有关自适应粒度的错误信息。[#12624](https://github.com/ClickHouse/ClickHouse/pull/12624) ([alesapin](https://github.com/alesapin)).
* 修复了 FORMAT 后 SETTINGS 的解析问题。[#12480](https://github.com/ClickHouse/ClickHouse/pull/12480) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果 MergeTree 表不包含 ORDER BY 或 PARTITION BY，则在对所有列执行 CLEAR 的 ALTER 请求时，ALTER 可能会卡住。现已修复 [#7941](https://github.com/ClickHouse/ClickHouse/issues/7941)。[#12382](https://github.com/ClickHouse/ClickHouse/pull/12382) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 避免在每次查询后都从历史文件中重新加载自动补全 (以免与其他客户端会话的历史记录发生重叠) 。[#13086](https://github.com/ClickHouse/ClickHouse/pull/13086) ([Azat Khuzhin](https://github.com/azat)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 某些操作的内存使用量最多可降低 2 倍。[#12424](https://github.com/ClickHouse/ClickHouse/pull/12424) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 优化精确匹配 PK 范围的查询的 PK 查找。[#12277](https://github.com/ClickHouse/ClickHouse/pull/12277) ([Ivan Babrou](https://github.com/bobrik)).
* 对带有 `LowCardinality` 的超短查询做了轻微优化。[#14129](https://github.com/ClickHouse/ClickHouse/pull/14129) ([Anton Popov](https://github.com/CurtizJ)).
* 略微提升了按 UInt8/UInt16 键进行 aggregation 的性能。[#13091](https://github.com/ClickHouse/ClickHouse/pull/13091) 和 [#13055](https://github.com/ClickHouse/ClickHouse/pull/13055) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在查询计划中对 `LIMIT` step 实现下推 (子查询内部) 。[#13016](https://github.com/ClickHouse/ClickHouse/pull/13016) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 在 parts 上并行执行主键查找和跳过索引阶段，如 [#11564](https://github.com/ClickHouse/ClickHouse/issues/11564) 中所述。[#12589](https://github.com/ClickHouse/ClickHouse/pull/12589) ([Ivan Babrou](https://github.com/bobrik)).
* 当 `set optimize_if_transform_strings_to_enum = 1` 时，将函数 "if" 和 "transform" 的 String 类型 argument 转换为枚举。[#12515](https://github.com/ClickHouse/ClickHouse/pull/12515) ([Artem Zuikov](https://github.com/4ertus2)).
* 当 `set optimize_monotonous_functions_in_order_by=1` 时，在 `ORDER BY` 中将单调函数替换为其 argument。[#12467](https://github.com/ClickHouse/ClickHouse/pull/12467) ([Artem Zuikov](https://github.com/4ertus2)).
* 新增 order by 优化：当 `set optimize_redundant_functions_in_order_by = 1` 时，将 `ORDER BY x, f(x)` 重写为 `ORDER by x`。[#12404](https://github.com/ClickHouse/ClickHouse/pull/12404) ([Artem Zuikov](https://github.com/4ertus2)).
* 当子查询包含 `WITH` clause 时，允许 predicate 下推。此修复解决了 [#12293](https://github.com/ClickHouse/ClickHouse/issues/12293) [#12663](https://github.com/ClickHouse/ClickHouse/pull/12663) ([Winter Zhang](https://github.com/zhang2014)).
* 提升从 compact parts 读取数据的性能。Compact parts 是一项 Experimental 功能。[#12492](https://github.com/ClickHouse/ClickHouse/pull/12492) ([Anton Popov](https://github.com/CurtizJ)).
* 尝试在 `DiskS3` 中实现流式优化。DiskS3 是一项 Experimental 功能。[#12434](https://github.com/ClickHouse/ClickHouse/pull/12434) ([Vladimir Chebotarev](https://github.com/excitoon)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 使用 `shellcheck` 对 sh 测试进行 lint 检查。[#13200](https://github.com/ClickHouse/ClickHouse/pull/13200) [#13207](https://github.com/ClickHouse/ClickHouse/pull/13207) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 添加了一个脚本，用于在 GitHub hook 中为拉取请求设置标签。[#13183](https://github.com/ClickHouse/ClickHouse/pull/13183) ([alesapin](https://github.com/alesapin)) 。
* 删除了部分递归子模块。参见 [#13378](https://github.com/ClickHouse/ClickHouse/issues/13378)。[#13379](https://github.com/ClickHouse/ClickHouse/pull/13379) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 确保所有子模块都来自正确的 URL。[#13379](https://github.com/ClickHouse/ClickHouse/issues/13379) 的后续内容。此修复解决了 [#13378](https://github.com/ClickHouse/ClickHouse/issues/13378)。[#13397](https://github.com/ClickHouse/ClickHouse/pull/13397) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了对用户自定义设置的支持，这些设置可在查询内部访问。当 ClickHouse engine 用作另一个系统的组件时，此功能是必需的。[#13013](https://github.com/ClickHouse/ClickHouse/pull/13013) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在 TestFlows 中新增了对 INSERT 权限 RBAC 功能的测试。扩展了进行 SELECT 测试的表范围。新增了 Requirements，以匹配新的表引擎测试。[#13340](https://github.com/ClickHouse/ClickHouse/pull/13340) ([MyroTk](https://github.com/MyroTk)).
* 修复压力测试中服务器重启期间的超时错误。[#13321](https://github.com/ClickHouse/ClickHouse/pull/13321) ([alesapin](https://github.com/alesapin)) 。
* 现在，快速测试会通过重试来等待服务器。 [#13284](https://github.com/ClickHouse/ClickHouse/pull/13284) ([alesapin](https://github.com/alesapin)).
* 函数 `materialize()` (用于 ClickHouse 测试的函数) 现在可以按预期处理 NULL——将其转换为非常量列。[#13212](https://github.com/ClickHouse/ClickHouse/pull/13212) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 AArch64 上的 libunwind 构建问题。此项修复解决了 [#13204](https://github.com/ClickHouse/ClickHouse/issues/13204)。[#13208](https://github.com/ClickHouse/ClickHouse/pull/13208) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 在 zkutil gtest 中进一步增加重试次数，以减少测试不稳定性。[#13165](https://github.com/ClickHouse/ClickHouse/pull/13165) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 对 RBAC TestFlows 进行了一些小修复。[#13152](https://github.com/ClickHouse/ClickHouse/pull/13152) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 修复 `00960_live_view_watch_events_live.py` 测试。[#13108](https://github.com/ClickHouse/ClickHouse/pull/13108) ([vzakaznikov](https://github.com/vzakaznikov)).
* 优化文档部署脚本中的缓存清理。[#13107](https://github.com/ClickHouse/ClickHouse/pull/13107) ([alesapin](https://github.com/alesapin)) 。
* 将一些独立测试重写为 gtest。移除了测试中无用的 include。[#13073](https://github.com/ClickHouse/ClickHouse/pull/13073) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 新增了 TestFlows 中针对 `SELECT` 权限的 RBAC 功能测试。[#13061](https://github.com/ClickHouse/ClickHouse/pull/13061) ([Ritaank Tiwari](https://github.com/ritaank)) 。
* 在快速测试检查中重新运行了部分测试。[#12992](https://github.com/ClickHouse/ClickHouse/pull/12992) ([alesapin](https://github.com/alesapin)) 。
* 修复了 "rdkafka" 库中的 MSan 错误。此更改解决了 [#12990](https://github.com/ClickHouse/ClickHouse/issues/12990)。`rdkafka` 已更新至 1.5 版本 (master) 。[#12991](https://github.com/ClickHouse/ClickHouse/pull/12991) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在支持 AVX-512 的服务器上运行测试时 base64 中的 UBSan 报告问题。此修复解决了 [#12318](https://github.com/ClickHouse/ClickHouse/issues/12318)。作者：@qoega。 [#12441](https://github.com/ClickHouse/ClickHouse/pull/12441) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 HDFS 库中的 UBSan 报告。此修复关闭了 [#12330](https://github.com/ClickHouse/ClickHouse/issues/12330)。[#12453](https://github.com/ClickHouse/ClickHouse/pull/12453) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 检查了是否能够将旧版本的备份恢复到新版本中。这解决了 [#8979](https://github.com/ClickHouse/ClickHouse/issues/8979)。[#12959](https://github.com/ClickHouse/ClickHouse/pull/12959) ([alesapin](https://github.com/alesapin)) 。
* 不要在集成测试中构建 helper\_container 镜像。应在 CI 中构建 Docker 容器，并在集成测试中使用预先构建好的 helper\_container。[#12953](https://github.com/ClickHouse/ClickHouse/pull/12953) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 为针对主键列的 `ALTER TABLE CLEAR COLUMN` 查询添加测试。[#12951](https://github.com/ClickHouse/ClickHouse/pull/12951) ([alesapin](https://github.com/alesapin)) 。
* 延长了 testflows 测试的超时时间。[#12949](https://github.com/ClickHouse/ClickHouse/pull/12949) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 修复了 Mac OS X 下测试构建的问题。此变更关闭了 [#12767](https://github.com/ClickHouse/ClickHouse/issues/12767)。[#12772](https://github.com/ClickHouse/ClickHouse/pull/12772) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* Connector-ODBC 已升级到 mysql-connector-odbc-8.0.21。[#12739](https://github.com/ClickHouse/ClickHouse/pull/12739) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 在 TestFlows 中新增 RBAC 语法测试。[#12642](https://github.com/ClickHouse/ClickHouse/pull/12642) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 提升 TestKeeper 的性能。这将加快大量使用 Replicated 表的测试。[#12505](https://github.com/ClickHouse/ClickHouse/pull/12505) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在会检查 server 在压力测试后能否启动。这修复了 [#12473](https://github.com/ClickHouse/ClickHouse/issues/12473)。[#12496](https://github.com/ClickHouse/ClickHouse/pull/12496) ([alesapin](https://github.com/alesapin)) 。
* 将 fmtlib 更新到 master 分支 (7.0.1) 。[#12446](https://github.com/ClickHouse/ClickHouse/pull/12446) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为快速测试添加了 Docker 镜像。[#12294](https://github.com/ClickHouse/ClickHouse/pull/12294) ([alesapin](https://github.com/alesapin)) 。
* 调整集成测试的配置路径。[#12285](https://github.com/ClickHouse/ClickHouse/pull/12285) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 添加了一个编译器选项，用于控制栈帧大小不要过大。这将有助于在栈空间较小的 fiber 中运行代码。[#11524](https://github.com/ClickHouse/ClickHouse/pull/11524) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 更新 gitignore-files 文件。[#13447](https://github.com/ClickHouse/ClickHouse/pull/13447) ([vladimir-golovchenko](https://github.com/vladimir-golovchenko)) 。

<div id="clickhouse-release-206">
  ## ClickHouse 20.6 发行版
</div>

<div id="clickhouse-release-v206328-stable">
  ### ClickHouse 版本发布 v20.6.3.28-稳定版本
</div>

<div id="backward-incompatible-change">
  #### 向后不兼容变更
</div>

* 从低于 20.5 的版本升级时，如果执行滚动更新，且集群中同时存在 20.5 及以上版本和低于 20.5 的版本，那么在较新版本节点已存在的情况下重启旧版本 ClickHouse 节点，并让旧版本启动，可能会导致 `Part ... intersects previous part` 错误。为避免此错误，请先在集群的所有节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature">
  #### 新功能
</div>

* 新增了 `EXPLAIN` 查询的初始实现。语法：`EXPLAIN SELECT ...`。修复了 [#1118](https://github.com/ClickHouse/ClickHouse/issues/1118)。[#11873](https://github.com/ClickHouse/ClickHouse/pull/11873) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 新增了 `RabbitMQ` 存储。[#11069](https://github.com/ClickHouse/ClickHouse/pull/11069) ([Kseniia Sumarokova](https://github.com/kssenii))。
* 针对 [#11710](https://github.com/ClickHouse/ClickHouse/issues/11710) 实现了类似 PostgreSQL 的 `ILIKE` 运算符。[#12125](https://github.com/ClickHouse/ClickHouse/pull/12125) ([Mike](https://github.com/myrrc))。
* 支持在 `SET join_algorithm = 'partial_merge'` 时使用 RIGHT 和 FULL JOIN。仅允许 ALL strictness (不支持 ANY、SEMI、ANTI、ASOF) 。[#12118](https://github.com/ClickHouse/ClickHouse/pull/12118) ([Artem Zuikov](https://github.com/4ertus2))。
* 新增函数 `initializeAggregation`，用于根据单个值初始化聚合。[#12109](https://github.com/ClickHouse/ClickHouse/pull/12109) ([Guillaume Tassery](https://github.com/YiuRULE))。
* 支持 `ALTER TABLE ... [ADD|MODIFY] COLUMN ... FIRST`。[#4006](https://github.com/ClickHouse/ClickHouse/issues/4006)。[#12073](https://github.com/ClickHouse/ClickHouse/pull/12073) ([Winter Zhang](https://github.com/zhang2014))。
* 新增函数 `parseDateTimeBestEffortUS`。[#12028](https://github.com/ClickHouse/ClickHouse/pull/12028) ([flynn](https://github.com/ucasFL))。
* 支持将 `ORC` format 用于输出 (此前仅支持输入) 。[#11662](https://github.com/ClickHouse/ClickHouse/pull/11662) ([Kruglov Pavel](https://github.com/Avogar))。

<div id="bug-fix-23">
  #### 问题修复
</div>

* 修复了在启用 `SET optimize_move_functions_out_of_any = 1` 且 `any()` 中包含别名时出现的 `aggregate function any(x) is found inside another aggregate function in query` 错误。[#13419](https://github.com/ClickHouse/ClickHouse/pull/13419) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了 clickhouse-local 中的 `PrettyCompactMonoBlock`。修复了 `PrettyCompactMonoBlock` 中的 extremes/总计问题。此修复解决了 [#7746](https://github.com/ClickHouse/ClickHouse/issues/7746)。[#13394](https://github.com/ClickHouse/ClickHouse/pull/13394) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了查询延迟副本时可能出现的错误：`Totals having transform was already added to pipeline`。[#13290](https://github.com/ClickHouse/ClickHouse/pull/13290) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果用户向函数 `h3ToChildren` 传入特制参数，服务器可能会崩溃。此修复解决了 [#13275](https://github.com/ClickHouse/ClickHouse/issues/13275)。[#13277](https://github.com/ClickHouse/ClickHouse/pull/13277) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在包含 NaN 值的 Float 类型上调用 `uniqExact`、`topK`、`sumDistinct` 及类似 aggregate functions 时，可能出现的性能较低和结果略有偏差的问题。该问题还会在 debug 构建中触发断言。此修复解决了 [#12491](https://github.com/ClickHouse/ClickHouse/issues/12491)。[#13254](https://github.com/ClickHouse/ClickHouse/pull/13254) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在 cond 为 nullable constexpr 且不是字面量 NULL 时，函数 if 的问题。修复 [#12463](https://github.com/ClickHouse/ClickHouse/issues/12463)。[#13226](https://github.com/ClickHouse/ClickHouse/pull/13226) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `arrayElement` 函数中的断言错误，该错误会在数组元素为 Nullable 且数组下标也为 Nullable 时触发。此修复解决了 [#12172](https://github.com/ClickHouse/ClickHouse/issues/12172)。[#13224](https://github.com/ClickHouse/ClickHouse/pull/13224) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `DateTime64` 在参数为常量时的转换函数问题。 [#13205](https://github.com/ClickHouse/ClickHouse/pull/13205) ([Azat Khuzhin](https://github.com/azat)).
* 修复了涉及函数的错误索引分析问题。该问题在读取 `MergeTree` 表时，可能导致错误地剪枝 parts。修复 [#13060](https://github.com/ClickHouse/ClickHouse/issues/13060)。修复 [#12406](https://github.com/ClickHouse/ClickHouse/issues/12406)。[#13081](https://github.com/ClickHouse/ClickHouse/pull/13081) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了远程查询中的一个错误：当在查询作用域内使用的函数在单次查询中是确定性的、但在不同查询之间不是确定性的 (例如 `now()`、`now64()`、`randConstant()`) 时，会报错 `Cannot convert column because it is constant but values of constants are different in source and result`。修复了 [#11327](https://github.com/ClickHouse/ClickHouse/issues/11327)。[#13075](https://github.com/ClickHouse/ClickHouse/pull/13075) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从本地副本查询时对线程数进行不必要限制的问题。[#12840](https://github.com/ClickHouse/ClickHouse/pull/12840) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个罕见的 bug：当 `ALTER DELETE` 和 `ALTER MODIFY COLUMN` 查询同时执行并作为一次变更处理时，会导致 `count.txt` 中的行数错误，进而造成 part 中的数据不正确。另修复了 `ALTER RENAME COLUMN` 与 `ALTER ADD COLUMN` 同时执行时的一个小 bug。[#12760](https://github.com/ClickHouse/ClickHouse/pull/12760) ([alesapin](https://github.com/alesapin)).
* 修复了 `CAST(Nullable(String), Enum())`。[#12745](https://github.com/ClickHouse/ClickHouse/pull/12745) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `IN` 子句中将大型元组误解释为函数时的性能问题。具体来说，就是用户出于某些不太常见的原因，写成 `WHERE x IN tuple(1, 2, ...)` 而不是 `WHERE x IN (1, 2, ...)` 的情况。[#12700](https://github.com/ClickHouse/ClickHouse/pull/12700) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `input_format_parallel_parsing` 的内存跟踪问题 (通过将线程关联到组) 。[#12672](https://github.com/ClickHouse/ClickHouse/pull/12672) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 bloom filter 索引在 const expression 下的问题。此修复对应 [#10572](https://github.com/ClickHouse/ClickHouse/issues/10572)。[#12659](https://github.com/ClickHouse/ClickHouse/pull/12659) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `StorageKafka` 在 broker 不可用等情况下出现的 `SIGSEGV`。[#12658](https://github.com/ClickHouse/ClickHouse/pull/12658) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了对参数为 `Array(UUID)` 的函数 `if` 的支持。此修复解决了 [#11066](https://github.com/ClickHouse/ClickHouse/issues/11066)。[#12648](https://github.com/ClickHouse/ClickHouse/pull/12648) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `CREATE USER IF NOT EXISTS` 现在在用户已存在时不再抛出异常。此修复解决了 [#12507](https://github.com/ClickHouse/ClickHouse/issues/12507)。[#12646](https://github.com/ClickHouse/ClickHouse/pull/12646) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 改进了磁盘访问存储中的异常信息。 [#12625](https://github.com/ClickHouse/ClickHouse/pull/12625) ([alesapin](https://github.com/alesapin)).
* 函数 `groupArrayMoving*` 在 distributed queries 中无法正常工作。其结果会以错误的 Data type 进行计算 (未提升到最大类型) 。函数 `groupArrayMovingAvg` 返回的是整数，与 `avg` 函数的结果不一致。此项修复了 [#12568](https://github.com/ClickHouse/ClickHouse/issues/12568)。[#12622](https://github.com/ClickHouse/ClickHouse/pull/12622) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了函数 `any` 没有别名的问题。[#12593](https://github.com/ClickHouse/ClickHouse/pull/12593) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `cache` 布局外部字典中的竞态条件，该问题可能导致服务器崩溃。[#12566](https://github.com/ClickHouse/ClickHouse/pull/12566) ([alesapin](https://github.com/alesapin)).
* 在 DROP TABLE 时，删除分布式表的数据 (异步 INSERT 产生的块) 。[#12556](https://github.com/ClickHouse/ClickHouse/pull/12556) ([Azat Khuzhin](https://github.com/azat)).
* 修复了一个 bug：当 `enable_mixed_granularity_parts=1` 时，`ALTER DELETE` 查询会导致旧 parts 损坏。修复了 [#12536](https://github.com/ClickHouse/ClickHouse/issues/12536)。[#12543](https://github.com/ClickHouse/ClickHouse/pull/12543) ([alesapin](https://github.com/alesapin)) 。
* 对于参数数量不正确的函数 `in`，改进了异常提示。[#12529](https://github.com/ClickHouse/ClickHouse/pull/12529) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 live view 表中的竞态条件问题，该问题可能会导致数据重复。[#12519](https://github.com/ClickHouse/ClickHouse/pull/12519) ([vzakaznikov](https://github.com/vzakaznikov)).
* 修复了读取 compact parts 时的性能问题。[#12492](https://github.com/ClickHouse/ClickHouse/pull/12492) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `AggregateFunction(avg, ...)` 值的 binary format 向后兼容性问题。此修复解决了 [#12342](https://github.com/ClickHouse/ClickHouse/issues/12342)。[#12486](https://github.com/ClickHouse/ClickHouse/pull/12486) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 FORMAT 后 SETTINGS 的解析问题。[#12480](https://github.com/ClickHouse/ClickHouse/pull/12480) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了启用 `text_log` 时发生的死锁问题。[#12452](https://github.com/ClickHouse/ClickHouse/pull/12452) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在指定非常大的 `LIMIT` 或 `OFFSET` 时出现的溢出问题。此修复解决了 [#10470](https://github.com/ClickHouse/ClickHouse/issues/10470) 和 [#11372](https://github.com/ClickHouse/ClickHouse/issues/11372)。[#12427](https://github.com/ClickHouse/ClickHouse/pull/12427) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 修复了 `StorageMerge` 可能导致段错误的问题。此修复对应 [#12054](https://github.com/ClickHouse/ClickHouse/issues/12054)。[#12401](https://github.com/ClickHouse/ClickHouse/pull/12401) ([tavplubix](https://github.com/tavplubix)) 。
* 已撤销在 [#11079](https://github.com/ClickHouse/ClickHouse/issues/11079) 中引入的更改，以修复 [#12098](https://github.com/ClickHouse/ClickHouse/issues/12098)。[#12397](https://github.com/ClickHouse/ClickHouse/pull/12397) ([Mike](https://github.com/myrrc)) 。
* 对布隆过滤器索引参数进行了额外检查。这修复了 [#11408](https://github.com/ClickHouse/ClickHouse/issues/11408)。[#12388](https://github.com/ClickHouse/ClickHouse/pull/12388) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 避免在有索引的表中使用包含负数或浮点常量的 WHERE 条件时引发异常。此修复解决了 [#11905](https://github.com/ClickHouse/ClickHouse/issues/11905)。[#12384](https://github.com/ClickHouse/ClickHouse/pull/12384) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 即使存在依赖它的 `DEFAULT` 表达式，也允许对列执行 `CLEAR`。此修复见 [#12333](https://github.com/ClickHouse/ClickHouse/issues/12333)。[#12378](https://github.com/ClickHouse/ClickHouse/pull/12378) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在 `TOTALS/ROLLUP/CUBE` 中使用带有 `-State` 和 `Nullable` 参数的聚合函数时出现的问题。此修复解决了 [#12163](https://github.com/ClickHouse/ClickHouse/issues/12163)。[#12376](https://github.com/ClickHouse/ClickHouse/pull/12376) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在不允许 `RENAME` 时，`ALTER RENAME COLUMN` 查询的错误信息和退出代码。修复了 [#12301](https://github.com/ClickHouse/ClickHouse/issues/12301) 和 [#12303](https://github.com/ClickHouse/ClickHouse/issues/12303)。[#12335](https://github.com/ClickHouse/ClickHouse/pull/12335) ([alesapin](https://github.com/alesapin)) 。
* 修复了 `ReplicatedMergeTreeQueue` 中一个极少出现的竞态条件。[#12315](https://github.com/ClickHouse/ClickHouse/pull/12315) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 当对非固定宽度类型使用编解码器 `Delta` 或 `DoubleDelta` 时，此前返回的异常代码是 `LOGICAL_ERROR`，而不是 `BAD_ARGUMENTS` (我们保证绝不会出现代码为 `LOGICAL_ERROR` 的异常) 。此问题已在 [#12110](https://github.com/ClickHouse/ClickHouse/issues/12110) 中修复。[#12308](https://github.com/ClickHouse/ClickHouse/pull/12308) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `WITH FILL` 修饰符中的列顺序问题。此前不会遵循 `ORDER BY` 语句中的列顺序。[#12306](https://github.com/ClickHouse/ClickHouse/pull/12306) ([Anton Popov](https://github.com/CurtizJ)).
* 当存在按虚拟列 (例如 `Merge` 表中的 `_table`) 或系统表中的“索引”列来过滤数据的表达式时 (例如从 `system.tables` 查询时按数据库名称过滤) ，且该表达式返回 `Nullable` 类型，可避免出现 "bad cast" 异常。此修复解决了 [#12166](https://github.com/ClickHouse/ClickHouse/issues/12166)。[#12305](https://github.com/ClickHouse/ClickHouse/pull/12305) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在重命名 `TTL` 表达式所依赖的列后，`TTL` 表达式失效的问题。[#12304](https://github.com/ClickHouse/ClickHouse/pull/12304) ([Anton Popov](https://github.com/CurtizJ))。
* 修复了 `Kafka` 引擎中批次中间某条消息出错时会触发 SIGSEGV 的问题。[#12302](https://github.com/ClickHouse/ClickHouse/pull/12302) ([Azat Khuzhin](https://github.com/azat)).
* 修复了一种情况：某些线程在更新 `DNS` 缓存期间，可能会随机挂起几秒钟。[#12296](https://github.com/ClickHouse/ClickHouse/pull/12296) ([tavplubix](https://github.com/tavplubix)).
* 修复了设置名称中的拼写错误。 [#12292](https://github.com/ClickHouse/ClickHouse/pull/12292) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `TrieDictionary` 加载失败后会显示错误信息。[#12290](https://github.com/ClickHouse/ClickHouse/pull/12290) ([Vitaly Baranov](https://github.com/vitlibar)).
* 函数 `arrayFill` 在处理空数组时存在错误，可能会导致崩溃。此修复解决了 [#12263](https://github.com/ClickHouse/ClickHouse/issues/12263)。[#12279](https://github.com/ClickHouse/ClickHouse/pull/12279) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `LowCardinality` 类型实现了向公共类型的转换。这样即可对包含 `LowCardinality` 列和其他列的表执行 UNION ALL。此修复解决了 [#8212](https://github.com/ClickHouse/ClickHouse/issues/8212)。此修复解决了 [#4342](https://github.com/ClickHouse/ClickHouse/issues/4342)。[#12275](https://github.com/ClickHouse/ClickHouse/pull/12275) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了向 `S3` 存储发起请求时达到重定向次数上限后的处理行为。 [#12256](https://github.com/ClickHouse/ClickHouse/pull/12256) ([ianton-ru](https://github.com/ianton-ru)).
* 修复了在 `StorageFile` 中进行多次连续插入时，某些特殊类型的头信息会被重复写入的问题。此修复解决了 [#6155](https://github.com/ClickHouse/ClickHouse/issues/6155)。[#12197](https://github.com/ClickHouse/ClickHouse/pull/12197) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 UInt8 值不等于 0 或 1 时逻辑函数的错误。[#12196](https://github.com/ClickHouse/ClickHouse/pull/12196) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 将 max\_memory\_usage\* 的上限限制为进程常驻内存。[#12182](https://github.com/ClickHouse/ClickHouse/pull/12182) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复在消除 `GROUP BY` 注入函数时对 dictGet 参数的检查问题。[#12179](https://github.com/ClickHouse/ClickHouse/pull/12179) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `SummingMergeTree` 引擎对分区键中的列求和时的行为。现在，如果显式指定的求和列与分区键列有交集，则会抛出异常。此修复对应于 [#7867](https://github.com/ClickHouse/ClickHouse/issues/7867)。[#12173](https://github.com/ClickHouse/ClickHouse/pull/12173) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 如果 ODBC 连接不支持 schema，则不要将字典源的表名拆分为 schema 和表名。[#12165](https://github.com/ClickHouse/ClickHouse/pull/12165) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复了 `ALTER DELETE` 中的错误逻辑，该问题会在条件求值结果为 NULL 时误删记录。此修复解决了 [#9088](https://github.com/ClickHouse/ClickHouse/issues/9088)，并关闭了 [#12106](https://github.com/ClickHouse/ClickHouse/issues/12106)。[#12153](https://github.com/ClickHouse/ClickHouse/pull/12153) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在存在别名时，发送到外部 DBMS (例如 MySQL、ODBC) 的查询转换错误。此修复解决了 [#12032](https://github.com/ClickHouse/ClickHouse/issues/12032)。[#12151](https://github.com/ClickHouse/ClickHouse/pull/12151) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了冗余 ORDER BY 优化中的错误代码。该 bug 是在 [#10067](https://github.com/ClickHouse/ClickHouse/issues/10067) 中引入的。[#12148](https://github.com/ClickHouse/ClickHouse/pull/12148) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了整数除法中可能发生的溢出问题。此项修复解决了 [#12119](https://github.com/ClickHouse/ClickHouse/issues/12119)。[#12140](https://github.com/ClickHouse/ClickHouse/pull/12140) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `greatCircleDistance` 和 `geoDistance` 中可能导致无限循环的问题。此修复解决了 [#12117](https://github.com/ClickHouse/ClickHouse/issues/12117)。[#12137](https://github.com/ClickHouse/ClickHouse/pull/12137) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 规范化对 "pid" 文件的处理。在先前版本中，如果 server 在未正常关闭的情况下被杀掉，且另一个进程恰好使用了此前运行的 server 相同的 pid，server 可能会拒绝启动。此外，即使已有另一个 server 正在运行，在 server 启动失败时，pid 文件也可能被删除。此修复解决了 [#3501](https://github.com/ClickHouse/ClickHouse/issues/3501)。[#12133](https://github.com/ClickHouse/ClickHouse/pull/12133) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了一个会导致 ReplicatedVersionedCollapsingMergeTree 表在 ZooKeepeer 中的表元数据不正确的问题。修复 [#12093](https://github.com/ClickHouse/ClickHouse/issues/12093)。[#12121](https://github.com/ClickHouse/ClickHouse/pull/12121) ([alesapin](https://github.com/alesapin)).
* 避免在带有 JOIN，或带有附加到系统日志 (system.query\_log、metric\_log 等) 或 engine=Buffer 底层表的子查询的 materialized view 中出现 "There is no query" 异常。[#12120](https://github.com/ClickHouse/ClickHouse/pull/12120) ([filimonov](https://github.com/filimonov)) 。
* 修复了带有 ENGINE=Dictionary 的表对字典的依赖关系处理问题。此修复解决了 [#10994](https://github.com/ClickHouse/ClickHouse/issues/10994)。此修复解决了 [#10397](https://github.com/ClickHouse/ClickHouse/issues/10397)。[#12116](https://github.com/ClickHouse/ClickHouse/pull/12116) ([Vitaly Baranov](https://github.com/vitlibar))。
* `Parquet` 格式现已可正确处理 `LowCardinality` 和 `LowCardinality(Nullable)` 类型。修复了 [#12086](https://github.com/ClickHouse/ClickHouse/issues/12086)、[#8406](https://github.com/ClickHouse/ClickHouse/issues/8406)。[#12108](https://github.com/ClickHouse/ClickHouse/pull/12108) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了带有 `UNION` 的 `SELECT` 查询的性能问题，原因是线程总数限制设置错误。修复 [#12030](https://github.com/ClickHouse/ClickHouse/issues/12030)。[#12103](https://github.com/ClickHouse/ClickHouse/pull/12103) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `-StateResample` 组合器引发的段错误。[#12092](https://github.com/ClickHouse/ClickHouse/pull/12092) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `system.quey_log` 中 `SELECT` 查询的空 `result_rows` 和 `result_bytes` 指标。修复了 [#11595](https://github.com/ClickHouse/ClickHouse/issues/11595)。[#12089](https://github.com/ClickHouse/ClickHouse/pull/12089) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从 `VIEW` 执行 select 时不必要的线程数限制问题。修复了 [#11937](https://github.com/ClickHouse/ClickHouse/issues/11937)。[#12085](https://github.com/ClickHouse/ClickHouse/pull/12085) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 StorageKafka 在执行 `DROP TABLE` 时出现的 SIGSEGV。 [#12075](https://github.com/ClickHouse/ClickHouse/pull/12075) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 `PREWHERE` 中使用错误类型时可能导致的崩溃。修复 [#12053](https://github.com/ClickHouse/ClickHouse/issues/12053)、[#12060](https://github.com/ClickHouse/ClickHouse/issues/12060)。[#12060](https://github.com/ClickHouse/ClickHouse/pull/12060) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了高阶函数在使用 `Tuple(LowCardinality)` 参数时出现的 `Cannot capture column` 错误。修复 [#9766](https://github.com/ClickHouse/ClickHouse/issues/9766)。[#12055](https://github.com/ClickHouse/ClickHouse/pull/12055) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了对常量表达式约束的检查问题。此修复解决了 [#11360](https://github.com/ClickHouse/ClickHouse/issues/11360)。[#12042](https://github.com/ClickHouse/ClickHouse/pull/12042) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用不同长度的 `FixedString` 类型参数调用函数 `if` 时返回错误结果以及可能导致崩溃的问题。此修复解决了 [#11362](https://github.com/ClickHouse/ClickHouse/issues/11362)。[#12021](https://github.com/ClickHouse/ClickHouse/pull/12021) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。

<div id="improvement">
  #### 改进
</div>

* 允许以更标准的方式设置 `JOIN` kind 和 type：使用 `LEFT SEMI JOIN`，而不是 `SEMI LEFT JOIN`。目前两种写法都正确。[#12520](https://github.com/ClickHouse/ClickHouse/pull/12520) ([Artem Zuikov](https://github.com/4ertus2)).
* 为 Buffer engine 添加了 lifetime\_rows/lifetime\_bytes。[#12421](https://github.com/ClickHouse/ClickHouse/pull/12421) ([Azat Khuzhin](https://github.com/azat)).
* 向客户端返回详细的异常消息，而不是 `'MySQL server has gone away'`。[#12383](https://github.com/ClickHouse/ClickHouse/pull/12383) ([BohuTANG](https://github.com/BohuTANG)).
* 支持更改用于打印网格边框的字符集。可用字符集如下：UTF-8、ASCII。设置 `output_format_pretty_grid_charset` 可启用此功能。[#12372](https://github.com/ClickHouse/ClickHouse/pull/12372) ([Sabyanin Maxim](https://github.com/s-mx)).
* 支持 MySQL 的 `SELECT DATABASE()` [#9336](https://github.com/ClickHouse/ClickHouse/issues/9336) 2. 添加了 MySQL 替换查询集成测试。[#12314](https://github.com/ClickHouse/ClickHouse/pull/12314) ([BohuTANG](https://github.com/BohuTANG)).
* 为 MySQL client/driver 添加了 `KILL QUERY [connection_id]`，用于取消长时间运行的查询，见 issue [#12038](https://github.com/ClickHouse/ClickHouse/issues/12038)。[#12152](https://github.com/ClickHouse/ClickHouse/pull/12152) ([BohuTANG](https://github.com/BohuTANG)).
* 在 `formatDateTime` function 中新增了对 `%g` (两位 ISO 年) 和 `%G` (四位 ISO 年) 替换的支持。[#12136](https://github.com/ClickHouse/ClickHouse/pull/12136) ([vivarum](https://github.com/vivarum)).
* 在 system.disks 中新增了 `type` 列。[#12115](https://github.com/ClickHouse/ClickHouse/pull/12115) ([ianton-ru](https://github.com/ianton-ru)).
* 改进了 `REVOKE` 命令：现在仅对将被 revoke 的访问要求 grant/admin option。例如，执行 `REVOKE ALL ON *.* FROM user1` 时，不再要求必须拥有通过 grant option 授予的完整访问权限。新增命令 `REVOKE ALL FROM user1`——它会从 `user1` 撤销所有已授予的 roles。[#12083](https://github.com/ClickHouse/ClickHouse/pull/12083) ([Vitaly Baranov](https://github.com/vitlibar)).
* 为 load\_balancing 添加了副本优先级 (用于手动设定负载均衡优先级) 。[#11995](https://github.com/ClickHouse/ClickHouse/pull/11995) ([Azat Khuzhin](https://github.com/azat)).
* 将 S3 元数据中的路径改为相对路径，从而可以更方便地处理 S3 blob。[#11892](https://github.com/ClickHouse/ClickHouse/pull/11892) ([Vladimir Chebotarev](https://github.com/excitoon)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 通过排序键前缀提升了 `ORDER BY` 和 `GROUP BY` 的性能 (通过 `optimize_aggregation_in_order` 设置启用，默认关闭) 。[#11696](https://github.com/ClickHouse/ClickHouse/pull/11696) ([Anton Popov](https://github.com/CurtizJ)) 。
* 当 `set optimize_injective_functions_inside_uniq=1` 时，会移除 `uniq*()` 内部的单射函数。[#12337](https://github.com/ClickHouse/ClickHouse/pull/12337) ([Ruslan Kamalov](https://github.com/kamalov-ruslan)) 。
* 修复了 IN 运算符在使用字面量时未使用索引的问题，这是大约在 v19.3 中引入的性能回退。此项修复了 [#10574](https://github.com/ClickHouse/ClickHouse/issues/10574)。[#12062](https://github.com/ClickHouse/ClickHouse/pull/12062) ([nvartolomei](https://github.com/nvartolomei)) 。
* 为 DiskS3 实现了单分片上传 (实验性功能) 。[#12026](https://github.com/ClickHouse/ClickHouse/pull/12026) ([Vladimir Chebotarev](https://github.com/excitoon)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 在 `MergeTree` 家族表中新增了 parts 的内存格式，数据会先存储在内存中。parts 会在首次合并时写入磁盘。如果某个 part 的行数或字节数低于阈值 `min_rows_for_compact_part` 和 `min_bytes_for_compact_part`，则会以内存格式创建。此外，还提供了对 Write-Ahead-Log 的可选支持；该功能默认启用，并由设置 `in_memory_parts_enable_wal` 控制。 [#10697](https://github.com/ClickHouse/ClickHouse/pull/10697) ([Anton Popov](https://github.com/CurtizJ)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为 clickhouse-client 实现了基于 AST 的查询模糊测试模式。最近通过模糊测试发现的问题列表见[此标签](https://github.com/ClickHouse/ClickHouse/issues?q=label%3Afuzz+is%3Aissue)。其中大多数都是由该工具发现的，另有少数由 SQLancer 和 `00746_sql_fuzzy.pl` 发现。[#12111](https://github.com/ClickHouse/ClickHouse/pull/12111) ([Alexander Kuzmenkov](https://github.com/akuzm)).
* 新增了基于 Testflows 框架的测试类型。[#12090](https://github.com/ClickHouse/ClickHouse/pull/12090) ([vzakaznikov](https://github.com/vzakaznikov)).
* 新增了 S3 HTTPS 集成测试。[#12412](https://github.com/ClickHouse/ClickHouse/pull/12412) ([Pavel Kovalenko](https://github.com/Jokser)).
* 从独立线程中记录 sanitizer trap 消息。这将防止在线程 sanitizer 下可能发生的死锁。[#12313](https://github.com/ClickHouse/ClickHouse/pull/12313) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在功能测试和压力测试可以使用旧版本的 `clickhouse-test` 脚本运行了。[#12287](https://github.com/ClickHouse/ClickHouse/pull/12287) ([alesapin](https://github.com/alesapin)).
* 移除了在构建 `orc` 期间莫名创建文件的行为。[#12258](https://github.com/ClickHouse/ClickHouse/pull/12258) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 将通用的 docker compose 文件放入集成 docker 容器中。[#12168](https://github.com/ClickHouse/ClickHouse/pull/12168) ([Ilya Yatsishin](https://github.com/qoega)).
* 修复了 CodeQL 发出的警告。`CodeQL` 是另一种静态 analyzer，未来会与我们已经在使用的 `clang-tidy` 和 `PVS-Studio` 一起使用。[#12138](https://github.com/ClickHouse/ClickHouse/pull/12138) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 对 UNBUNDLED 构建进行了小幅 CMake 修复。[#12131](https://github.com/ClickHouse/ClickHouse/pull/12131) ([Matwey V. Kornilov](https://github.com/matwey)).
* 新增了一个不依赖任何 Linux 发行版的最小 Docker 镜像示例。[#12126](https://github.com/ClickHouse/ClickHouse/pull/12126) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 升级了 `clickhouse-server` Docker 镜像中的系统软件包。[#12124](https://github.com/ClickHouse/ClickHouse/pull/12124) ([Ivan Blinkov](https://github.com/blinkov)).
* 向 `system.build_options` 表中添加 `UNBUNDLED` 标志。将 `clickhouse-test` 的跳过列表移至 clickhouse 仓库。[#12107](https://github.com/ClickHouse/ClickHouse/pull/12107) ([alesapin](https://github.com/alesapin)).
* 使用 [Anchore Container Analysis](https://docs.anchore.com) 安全分析工具进行例行检查，以查找 `clickhouse-server` Docker 镜像中的 [CVE](https://cve.mitre.org/)。同时也会确认 `Dockerfile` 可以成功构建。每天在 `master` 分支以及针对 `Dockerfile` 的 pull request 上运行。[#12102](https://github.com/ClickHouse/ClickHouse/pull/12102) ([Ivan Blinkov](https://github.com/blinkov)).
* 使用 [GitHub CodeQL](https://securitylab.github.com/tools/codeql) 安全分析工具进行每日检查，以查找 [CWE](https://cwe.mitre.org/)。[#12101](https://github.com/ClickHouse/ClickHouse/pull/12101) ([Ivan Blinkov](https://github.com/blinkov)).
* 在 Dockerfile 中首次执行 `apt-get update` 之前安装 `ca-certificates`。[#12095](https://github.com/ClickHouse/ClickHouse/pull/12095) ([Ivan Blinkov](https://github.com/blinkov)).

<div id="clickhouse-release-205">
  ## ClickHouse 20.5 发行版
</div>

<div id="clickhouse-release-v205440-stable-2020-08-10">
  ### ClickHouse 发行版 v20.5.4.40-稳定版本 2020-08-10
</div>

<div id="bug-fix-23">
  #### 问题修复
</div>

* 修复了包含函数时索引分析错误的问题。这可能会导致在读取 `MergeTree` 表时错误地剪枝 parts。修复了 [#13060](https://github.com/ClickHouse/ClickHouse/issues/13060)。修复了 [#12406](https://github.com/ClickHouse/ClickHouse/issues/12406)。[#13081](https://github.com/ClickHouse/ClickHouse/pull/13081) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了从本地副本执行查询时，对线程数施加不必要限制的问题。[#12840](https://github.com/ClickHouse/ClickHouse/pull/12840) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `IN` 子句中将大型元组解释为函数时的性能问题。也就是用户出于某些莫名其妙的原因，写成 `WHERE x IN tuple(1, 2, ...)` 而不是 `WHERE x IN (1, 2, ...)` 的情况。[#12700](https://github.com/ClickHouse/ClickHouse/pull/12700) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `input_format_parallel_parsing` 的内存跟踪问题 (通过将线程关联到组) 。[#12672](https://github.com/ClickHouse/ClickHouse/pull/12672) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了带常量表达式的布隆过滤器索引。此修复解决了 [#10572](https://github.com/ClickHouse/ClickHouse/issues/10572)。[#12659](https://github.com/ClickHouse/ClickHouse/pull/12659) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `StorageKafka` 在 broker 不可用时 (以及其他情况下) 出现的 `SIGSEGV`。[#12658](https://github.com/ClickHouse/ClickHouse/pull/12658) ([Azat Khuzhin](https://github.com/azat)).
* 新增了对参数为 `Array(UUID)` 的函数 `if` 的支持。此修复解决了 [#11066](https://github.com/ClickHouse/ClickHouse/issues/11066)。[#12648](https://github.com/ClickHouse/ClickHouse/pull/12648) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了函数 `any` 没有别名的问题。[#12593](https://github.com/ClickHouse/ClickHouse/pull/12593) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了使用 `cache` 布局的外部字典中的竞态条件，该问题可能导致服务器崩溃。[#12566](https://github.com/ClickHouse/ClickHouse/pull/12566) ([alesapin](https://github.com/alesapin)).
* 在执行 DROP TABLE 时，删除分布式表的数据 (异步 INSERT 产生的块) 。[#12556](https://github.com/ClickHouse/ClickHouse/pull/12556) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个 bug：当 `enable_mixed_granularity_parts=1` 时，`ALTER DELETE` 查询会导致旧 parts 损坏。已修复 [#12536](https://github.com/ClickHouse/ClickHouse/issues/12536)。[#12543](https://github.com/ClickHouse/ClickHouse/pull/12543) ([alesapin](https://github.com/alesapin)) 。
* 改进了函数 `in` 在参数数量无效时的异常提示。[#12529](https://github.com/ClickHouse/ClickHouse/pull/12529) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `live view` 表中的竞态条件问题，该问题可能导致数据重复。[#12519](https://github.com/ClickHouse/ClickHouse/pull/12519) ([vzakaznikov](https://github.com/vzakaznikov)).
* 修复了读取 compact parts 时的性能问题。[#12492](https://github.com/ClickHouse/ClickHouse/pull/12492) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `AggregateFunction(avg, ...)` 值的二进制格式的向后兼容性问题。此修复解决了 [#12342](https://github.com/ClickHouse/ClickHouse/issues/12342)。[#12486](https://github.com/ClickHouse/ClickHouse/pull/12486) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了启用 `text_log` 时发生的死锁问题。[#12452](https://github.com/ClickHouse/ClickHouse/pull/12452) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在指定非常大的 LIMIT 或 OFFSET 时发生的溢出问题。此修复解决了 [#10470](https://github.com/ClickHouse/ClickHouse/issues/10470)。此修复解决了 [#11372](https://github.com/ClickHouse/ClickHouse/issues/11372)。[#12427](https://github.com/ClickHouse/ClickHouse/pull/12427) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 StorageMerge 中可能发生的段错误。关闭 [#12054](https://github.com/ClickHouse/ClickHouse/issues/12054)。[#12401](https://github.com/ClickHouse/ClickHouse/pull/12401) ([tavplubix](https://github.com/tavplubix)).
* 撤销了在 [#11079](https://github.com/ClickHouse/ClickHouse/issues/11079) 中引入的更改，以解决 [#12098](https://github.com/ClickHouse/ClickHouse/issues/12098)。[#12397](https://github.com/ClickHouse/ClickHouse/pull/12397) ([Mike](https://github.com/myrrc)) 。
* 避免在对带索引的表使用 WHERE 条件时，因使用负数或浮点常量而触发异常。此修复解决了 [#11905](https://github.com/ClickHouse/ClickHouse/issues/11905)。[#12384](https://github.com/ClickHouse/ClickHouse/pull/12384) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 即使存在依赖于该列的 DEFAULT 表达式，也允许对列执行 CLEAR。这修复了 [#12333](https://github.com/ClickHouse/ClickHouse/issues/12333)。[#12378](https://github.com/ClickHouse/ClickHouse/pull/12378) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 TOTALS/ROLLUP/CUBE 对带有 `-State` 和 `Nullable` 参数的聚合函数的处理问题。此修复对应 [#12163](https://github.com/ClickHouse/ClickHouse/issues/12163)。[#12376](https://github.com/ClickHouse/ClickHouse/pull/12376) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `Kafka` 引擎中批次中间某条消息出错时导致 SIGSEGV 的问题。[#12302](https://github.com/ClickHouse/ClickHouse/pull/12302) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `SummingMergeTree` engine 对分区键中的列求和时的行为。在显式指定要汇总的列且这些列与分区键列相交时，新增了一个异常。这修复了 [#7867](https://github.com/ClickHouse/ClickHouse/issues/7867)。[#12173](https://github.com/ClickHouse/ClickHouse/pull/12173) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了在存在别名时，发送到外部 DBMS (如 MySQL、ODBC) 的查询转换错误。此修复解决了 [#12032](https://github.com/ClickHouse/ClickHouse/issues/12032)。[#12151](https://github.com/ClickHouse/ClickHouse/pull/12151) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个会导致 ZooKeepeer 中 ReplicatedVersionedCollapsingMergeTree 表的元数据不正确的 bug。修复 [#12093](https://github.com/ClickHouse/ClickHouse/issues/12093)。[#12121](https://github.com/ClickHouse/ClickHouse/pull/12121) ([alesapin](https://github.com/alesapin)).
* 修复了从 `VIEW` 查询时对线程数进行不必要限制的问题。修复了 [#11937](https://github.com/ClickHouse/ClickHouse/issues/11937)。[#12085](https://github.com/ClickHouse/ClickHouse/pull/12085) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `join_algorithm=partial_merge` 的 JOIN 中使用 LowCardinality 类型时发生的崩溃问题。[#12035](https://github.com/ClickHouse/ClickHouse/pull/12035) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了在条件中使用 NULL 时，`if()` 返回错误结果的问题。[#11807](https://github.com/ClickHouse/ClickHouse/pull/11807) ([Artem Zuikov](https://github.com/4ertus2)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 对于包含字面量的 IN 运算符，此前不会使用索引；这是大约在 v19.3 引入的性能回退问题。此项修复了 [#10574](https://github.com/ClickHouse/ClickHouse/issues/10574)。[#12062](https://github.com/ClickHouse/ClickHouse/pull/12062) ([nvartolomei](https://github.com/nvartolomei)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 在 Dockerfile 中，首次运行 `apt-get update` 之前先安装 `ca-certificates`。[#12095](https://github.com/ClickHouse/ClickHouse/pull/12095) ([Ivan Blinkov](https://github.com/blinkov)) 。

<div id="clickhouse-release-v20527-stable-2020-07-02">
  ### ClickHouse 发行版 v20.5.2.7-稳定版本 2020-07-02
</div>

<div id="backward-incompatible-change">
  #### 向后不兼容变更
</div>

* `COUNT(DISTINCT)` 和 `uniq` 聚合函数家族现在返回非 `Nullable` 结果。如果所有传入值均为 `NULL`，则返回 0。这提高了 SQL 兼容性。[#11661](https://github.com/ClickHouse/ClickHouse/pull/11661) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 增加了对用户级设置放置位置错误情况的检查。用户级设置应在 `users.xml` 中为特定用户的 profile 写在 `<profile>` 部分内 (默认设置则写在 `<default>` 中) 。否则，服务器将无法启动，并在日志中记录异常信息。此更改修复了 [#9051](https://github.com/ClickHouse/ClickHouse/issues/9051)。如果要跳过此检查，可以将设置移到正确位置，或在 config.xml 中添加 `<skip_check_for_incorrect_settings>1</skip_check_for_incorrect_settings>`。[#11449](https://github.com/ClickHouse/ClickHouse/pull/11449) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 设置 `input_format_with_names_use_header` 现已默认启用。它会影响 `-WithNames` 和 `-WithNamesAndTypes` 输入格式的解析。[#10937](https://github.com/ClickHouse/ClickHouse/pull/10937) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 移除了 `experimental_use_processors` 设置。该功能现已默认启用。[#10924](https://github.com/ClickHouse/ClickHouse/pull/10924) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 将 `zstd` 更新至 1.4.4，在性能和压缩率方面有一些小幅改进。如果你的 ClickHouse 副本运行的是不同版本，可能会看到类似 `Data after merge is not byte-identical to data on another replicas.` 的错误消息及其解释。这些消息是正常的，无需担心。此更改本身向后兼容，但我们仍在更新日志中列出它，以免你对这些消息感到困惑。[#10663](https://github.com/ClickHouse/ClickHouse/pull/10663) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 增加了对无意义编解码器的检查，并新增了用于控制此检查的设置 `allow_suspicious_codecs`。此更改关闭了 [#4966](https://github.com/ClickHouse/ClickHouse/issues/4966)。[#10645](https://github.com/ClickHouse/ClickHouse/pull/10645) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 多个 Kafka 设置的默认值已更改。参见 [#11388](https://github.com/ClickHouse/ClickHouse/pull/11388)。
* 从早于 20.5 的版本升级时，如果执行滚动更新，且集群中同时存在 20.5 及以上版本和低于 20.5 的版本，那么当旧版本 ClickHouse 节点在新版本节点已存在的情况下重启并启动时，可能会导致 `Part ... intersects previous part` 错误。为避免此错误，请先在所有集群节点上安装较新的 clickhouse-server 软件包，然后再执行重启 (这样 clickhouse-server 重启后将以新版本启动) 。

<div id="new-feature-7">
  #### 新特性
</div>

* 用于在表中自动粗化数据并进行 rollup 的 `TTL DELETE WHERE` 和 `TTL GROUP BY`。[#10537](https://github.com/ClickHouse/ClickHouse/pull/10537) ([expl0si0nn](https://github.com/expl0si0nn)).
* 实现了 PostgreSQL 线协议。[#10242](https://github.com/ClickHouse/ClickHouse/pull/10242) ([Movses](https://github.com/MovElb)).
* 新增了用户、角色、授权、profile、配额和行策略的系统表；新增了命令 SHOW USER、SHOW \[CURRENT|ENABLED] ROLES、SHOW SETTINGS PROFILES。[#10387](https://github.com/ClickHouse/ClickHouse/pull/10387) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 支持通过 ODBC 表函数写入 [#10554](https://github.com/ClickHouse/ClickHouse/pull/10554) ([ageraab](https://github.com/ageraab))。[#10901](https://github.com/ClickHouse/ClickHouse/pull/10901) ([tavplubix](https://github.com/tavplubix))。
* 新增基于 Linux `perf_events` 的查询性能指标 (这些指标通过硬件 CPU 计数器和操作系统计数器计算得出) 。此功能为可选项，要求为 clickhouse 二进制文件设置 `CAP_SYS_ADMIN`。[#9545](https://github.com/ClickHouse/ClickHouse/pull/9545) [Andrey Skobtsov](https://github.com/And42)。[#11226](https://github.com/ClickHouse/ClickHouse/pull/11226) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 现已支持在 `CREATE` 查询中为数据类型使用 `NULL` 和 `NOT NULL` 修饰符。[#11057](https://github.com/ClickHouse/ClickHouse/pull/11057) ([Павел Потемкин](https://github.com/Potya)).
* 新增 `ArrowStream` 输入和输出格式。[#11088](https://github.com/ClickHouse/ClickHouse/pull/11088) ([hcz](https://github.com/hczhcz)) 。
* 支持 Cassandra 作为外部字典源。[#4978](https://github.com/ClickHouse/ClickHouse/pull/4978) ([favstovol](https://github.com/favstovol)) 。
* 新增了 `direct` 布局，该布局会在每次查询时都直接从源加载全部数据，不进行数据存储或缓存。[#10622](https://github.com/ClickHouse/ClickHouse/pull/10622) ([Artem Streltsov](https://github.com/kekekekule)) 。
* 为字典新增了 `complex_key_direct` 布局，该布局在查询执行期间不会在本地存储任何数据。[#10850](https://github.com/ClickHouse/ClickHouse/pull/10850) ([Artem Streltsov](https://github.com/kekekekule)) 。
* 新增了对 MySQL 风格全局变量语法 (存根) 的支持。这是为了兼容 MySQL 协议所必需的。 [#11832](https://github.com/ClickHouse/ClickHouse/pull/11832) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为 `clickhouse-client` 添加了基于 `replxx` 的语法高亮功能。[#11422](https://github.com/ClickHouse/ClickHouse/pull/11422) ([Tagir Kuskarov](https://github.com/kuskarov)) 。
* 新增了 `minMap` 和 `maxMap` 函数。[#11603](https://github.com/ClickHouse/ClickHouse/pull/11603) ([Ildus Kurbangaliev](https://github.com/ildus)) 。
* 新增 `system.asynchronous_metric_log` 表，用于记录 `system.asynchronous_metrics` 中的历史指标。[#11588](https://github.com/ClickHouse/ClickHouse/pull/11588) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 新增 `extractAllGroupsHorizontal(haystack, re)` 和 `extractAllGroupsVertical(haystack, re)` 函数。[#11554](https://github.com/ClickHouse/ClickHouse/pull/11554) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 添加了 `SHOW CLUSTER(S)` 查询。[#11467](https://github.com/ClickHouse/ClickHouse/pull/11467) ([hexiaoting](https://github.com/hexiaoting)) 。
* 添加 `netloc` 函数，用于提取网络位置，类似于 Python 中 `urlparse(url)` 返回的 `netloc`。[#11356](https://github.com/ClickHouse/ClickHouse/pull/11356) ([Guillaume Tassery](https://github.com/YiuRULE)) 。
* 为 engine=Kafka 新增 2 个虚拟列，以访问消息头。[#11283](https://github.com/ClickHouse/ClickHouse/pull/11283) ([filimonov](https://github.com/filimonov)) 。
* 为 Kafka 引擎新增 `_timestamp_ms` 虚拟列 (类型为 `Nullable(DateTime64(3))`) 。[#11260](https://github.com/ClickHouse/ClickHouse/pull/11260) ([filimonov](https://github.com/filimonov)) 。
* 新增函数 `randomFixedString`。[#10866](https://github.com/ClickHouse/ClickHouse/pull/10866) ([Andrei Nekrashevich](https://github.com/xolm)) 。
* 新增函数 `fuzzBits`，可按给定概率随机翻转字符串中的位。[#11237](https://github.com/ClickHouse/ClickHouse/pull/11237) ([Andrei Nekrashevich](https://github.com/xolm)) 。
* 允许在比较运算符、IN 和 VALUES 子句中将数字与常量字符串进行比较。[#11647](https://github.com/ClickHouse/ClickHouse/pull/11647) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增 `round_robin` 负载均衡模式。[#11645](https://github.com/ClickHouse/ClickHouse/pull/11645) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增 `cast_keep_nullable` 设置。启用后，`CAST(something_nullable AS Type)` 将返回 `Nullable(Type)`。[#11733](https://github.com/ClickHouse/ClickHouse/pull/11733) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 向 `system.columns` 表新增了列 `position`，并向 `system.parts_columns` 表新增了 `column_position`。该列表示列在表中的顺序位置，从 1 开始。这解决了 [#7744](https://github.com/ClickHouse/ClickHouse/issues/7744)。[#11655](https://github.com/ClickHouse/ClickHouse/pull/11655) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持对 SYSTEM `{FLUSH DISTRIBUTED,STOP/START DISTRIBUTED SEND}` 使用 ON CLUSTER。 [#11415](https://github.com/ClickHouse/ClickHouse/pull/11415) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增 system.distribution\_queue 表。[#11394](https://github.com/ClickHouse/ClickHouse/pull/11394) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持 Kafka 的所有格式设置，在表级别开放部分设置，并调整默认值以提升性能。[#11388](https://github.com/ClickHouse/ClickHouse/pull/11388) ([filimonov](https://github.com/filimonov)) 。
* 新增 `port` 函数 (用于从 URL 中提取端口号) 。[#11120](https://github.com/ClickHouse/ClickHouse/pull/11120) ([Azat Khuzhin](https://github.com/azat)).
* 现在，`dictGet*` 函数现已支持表名。[#11050](https://github.com/ClickHouse/ClickHouse/pull/11050) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* `clickhouse-format` 工具现在可以在使用 `-n` 参数时对多个查询进行格式化。[#10852](https://github.com/ClickHouse/ClickHouse/pull/10852) ([Darío](https://github.com/dgrr)).
* 可为 DiskS3 配置代理解析器。[#10744](https://github.com/ClickHouse/ClickHouse/pull/10744) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 使 `pointInPolygon` 支持非常量 Polygon。现在，PointInPolygon 可接受 Array(Array(Tuple(..., ...))) 作为第二个参数，即由 Polygon 及其孔组成的数组。[#10623](https://github.com/ClickHouse/ClickHouse/pull/10623) ([Alexey Ilyukhov](https://github.com/livace)) [#11421](https://github.com/ClickHouse/ClickHouse/pull/11421) ([Alexey Ilyukhov](https://github.com/livace)).
* 向 `system.parts` 新增了 `move_ttl_info`，用于提供 move TTL 功能的内部信息。[#10591](https://github.com/ClickHouse/ClickHouse/pull/10591) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 可通过代理使用 S3。[#10576](https://github.com/ClickHouse/ClickHouse/pull/10576) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 为数据类型新增 `NCHAR` 和 `NVARCHAR` 别名。[#11025](https://github.com/ClickHouse/ClickHouse/pull/11025) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 已解决 [#7224](https://github.com/ClickHouse/ClickHouse/issues/7224)：向 `system.events` 表添加了 `FailedQuery`、`FailedSelectQuery` 和 `FailedInsertQuery` 指标。[#11151](https://github.com/ClickHouse/ClickHouse/pull/11151) ([Nikita Orlov](https://github.com/naorlov)) 。
* 向 `system.asynchronous_metrics` 添加更多 `jemalloc` 统计信息，并确保我们能看到这些统计信息的最新值。[#11748](https://github.com/ClickHouse/ClickHouse/pull/11748) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 可指定默认 S3 凭证和自定义身份验证请求头。[#11134](https://github.com/ClickHouse/ClickHouse/pull/11134) ([Grigory Pervakov](https://github.com/GrigoryPervakov)) 。
* 新增了新函数，可按不同精度将 DateTime64 导入/导出为 Int64：`to-/fromUnixTimestamp64Milli/-Micro/-Nano`。[#10923](https://github.com/ClickHouse/ClickHouse/pull/10923) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 支持为 MongoDB 字典指定 `mongodb://` URI。[#10915](https://github.com/ClickHouse/ClickHouse/pull/10915) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 现在可以在不配合 LIMIT 子句的情况下使用 OFFSET 关键字。[#10802](https://github.com/ClickHouse/ClickHouse/pull/10802) ([Guillaume Tassery](https://github.com/YiuRULE)) 。
* 新增了 `system.licenses` 表。该表包含位于 `contrib` 目录中的第三方库许可证。此项变更关闭了 [#2890](https://github.com/ClickHouse/ClickHouse/issues/2890)。[#10795](https://github.com/ClickHouse/ClickHouse/pull/10795) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增函数 function toStartOfSecond(DateTime64) -> DateTime64，用于将 DateTime64 值的亚秒部分置零。[#10722](https://github.com/ClickHouse/ClickHouse/pull/10722) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 新增输入格式 `JSONAsString`，可接受由换行符、空格和/或逗号分隔的一系列 JSON 对象。[#10607](https://github.com/ClickHouse/ClickHouse/pull/10607) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许以内存分析时使用比 4 MiB 更细的粒度步长。新增了采样内存 Profiler，用于捕获随机分配/释放操作。[#10598](https://github.com/ClickHouse/ClickHouse/pull/10598) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `SimpleAggregateFunction` 现已支持 `sumMap`。[#10000](https://github.com/ClickHouse/ClickHouse/pull/10000) ([Ildus Kurbangaliev](https://github.com/ildus)) 。
* 支持 Distributed 表引擎的 `ALTER RENAME COLUMN`。延续 [#10727](https://github.com/ClickHouse/ClickHouse/issues/10727)。修复 [#10747](https://github.com/ClickHouse/ClickHouse/issues/10747)。[#10887](https://github.com/ClickHouse/ClickHouse/pull/10887) ([alesapin](https://github.com/alesapin)) 。

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复 Decimal 解析中的 UBSan 报告问题。此修复解决了 [#7540](https://github.com/ClickHouse/ClickHouse/issues/7540)。[#10512](https://github.com/ClickHouse/ClickHouse/pull/10512) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了解析 DateTime64 时可能发生的浮点异常。此修复解决了 [#11374](https://github.com/ClickHouse/ClickHouse/issues/11374)。[#11875](https://github.com/ClickHouse/ClickHouse/pull/11875) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在 prewhere 条件中使用 `Nullable` 列时导致的罕见崩溃。[#11895](https://github.com/ClickHouse/ClickHouse/pull/11895) [#11608](https://github.com/ClickHouse/ClickHouse/issues/11608) [#11869](https://github.com/ClickHouse/ClickHouse/pull/11869) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 不允许在高阶函数中使用 arrayJoin，否则会导致协议同步异常。此修复关闭了 [#3933](https://github.com/ClickHouse/ClickHouse/issues/3933)。[#11846](https://github.com/ClickHouse/ClickHouse/pull/11846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 FixedString 与常量 String 比较结果错误的问题。此修复解决了 [#11393](https://github.com/ClickHouse/ClickHouse/issues/11393)。该问题出现在 20.4 版本中。[#11828](https://github.com/ClickHouse/ClickHouse/pull/11828) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复条件中包含 NULL 时 `if` 返回错误结果的问题。[#11807](https://github.com/ClickHouse/ClickHouse/pull/11807) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了查询使用过多线程的问题。[#11788](https://github.com/ClickHouse/ClickHouse/pull/11788) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `SELECT ... FROM merge_tree_table ...` 中使用 `WITH <scalar subquery> ...` 时触发的 `Scalar does not exist` 异常 [#11621](https://github.com/ClickHouse/ClickHouse/issues/11621)。[#11767](https://github.com/ClickHouse/ClickHouse/pull/11767) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `SELECT *, xyz.*` 这类查询的异常行为：此前这类查询会成功执行，但按预期应当报错。[#11753](https://github.com/ClickHouse/ClickHouse/pull/11753) ([hexiaoting](https://github.com/hexiaoting)).
* 现在，在执行元数据 ALTER 期间，副本拉取操作将被取消。[#11744](https://github.com/ClickHouse/ClickHouse/pull/11744) ([alesapin](https://github.com/alesapin)) 。
* 在检查是否相等之前，先解析存储在 ZooKeeper 中的元数据。[#11739](https://github.com/ClickHouse/ClickHouse/pull/11739) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 Values 输入格式中因复杂字面量类型推断错误导致的 LOGICAL\_ERROR。 [#11732](https://github.com/ClickHouse/ClickHouse/pull/11732) ([tavplubix](https://github.com/tavplubix)).
* 修复了 `ORDER BY ... WITH FILL` 在常量列上的问题。[#11697](https://github.com/ClickHouse/ClickHouse/pull/11697) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `SYSTEM SYNC REPLICA` 中一种极其罕见的竞态条件。如果某个复制表在创建的同时，另一个客户端又通过独立连接对该表发出 `SYSTEM SYNC REPLICA` 命令 (这种情况不太可能发生，因为另一个客户端理应知道该表已创建) ，就可能导致 nullptr 解引用。[#11691](https://github.com/ClickHouse/ClickHouse/pull/11691) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 与 XDBC bridge 通信时应传递适当的超时参数。最近在检查 bridge 是否存活以及接收元信息时，超时参数未得到正确处理。[#11690](https://github.com/ClickHouse/ClickHouse/pull/11690) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `LIMIT n WITH TIES` 与包含别名的 `ORDER BY` 语句搭配使用时的问题。 [#11689](https://github.com/ClickHouse/ClickHouse/pull/11689) ([Anton Popov](https://github.com/CurtizJ)).
* 修复在并行 `FINAL` 下执行 select 查询时可能出现的 `Pipeline stuck` 问题。修复了 [#11636](https://github.com/ClickHouse/ClickHouse/issues/11636)。[#11682](https://github.com/ClickHouse/ClickHouse/pull/11682) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个会导致 `system.mutations` 状态不正确的错误。它可能显示整个变更已完成，但服务器的复制队列中仍有 `MUTATE_PART` task，并会尝试执行它们。此修复解决了 [#11611](https://github.com/ClickHouse/ClickHouse/issues/11611)。[#11681](https://github.com/ClickHouse/ClickHouse/pull/11681) ([alesapin](https://github.com/alesapin)).
* 修复 CREATE USER 查询中的语法高亮显示。[#11664](https://github.com/ClickHouse/ClickHouse/pull/11664) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了对带有不区分大小写标志的正则表达式的支持。此修复解决了 [#11101](https://github.com/ClickHouse/ClickHouse/issues/11101) 和 [#11506](https://github.com/ClickHouse/ClickHouse/issues/11506)。[#11649](https://github.com/ClickHouse/ClickHouse/pull/11649) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果设置了行级安全性，则移除简单的 `count` 查询优化。在之前的版本中，用户得到的是表中的记录总数，而不是过滤后的记录数。这修复了 [#11352](https://github.com/ClickHouse/ClickHouse/issues/11352)。[#11644](https://github.com/ClickHouse/ClickHouse/pull/11644) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 String 类型的布隆过滤器 (数据跳过索引) 问题。[#11638](https://github.com/ClickHouse/ClickHouse/pull/11638) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果不使用 `-q` 选项，数据库不会在启动时创建。[#11604](https://github.com/ClickHouse/ClickHouse/pull/11604) ([giordyb](https://github.com/giordyb)) 。
* 修复了从 `Buffer` 表读取采样数据的查询出现的 `Block structure mismatch` 错误。[#11602](https://github.com/ClickHouse/ClickHouse/pull/11602) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `exception.code() % 256 == 0` 时 clickhouse-client 返回错误退出码的问题。[#11601](https://github.com/ClickHouse/ClickHouse/pull/11601) ([filimonov](https://github.com/filimonov)) 。
* 修复了 ReplicatedMergeTree 不同副本在 CREATE/DROP 过程中出现的竞态条件。即使表未能从 ZooKeeper 中完全移除，或未能成功创建，也可继续正常工作。此修复解决了 [#11432](https://github.com/ClickHouse/ClickHouse/issues/11432)。[#11592](https://github.com/ClickHouse/ClickHouse/pull/11592) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 server 启动时日志消息中关于“标记缓存大小已降低”的一个小错误。此修复关闭了 [#11399](https://github.com/ClickHouse/ClickHouse/issues/11399)。[#11589](https://github.com/ClickHouse/ClickHouse/pull/11589) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复在包含 `PREWHERE column in (subquery)` 和 `ARRAY JOIN` 的查询中出现的错误 `Size of offsets does not match size of column`。[#11580](https://github.com/ClickHouse/ClickHouse/pull/11580) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `SHOW CREATE TABLE` 中罕见的段错误。修复了 [#11490](https://github.com/ClickHouse/ClickHouse/issues/11490)。[#11579](https://github.com/ClickHouse/ClickHouse/pull/11579) ([tavplubix](https://github.com/tavplubix)) 。
* HTTP 会话中的所有查询此前都使用相同的 query\_id。此问题已修复。 [#11578](https://github.com/ClickHouse/ClickHouse/pull/11578) ([tavplubix](https://github.com/tavplubix)).
* 现在，clickhouse-server Docker 容器在检查服务器存活状态时将优先使用 IPv6。[#11550](https://github.com/ClickHouse/ClickHouse/pull/11550) ([Ivan Starkov](https://github.com/istarkov)) 。
* 修复了在启用 `min_bytes_to_use_direct_io`、PREWHERE 生效，且使用 SAMPLE 或线程数较高时可能出现的错误 `Data compressed with different methods`。此修复解决了 [#11539](https://github.com/ClickHouse/ClickHouse/issues/11539)。[#11540](https://github.com/ClickHouse/ClickHouse/pull/11540) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `<node>` 的 shard\_num/replica\_num (此前会导致 use\_compact\_format\_in\_distributed\_parts\_names 失效) 。 [#11528](https://github.com/ClickHouse/ClickHouse/pull/11528) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 `prefer&#95;localhost&#95;replica=0` 且未启用 `internal&#95;replication` 时向 Distributed 表执行异步 INSERT 的问题。[#11527](https://github.com/ClickHouse/ClickHouse/pull/11527) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在使用 `-State` 函数进行聚合时，如果中途抛出异常就会导致的内存泄漏问题。此修复解决了 [#8995](https://github.com/ClickHouse/ClickHouse/issues/8995)。[#11496](https://github.com/ClickHouse/ClickHouse/pull/11496) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `INSERT SELECT FINAL` 中的 `Pipeline stuck` 异常：当 `SELECT` (`max_threads`>1) 有多个流，而 `INSERT` 只有一个流 (`max_insert_threads`==0) 时，会出现该异常。[#11455](https://github.com/ClickHouse/ClickHouse/pull/11455) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 `select count() from t, u` 这类查询返回结果错误的问题。[#11454](https://github.com/ClickHouse/ClickHouse/pull/11454) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了编解码器返回压缩后大小的错误。[#11448](https://github.com/ClickHouse/ClickHouse/pull/11448) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在列的压缩编解码器使用非常量参数时导致的 server 崩溃问题。修复 [#11365](https://github.com/ClickHouse/ClickHouse/issues/11365)。[#11431](https://github.com/ClickHouse/ClickHouse/pull/11431) ([alesapin](https://github.com/alesapin)) 。
* 修复了在表未成功创建时，MergeTree 关闭过程中可能读取未初始化内存的问题。[#11420](https://github.com/ClickHouse/ClickHouse/pull/11420) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复对 `LowCarinality(T)` 和 `Nullable(T)` 执行 JOIN 时的崩溃问题。[#11380](https://github.com/ClickHouse/ClickHouse/issues/11380)。[#11414](https://github.com/ClickHouse/ClickHouse/pull/11414) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了错误 `USING` 键对应的错误代码。[#11373](https://github.com/ClickHouse/ClickHouse/issues/11373)。[#11404](https://github.com/ClickHouse/ClickHouse/pull/11404) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了 `geohashesInBox` 在参数超出纬度/经度范围时出现的问题。[#11403](https://github.com/ClickHouse/ClickHouse/pull/11403) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 优化了 `joinGet()` 函数的错误信息。[#11389](https://github.com/ClickHouse/ClickHouse/pull/11389) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复查询在使用外部排序和 limit 时可能出现的 `Pipeline stuck` 错误。修复 [#11359](https://github.com/ClickHouse/ClickHouse/issues/11359)。[#11366](https://github.com/ClickHouse/ClickHouse/pull/11366) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在 ReplicatedMergeTree 中发送 parts 时，移除冗余锁。[#11354](https://github.com/ClickHouse/ClickHouse/pull/11354) ([alesapin](https://github.com/alesapin)) 。
* 修复了 clickhouse-client 在多行模式下对 `\G` (垂直输出) 的支持问题。此修复关闭了 [#9933](https://github.com/ClickHouse/ClickHouse/issues/9933)。[#11350](https://github.com/ClickHouse/ClickHouse/pull/11350) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复使用 `Lazy` 数据库时可能出现的段错误。[#11348](https://github.com/ClickHouse/ClickHouse/pull/11348) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了直接从 `Join` 表引擎查询 (不使用 JOIN) 时的崩溃问题以及错误的可空性。 [#11340](https://github.com/ClickHouse/ClickHouse/pull/11340) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了 `quantilesExactWeightedArray` 中的崩溃问题。[#11337](https://github.com/ClickHouse/ClickHouse/pull/11337) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 现在，在 `ALTER` 查询更改元数据之前，会先停止后台合并。[#11335](https://github.com/ClickHouse/ClickHouse/pull/11335) ([alesapin](https://github.com/alesapin)).
* 重新支持在设置 `parallel_view_processing = 1` 时并行写入 `MATERIALIZED VIEW`。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#11330](https://github.com/ClickHouse/ClickHouse/pull/11330) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `visitParamExtractRaw` 在提取出的 JSON 包含带有不配对的 \{ 或 \[ 的字符串时的问题。[#11318](https://github.com/ClickHouse/ClickHouse/pull/11318) ([Ewout](https://github.com/devwout)) 。
* 修复 ThreadPool 中一种极其罕见的竞态条件。[#11314](https://github.com/ClickHouse/ClickHouse/pull/11314) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `clickhouse-copier` 中一个轻微的数据竞争问题。由集成测试发现。[#11313](https://github.com/ClickHouse/ClickHouse/pull/11313) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了转换过程中可能出现的内存未初始化问题。示例：`SELECT toIntervalSecond(now64())`。[#11311](https://github.com/ClickHouse/ClickHouse/pull/11311) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个问题：当表的主键包含 Array 列，且查询使用 `empty` 或 `notEmpty` 函数对该列进行过滤时，索引分析将无法正常工作。此修复对应 [#11286](https://github.com/ClickHouse/ClickHouse/issues/11286)。[#11303](https://github.com/ClickHouse/ClickHouse/pull/11303) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 修复了一个 bug：当查询速度估算不准确时，如果查询因 `max_network_bandwidth`、`max_execution_speed` 或 `priority` 设置而被限速，`min_execution_speed` 的限制可能不会生效或生效不正确。将 `timeout_before_checking_execution_speed` 的默认值改为非零，因为否则 `min_execution_speed` 和 `max_execution_speed` 设置将不起作用。此修复解决了 [#11297](https://github.com/ClickHouse/ClickHouse/issues/11297)。此修复解决了 [#5732](https://github.com/ClickHouse/ClickHouse/issues/5732)。此修复解决了 [#6228](https://github.com/ClickHouse/ClickHouse/issues/6228)。易用性改进：避免在 `clickhouse-client` 中将异常消息与进度条拼接在一起。[#11296](https://github.com/ClickHouse/ClickHouse/pull/11296) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用错误参数调用 `SET DEFAULT ROLE` 时导致的崩溃。此修复解决了 [#10586](https://github.com/ClickHouse/ClickHouse/issues/10586)。[#11278](https://github.com/ClickHouse/ClickHouse/pull/11278) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了读取 `Protobuf` 格式的畸形数据时发生崩溃的问题。此修复解决了 [#5957](https://github.com/ClickHouse/ClickHouse/issues/5957) 和 [#11203](https://github.com/ClickHouse/ClickHouse/issues/11203)。[#11258](https://github.com/ClickHouse/ClickHouse/pull/11258) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了一个 bug：当 `cache` 字典中只存在已过期的键时，可能会返回默认值而非正常值。此问题仅影响 String 字段。[#11233](https://github.com/ClickHouse/ClickHouse/pull/11233) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复从 `VIEW` 读取且内部查询包含常量时出现的错误 `Block structure mismatch in QueryPipeline`。修复了 [#11181](https://github.com/ClickHouse/ClickHouse/issues/11181)。[#11205](https://github.com/ClickHouse/ClickHouse/pull/11205) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了可能发生的异常 `Invalid status for associated output`。[#11200](https://github.com/ClickHouse/ClickHouse/pull/11200) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 现在会检查 `CREATE` 查询中是否定义了 `primary.idx`。[#11199](https://github.com/ClickHouse/ClickHouse/pull/11199) ([alesapin](https://github.com/alesapin)) 。
* 修复了高阶函数中，捕获的参数为 `Array(Array(LowCardinality))` 时可能出现的错误 `Cannot capture column`。[#11185](https://github.com/ClickHouse/ClickHouse/pull/11185) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `S3` glob 匹配在键数量超过 1000 且某些后端情况下可能失败的问题。[#11179](https://github.com/ClickHouse/ClickHouse/pull/11179) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 如果数据跳过索引依赖的列会在后台合并期间被修改 (SummingMergeTree、AggregatingMergeTree 以及 TTL GROUP BY 均属于这种情况) ，其计算结果就会不正确。这个问题已通过将索引计算移到合并之后来修复，从而确保索引基于合并后的数据计算。[#11162](https://github.com/ClickHouse/ClickHouse/pull/11162) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在对 `engine=Kafka` 的表执行 DROP 时 (或在 server 重启期间) 有时会出现的卡住问题。[#11145](https://github.com/ClickHouse/ClickHouse/pull/11145) ([filimonov](https://github.com/filimonov)) 。
* 修复了简单查询中线程预留过多的问题 (这是为减少线程数量所做的优化，但在管道变更后部分失效) 。[#11114](https://github.com/ClickHouse/ClickHouse/pull/11114) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果未完成任何最终化操作，则移除变更最终化任务的日志。 [#11109](https://github.com/ClickHouse/ClickHouse/pull/11109) ([alesapin](https://github.com/alesapin)).
* 修复了更新后因系统日志表结构变更导致的服务器启动期间死锁问题。[#11106](https://github.com/ClickHouse/ClickHouse/pull/11106) ([alesapin](https://github.com/alesapin)) 。
* 修复了 registerDiskS3 中的内存泄漏问题。 [#11074](https://github.com/ClickHouse/ClickHouse/pull/11074) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了以下错误：当出现 JOIN 且带有 PREWHERE，或 `optimize_move_to_prewhere` 将 WHERE 转换为 PREWHERE 时，会报错 `No such name in Block::erase()`。[#11051](https://github.com/ClickHouse/ClickHouse/pull/11051) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了 Kafka engine 表在终止过程中可能导致数据遗漏的问题。[#11048](https://github.com/ClickHouse/ClickHouse/pull/11048) ([filimonov](https://github.com/filimonov)) 。
* 修复了 parseDateTime64BestEffort 参数解析中的缺陷。[#10925](https://github.com/ClickHouse/ClickHouse/issues/10925)。[#11038](https://github.com/ClickHouse/ClickHouse/pull/11038) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 现在可以在单条 `ALTER` 查询中对同一列同时执行 `ADD/DROP` 和 `RENAME`。同时执行 `MODIFY` 和 `RENAME` 时的异常消息也更加清晰。部分修复了 [#10669](https://github.com/ClickHouse/ClickHouse/issues/10669)。[#11037](https://github.com/ClickHouse/ClickHouse/pull/11037) ([alesapin](https://github.com/alesapin)).
* 修复了 S3 URL 解析问题。[#11036](https://github.com/ClickHouse/ClickHouse/pull/11036) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复在存在 `LIMIT` 时，两级 `GROUP BY` 的内存跟踪问题。[#11022](https://github.com/ClickHouse/ClickHouse/pull/11022) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 MergeTree 中一个极其罕见的潜在 use-after-free 错误，该错误会在表未成功创建时发生。 [#10986](https://github.com/ClickHouse/ClickHouse/pull/10986) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 Atomic 数据库中元数据 (用于重命名的相对路径) 和数据 (用于符号链接的相对路径) 的处理问题。[#10980](https://github.com/ClickHouse/ClickHouse/pull/10980) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复使用 `Atomic` 数据库引擎时，并发执行 `ALTER` 和 `DROP DATABASE` 查询导致服务器崩溃的问题。[#10968](https://github.com/ClickHouse/ClickHouse/pull/10968) ([tavplubix](https://github.com/tavplubix)) 。
* 修复 `getRawData()` 方法返回的原始数据大小不正确的问题。[#10964](https://github.com/ClickHouse/ClickHouse/pull/10964) ([Igr](https://github.com/ObjatieGroba)).
* 修复了 20.1 及更早版本之间两级聚合的兼容性问题。当发起节点和远程节点使用不同版本的 ClickHouse，且 GROUP BY 结果集较大，并且聚合基于单个 String 字段执行时，就会出现这种不兼容。这会导致结果中同一个键对应多行未合并的行。 [#10952](https://github.com/ClickHouse/ClickHouse/pull/10952) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 避免通过 DistributedBlockOutputStream 发送写入未完成的文件。[#10940](https://github.com/ClickHouse/ClickHouse/pull/10940) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `SELECT count(notNullIn(NULL, []))` 导致的崩溃。[#10920](https://github.com/ClickHouse/ClickHouse/pull/10920) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在对 engine=Kafka 的表执行 DROP 操作时 (或在服务器重启期间) 有时会出现的卡死问题。 [#10910](https://github.com/ClickHouse/ClickHouse/pull/10910) ([filimonov](https://github.com/filimonov)).
* 现在支持执行多个 `ALTER RENAME`，例如 `a TO b, c TO a`。[#10895](https://github.com/ClickHouse/ClickHouse/pull/10895) ([alesapin](https://github.com/alesapin)) 。
* 修复了一种可能出现的竞态条件：当从多个线程中获取同一列的聚合函数状态结果时，可能会发生该问题。据我所知，唯一会触发该问题的方式，是在从使用 `Memory` 引擎、并为 `quanite*` 函数存储 `AggregateFunction` 状态的表读取数据时，使用 `finalizeAggregation` 函数。 [#10890](https://github.com/ClickHouse/ClickHouse/pull/10890) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复分布式表中 Tuple 的向后兼容性问题。[#10889](https://github.com/ClickHouse/ClickHouse/pull/10889) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 StringHashTable 中的 SIGSEGV 问题 (如果该类键不存在) 。[#10870](https://github.com/ClickHouse/ClickHouse/pull/10870) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在使用 `Atomic` 引擎的数据库中删除 `LiveView` 表后，`WATCH` 卡住的问题。[#10859](https://github.com/ClickHouse/ClickHouse/pull/10859) ([tavplubix](https://github.com/tavplubix)).
* 修复了 `ReplicatedMergeTree` 中的一个缺陷：某些针对 `OPTIMIZE` 查询的 `ALTER` 操作在某个副本变为非活跃后，可能会因等待该副本而卡住。[#10849](https://github.com/ClickHouse/ClickHouse/pull/10849) ([tavplubix](https://github.com/tavplubix)).
* 现在，如果 `CONSTRAINT` 表达式中涉及的列被重命名，相应的约束也会更新。修复了 [#10844](https://github.com/ClickHouse/ClickHouse/issues/10844)。[#10847](https://github.com/ClickHouse/ClickHouse/pull/10847) ([alesapin](https://github.com/alesapin)) 。
* 修复 cache 字典中可能读取未初始化内存的问题。[#10834](https://github.com/ClickHouse/ClickHouse/pull/10834) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 Block::sortColumns() 之后列顺序错误的问题 (还新增了一个测试，用于说明这会影响某些真实用例——Buffer 引擎) 。[#10826](https://github.com/ClickHouse/ClickHouse/pull/10826) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在不要求对标识符加引号时 ODBC bridge 出现的问题。此修复对应 [#7984](https://github.com/ClickHouse/ClickHouse/issues/7984)。[#10821](https://github.com/ClickHouse/ClickHouse/pull/10821) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 DateLUT 中 UBSan 和 MSan 报告的问题。[#10798](https://github.com/ClickHouse/ClickHouse/pull/10798) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在键条件中使用 `src_type` 进行正确的类型转换。修复了 [#6287](https://github.com/ClickHouse/ClickHouse/issues/6287)。[#10791](https://github.com/ClickHouse/ClickHouse/pull/10791) ([Andrew Onyshchuk](https://github.com/oandrew)) 。
* 移除旧版 libunwind 补丁。[https://github.com/ClickHouse-Extras/libunwind/commit/500aa227911bd185a94bfc071d68f4d3b03cb3b1#r39048012](https://github.com/ClickHouse-Extras/libunwind/commit/500aa227911bd185a94bfc071d68f4d3b03cb3b1#r39048012) 这样就可以在 `clang` 构建中禁用 `-fno-omit-frame-pointer`，平均可将性能提升至少 1%。[#10761](https://github.com/ClickHouse/ClickHouse/pull/10761) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在多个分片间使用浮点权重时 `avgWeighted` 的问题。[#10758](https://github.com/ClickHouse/ClickHouse/pull/10758) ([Baudouin Giard](https://github.com/bgiard)) 。
* 修复了 `parallel_view_processing` 的行为。现在，即使发生异常，所有对 `MATERIALIZED VIEW` 的插入操作也都应当无一例外地完成。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#10757](https://github.com/ClickHouse/ClickHouse/pull/10757) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复组合器 -OrNull 和 -OrDefault 与 -State 一起使用时的问题。[#10741](https://github.com/ClickHouse/ClickHouse/pull/10741) ([hcz](https://github.com/hczhcz)).
* 修复了 `generateRandom` 在嵌套类型中崩溃的问题。修复了 [#10583](https://github.com/ClickHouse/ClickHouse/issues/10583)。[#10734](https://github.com/ClickHouse/ClickHouse/pull/10734) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `SummingMergeTree` 中 `LowCardinality(FixedString)` 键列在合并后可能出现的数据损坏问题。修复 [#10489](https://github.com/ClickHouse/ClickHouse/issues/10489)。[#10721](https://github.com/ClickHouse/ClickHouse/pull/10721) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在使用 'FINAL' 修饰符和 'ORDER BY' 优化时，将主键包裹在函数中导致的问题。[#10715](https://github.com/ClickHouse/ClickHouse/pull/10715) ([Anton Popov](https://github.com/CurtizJ)).
* 修复函数 `h3EdgeAngle` 中可能发生的缓冲区溢出问题。[#10711](https://github.com/ClickHouse/ClickHouse/pull/10711) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复总计行消失的问题。如果查询包含带外部 WHERE 条件的 join 或子查询，总计行可能会被过滤掉。修复了 [#10674](https://github.com/ClickHouse/ClickHouse/issues/10674)。[#10698](https://github.com/ClickHouse/ClickHouse/pull/10698) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 HTTP insert 的原子性。此修复解决了 [#9666](https://github.com/ClickHouse/ClickHouse/issues/9666)。[#10687](https://github.com/ClickHouse/ClickHouse/pull/10687) ([Andrew Onyshchuk](https://github.com/oandrew)).
* 修复了在同一查询中对同一个集合重复使用 `IN` 运算符的问题。[#10686](https://github.com/ClickHouse/ClickHouse/pull/10686) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了一个 bug：当 `readonly=2` 且 `cancel_http_readonly_queries_on_client_close=1` 时，如果客户端关闭，HTTP 请求会卡住。修复了 [#7939](https://github.com/ClickHouse/ClickHouse/issues/7939)、[#7019](https://github.com/ClickHouse/ClickHouse/issues/7019)、[#7736](https://github.com/ClickHouse/ClickHouse/issues/7736)、[#7091](https://github.com/ClickHouse/ClickHouse/issues/7091)。[#10684](https://github.com/ClickHouse/ClickHouse/pull/10684) ([tavplubix](https://github.com/tavplubix)) 。
* 修复 AggregateTransform 构造函数中参数顺序的问题。[#10667](https://github.com/ClickHouse/ClickHouse/pull/10667) ([palasonic1](https://github.com/palasonic1)) 。
* 修复了在启用 `distributed_aggregation_memory_efficient` 时，远程查询无法并行执行的问题。修复 [#10655](https://github.com/ClickHouse/ClickHouse/issues/10655)。[#10664](https://github.com/ClickHouse/ClickHouse/pull/10664) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了带有 `LIMIT` 的查询可能返回错误行数的问题。修复了 [#10566](https://github.com/ClickHouse/ClickHouse/issues/10566)、[#10709](https://github.com/ClickHouse/ClickHouse/issues/10709)。[#10660](https://github.com/ClickHouse/ClickHouse/pull/10660) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个 bug：当表中有大量 parts 时，会导致并发 ALTER 操作被锁定。[#10659](https://github.com/ClickHouse/ClickHouse/pull/10659) ([alesapin](https://github.com/alesapin)).
* 修复了在表启动前 server 已关闭时，StorageBuffer 中 `nullptr` 解引用的问题。[#10641](https://github.com/ClickHouse/ClickHouse/pull/10641) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了带有 `HAVING` 子句的 distributed queries 在谓词优化 (`enable_optimize_predicate_expression=1`) 中的问题 (即需要在发起 server 上进行过滤时) ：通过保留表达式顺序即可修复；此外，还强制聚合器使用列名而非索引。修复：[#10613](https://github.com/ClickHouse/ClickHouse/issues/10613)、[#11413](https://github.com/ClickHouse/ClickHouse/issues/11413)。[#10621](https://github.com/ClickHouse/ClickHouse/pull/10621) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 optimize\_skip\_unused\_shards 在 LowCardinality 下的问题。[#10611](https://github.com/ClickHouse/ClickHouse/pull/10611) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 StorageBuffer 在服务端启动时发生异常导致段错误的问题。修复了 [#10550](https://github.com/ClickHouse/ClickHouse/issues/10550)。[#10609](https://github.com/ClickHouse/ClickHouse/pull/10609) ([tavplubix](https://github.com/tavplubix)).
* 执行 `SYSTEM DROP DNS CACHE` 查询时，还会清除用于检查是否允许用户从某些 IP 地址连接的缓存。[#10608](https://github.com/ClickHouse/ClickHouse/pull/10608) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `MATERIALIZED VIEW` 的内层查询在包含依赖表时返回错误标量结果的问题。[#10603](https://github.com/ClickHouse/ClickHouse/pull/10603) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了同步变更中条件变量的处理问题。在某些情况下，发往该条件变量的信号可能会丢失。[#10588](https://github.com/ClickHouse/ClickHouse/pull/10588) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了在 `loadStoredObject()` 完成前调用 `createDictionary()` 可能导致的崩溃。[#10587](https://github.com/ClickHouse/ClickHouse/pull/10587) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复错误：`the BloomFilter false positive must be a double number between 0 and 1` [#10551](https://github.com/ClickHouse/ClickHouse/issues/10551)。[#10569](https://github.com/ClickHouse/ClickHouse/pull/10569) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了当 ALIAS 列的默认表达式类型与列类型不同时，对其执行 SELECT 出现的问题。[#10563](https://github.com/ClickHouse/ClickHouse/pull/10563) ([Azat Khuzhin](https://github.com/azat)).
* 实现了 DateTime64 与 String 值的比较 (与 DateTime 相同) 。[#10560](https://github.com/ClickHouse/ClickHouse/pull/10560) ([Vasily Nemkov](https://github.com/Enmk)).
* 修复索引损坏问题；在某些情况下，将 compact parts 合并为另一个 compact part 后可能会出现该问题。 [#10531](https://github.com/ClickHouse/ClickHouse/pull/10531) ([Anton Popov](https://github.com/CurtizJ)).
* 默认禁用 GROUP BY 分片键优化 (`optimize_distributed_group_by_sharding_key` 已引入，但由于分片键分析存在一些复杂情况，因此默认关闭，一个简单的例子是在分片键中使用 `if`) ，并修复其在 WITH ROLLUP/CUBE/TOTALS 场景下的问题。[#10516](https://github.com/ClickHouse/ClickHouse/pull/10516) ([Azat Khuzhin](https://github.com/azat)).
* 修复：[#10263](https://github.com/ClickHouse/ClickHouse/issues/10263) (在该 PR 之后，通过 INSERT 发送到 dist 的操作在每次 INSERT 时都会被延迟) 修复：[#8756](https://github.com/ClickHouse/ClickHouse/issues/8756) (该 PR 会在同时满足以下所有条件时导致分布式发送失效 (我猜目前这种配置不太常见) ：`internal_replication == false`、多个本地分片 (会激活 hardlinking 代码) 以及 `distributed_storage_policy` (会导致 `link(2)` 因 `EXDEV` 而失败) ) 。[#10486](https://github.com/ClickHouse/ClickHouse/pull/10486) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 "max\_rows\_to\_sort" 限制相关的错误。[#10268](https://github.com/ClickHouse/ClickHouse/pull/10268) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 对于任何读取外部字典的函数，每次调用时只会获取一次字典并检查一次访问权限。[#10928](https://github.com/ClickHouse/ClickHouse/pull/10928) ([Vitaly Baranov](https://github.com/vitlibar)).

<div id="improvement">
  #### 改进
</div>

* 执行 `ALTER MODIFY TTL` 查询后，可将 `TTL` 应用于旧数据。此行为由设置 `materialize_ttl_after_modify` 控制，且默认启用。[#11042](https://github.com/ClickHouse/ClickHouse/pull/11042) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在字符串字面量、VALUES 和各种文本格式中解析 C 风格的反斜杠转义时 (这是对 SQL 标准的扩展，在 ClickHouse 和 MySQL 中很常见) ，如果遇到未知的转义序列 (例如 `\%` 或 `\w`) ，则保留反斜杠。这样会让 `LIKE` 和 `match` 正则表达式更方便使用 (只需写 `name LIKE 'used\_cars'`，而不用写成 `name LIKE 'used\\_cars'`) ，同时也提高了兼容性。此修复对应 [#10922](https://github.com/ClickHouse/ClickHouse/issues/10922)。[#11208](https://github.com/ClickHouse/ClickHouse/pull/11208) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 读取 Decimal 值时，会截断小数点后的多余位数。此行为与 MySQL 和 PostgreSQL 更加兼容。此修复解决了 [#10202](https://github.com/ClickHouse/ClickHouse/issues/10202)。[#11831](https://github.com/ClickHouse/ClickHouse/pull/11831) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果 ZooKeeper 中的元数据已被移除且不存在，则允许对 Replicated 表执行 DROP (使用 TestKeeper 进行测试且服务器已重启时也会出现这种情况) 。即使与 ZooKeeper 通信时发生错误，也允许对 Replicated 表执行 RENAME。此更改修复了 [#10720](https://github.com/ClickHouse/ClickHouse/issues/10720)。[#11652](https://github.com/ClickHouse/ClickHouse/pull/11652) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 略微优化了从字符串读取 decimal 时的错误诊断信息。此更改关闭了 [#10202](https://github.com/ClickHouse/ClickHouse/issues/10202)。[#11829](https://github.com/ClickHouse/ClickHouse/pull/11829) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复信号处理程序中的 sleep 调用。此前实际休眠时间比预期更短。[#11825](https://github.com/ClickHouse/ClickHouse/pull/11825) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* (仅限 Linux) 与操作系统相关的性能指标 (如 CPU 和 I/O) 即使不具备 `CAP_NET_ADMIN` 能力也可正常工作。[#10544](https://github.com/ClickHouse/ClickHouse/pull/10544) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 新增了 `hostname`，作为函数 `hostName` 的别名。该功能由来自 Yandex.Metrica 的 Victor Tarnavskiy 提议。[#11821](https://github.com/ClickHouse/ClickHouse/pull/11821) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了对跨复制集群上分布式 `DDL` (update/delete/drop partition) 的支持。[#11703](https://github.com/ClickHouse/ClickHouse/pull/11703) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 如果在启动时无法监听某个监听地址 (例如 Docker 内部不可用 IPv6) ，则在服务器日志中记录 warning 而不是 error。请注意，如果服务器无法监听列出的所有地址，仍会像以前一样拒绝启动。此修复见 [#4406](https://github.com/ClickHouse/ClickHouse/issues/4406)。[#11687](https://github.com/ClickHouse/ClickHouse/pull/11687) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* Docker 镜像启动时会创建默认用户和数据库。[#10637](https://github.com/ClickHouse/ClickHouse/pull/10637) ([Paramtamtam](https://github.com/tarampampam)).
* 当多行查询被输出到服务器日志时，各行会被拼接在一起。现在即使在包含多行字符串字面量、标识符和单行注释的情况下，也能正确处理。此修复解决了 [#3853](https://github.com/ClickHouse/ClickHouse/issues/3853)。[#11686](https://github.com/ClickHouse/ClickHouse/pull/11686) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 现在这些命令已支持使用多个名称：CREATE USER、CREATE ROLE、ALTER USER、SHOW CREATE USER、SHOW GRANTS 等。[#11670](https://github.com/ClickHouse/ClickHouse/pull/11670) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 支持在跨复制集群上使用分布式 DDL (`UPDATE/DELETE/DROP PARTITION`) 。[#11508](https://github.com/ClickHouse/ClickHouse/pull/11508) ([frank lee](https://github.com/etah000)) 。
* 如果用户在 `clickhouse-client` 和 `clickhouse-benchmark` 的命令行中以显式值指定了密码，则会从命令行中清除该密码。这可防止密码被 `ps` 及类似工具暴露。[#11665](https://github.com/ClickHouse/ClickHouse/pull/11665) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果 ELF 文件中的调试信息与正在运行的二进制文件不匹配，就不要使用它。这样可以避免在堆栈跟踪中打印错误的函数名和源代码位置。此修复解决了 [#7514](https://github.com/ClickHouse/ClickHouse/issues/7514)。[#11657](https://github.com/ClickHouse/ClickHouse/pull/11657) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 parseDateTimeBestEffortOrNull/Zero 函数中，如果值未被完全解析，则返回 NULL/零。此修复解决了 [#7876](https://github.com/ClickHouse/ClickHouse/issues/7876)。[#11653](https://github.com/ClickHouse/ClickHouse/pull/11653) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 跳过请求 URL 中的空参数。比如，当你写 `http://localhost:8123/?&a=b` 或 `http://localhost:8123/?a=b&&c=d` 时，就可能出现这种情况。此更改修复了 [#10749](https://github.com/ClickHouse/ClickHouse/issues/10749)。[#11651](https://github.com/ClickHouse/ClickHouse/pull/11651) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持将 `groupArrayArray` 和 `groupUniqArrayArray` 用于 `SimpleAggregateFunction`。[#11650](https://github.com/ClickHouse/ClickHouse/pull/11650) ([Volodymyr Kuznetsov](https://github.com/ksvladimir)) 。
* 在分析其他类型的索引条件时，允许通过隐式转换与常量字符串进行比较。这可能会解决 [#11630](https://github.com/ClickHouse/ClickHouse/issues/11630)。[#11648](https://github.com/ClickHouse/ClickHouse/pull/11648) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* [https://github.com/ClickHouse/ClickHouse/pull/7572#issuecomment-642815377](https://github.com/ClickHouse/ClickHouse/pull/7572#issuecomment-642815377) 支持配置默认 HTTPHandlers。[#11628](https://github.com/ClickHouse/ClickHouse/pull/11628) ([Winter Zhang](https://github.com/zhang2014)) 。
* 使更多输入格式可与 Kafka 引擎配合使用。修复过早落盘的问题。修复当 `kafka_num_consumers` 大于 topic 中的分区数量时的性能问题。[#11599](https://github.com/ClickHouse/ClickHouse/pull/11599) ([filimonov](https://github.com/filimonov)).
* 改进 `multiple_joins_rewriter_version=2` 的逻辑。修复 lambda 别名导致的未知列错误。[#11587](https://github.com/ClickHouse/ClickHouse/pull/11587) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 无法解析列声明列表时，会提供更清晰的异常消息。此更改关闭了 [#10403](https://github.com/ClickHouse/ClickHouse/issues/10403)。[#11537](https://github.com/ClickHouse/ClickHouse/pull/11537) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 优化了 `enable_optimize_predicate_expression=1` 对 VIEW 的处理逻辑。[#11513](https://github.com/ClickHouse/ClickHouse/pull/11513) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 为 live view 表添加 PREWHERE 支持。[#11495](https://github.com/ClickHouse/ClickHouse/pull/11495) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 自动更新 DNS 缓存，该缓存用于检查用户是否允许从某个地址连接。[#11487](https://github.com/ClickHouse/ClickHouse/pull/11487) ([tavplubix](https://github.com/tavplubix)) 。
* 即使正在执行并发合并，OPTIMIZE FINAL 也会强制触发合并。此项更改修复了 [#11309](https://github.com/ClickHouse/ClickHouse/issues/11309) 和 [#11322](https://github.com/ClickHouse/ClickHouse/issues/11322)。[#11346](https://github.com/ClickHouse/ClickHouse/pull/11346) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 clickhouse-client 中抑制已取消查询的输出。在早期版本中，即使按下 Ctrl+C 取消查询，结果也可能仍会继续打印到终端。此修复关闭了 [#9473](https://github.com/ClickHouse/ClickHouse/issues/9473)。 [#11342](https://github.com/ClickHouse/ClickHouse/pull/11342) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在，历史文件会在每次查询后更新；即使多个客户端共用同一个历史文件，也不会出现竞态条件。此修复解决了 [#9897](https://github.com/ClickHouse/ClickHouse/issues/9897)。[#11453](https://github.com/ClickHouse/ClickHouse/pull/11453) ([Tagir Kuskarov](https://github.com/kuskarov)) 。
* 改进了重新加载配置时的日志消息。[#11341](https://github.com/ClickHouse/ClickHouse/pull/11341) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在某些情况下，移除 `clickhouse-client` 或 `clickhouse-format` 格式化查询中的行尾空白。[#11325](https://github.com/ClickHouse/ClickHouse/pull/11325) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增设置 "output\_format\_pretty\_max\_value\_width"。如果值过长，将会被截断，以避免在终端输出过大的值。此更改修复了 [#11140](https://github.com/ClickHouse/ClickHouse/issues/11140)。[#11324](https://github.com/ClickHouse/ClickHouse/pull/11324) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在内存映射数量不足时，异常消息得到了改进。此项修复关闭了 [#11027](https://github.com/ClickHouse/ClickHouse/issues/11027)。[#11316](https://github.com/ClickHouse/ClickHouse/pull/11316) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* ASOF JOIN 现已支持 (U)Int8、(U)Int16 和 Date。[#11301](https://github.com/ClickHouse/ClickHouse/pull/11301) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 为 Kafka 表支持 `kafka&#95;client&#95;id` 参数。还将 ClickHouse 与 Kafka 通信时默认使用的 `client.id` 修改得更详细、更易用。[#11252](https://github.com/ClickHouse/ClickHouse/pull/11252) ([filimonov](https://github.com/filimonov)) 。
* 在发生异常时，保留 `DistributedFilesToInsert` 指标的值。此前版本中，该值会在准备发送某些文件时被设置；但如果发生异常且仍有部分文件处于待处理状态，该值就会变为 0。现在，它表示 filesystem 中待处理文件的数量。[#11220](https://github.com/ClickHouse/ClickHouse/pull/11220) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增对多词数据类型名称 (例如 `DOUBLE PRECISION` 和 `CHAR VARYING`) 的支持，以提升 SQL 兼容性。[#11214](https://github.com/ClickHouse/ClickHouse/pull/11214) ([Павел Потемкин](https://github.com/Potya)).
* 为某些数据类型增加同义词。[#10856](https://github.com/ClickHouse/ClickHouse/pull/10856) ([Павел Потемкин](https://github.com/Potya)).
* 查询日志现默认默认启用。[#11184](https://github.com/ClickHouse/ClickHouse/pull/11184) ([Ivan Blinkov](https://github.com/blinkov)) 。
* 在 system.users 表中以及执行 SHOW CREATE USER 查询时，显示身份验证类型。[#11080](https://github.com/ClickHouse/ClickHouse/pull/11080) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在显式执行 `DROP DATABASE` 时，删除 `Memory` 数据库引擎中的数据。修复了 [#10557](https://github.com/ClickHouse/ClickHouse/issues/10557)。[#11021](https://github.com/ClickHouse/ClickHouse/pull/11021) ([tavplubix](https://github.com/tavplubix)) 。
* 为 rdkafka 库的内部线程设置线程名称。让 rdkafka 的日志可在服务器日志中查看。[#10983](https://github.com/ClickHouse/ClickHouse/pull/10983) ([Azat Khuzhin](https://github.com/azat)).
* 支持查询中的 Unicode 空白字符。这有助于处理从 Word 或网页复制粘贴的查询。此项修复解决了 [#10896](https://github.com/ClickHouse/ClickHouse/issues/10896)。[#10903](https://github.com/ClickHouse/ClickHouse/pull/10903) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 允许在函数 `tupleElement` 中将较大的 UInt 类型用作索引。[#10874](https://github.com/ClickHouse/ClickHouse/pull/10874) ([hcz](https://github.com/hczhcz)).
* 在向 Distributed 表执行 INSERT 时，遵循 prefer\_localhost\_replica/load\_balancing 设置。[#10867](https://github.com/ClickHouse/ClickHouse/pull/10867) ([Azat Khuzhin](https://github.com/azat)) 。
* 引入 `min_insert_block_size_rows_for_materialized_views`、`min_insert_block_size_bytes_for_materialized_views` 设置。这些设置类似于 `min_insert_block_size_rows` 和 `min_insert_block_size_bytes`，但仅对插入到 `MATERIALIZED VIEW` 的块生效。这有助于控制推送到 MV 时的块合并，并避免过高的内存占用。 [#10858](https://github.com/ClickHouse/ClickHouse/pull/10858) ([Azat Khuzhin](https://github.com/azat)).
* 解决服务器关闭期间复制队列中的异常。修复了 [#10819](https://github.com/ClickHouse/ClickHouse/issues/10819)。[#10841](https://github.com/ClickHouse/ClickHouse/pull/10841) ([alesapin](https://github.com/alesapin)) 。
* 确保 `varSamp`、`varPop` 不会因数值误差返回负值，并且 `stddevSamp`、`stddevPop` 不会基于负方差计算。此项修复对应 [#10532](https://github.com/ClickHouse/ClickHouse/issues/10532)。[#10829](https://github.com/ClickHouse/ClickHouse/pull/10829) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 改进了 DNS 异常消息。此修复解决了 [#10813](https://github.com/ClickHouse/ClickHouse/issues/10813)。[#10828](https://github.com/ClickHouse/ClickHouse/pull/10828) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在某些 parse 错误情况下，将 HTTP 响应码改为 400 Bad Request。此修复了 [#10636](https://github.com/ClickHouse/ClickHouse/issues/10636)。[#10640](https://github.com/ClickHouse/ClickHouse/pull/10640) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果 clickhouse-client 版本高于 clickhouse-server，则打印一条消息。[#10627](https://github.com/ClickHouse/ClickHouse/pull/10627) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了对 `INSERT INTO [db.]table WATCH` 查询的支持。[#10498](https://github.com/ClickHouse/ClickHouse/pull/10498) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 支持在 clickhouse-client 中传入 quota\_key。此更改关闭了 [#10227](https://github.com/ClickHouse/ClickHouse/issues/10227)。[#10270](https://github.com/ClickHouse/ClickHouse/pull/10270) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 允许多个副本并发分配合并、变更、删除分区、移动和替换操作。此更改修复了 [#10367](https://github.com/ClickHouse/ClickHouse/issues/10367)。 [#11639](https://github.com/ClickHouse/ClickHouse/pull/11639) ([alexey-milovidov](https://github.com/alexey-milovidov)) [#11795](https://github.com/ClickHouse/ClickHouse/pull/11795) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 针对表排序键优化了 GROUP BY，可通过 `optimize_aggregation_in_order` 设置启用。[#9113](https://github.com/ClickHouse/ClickHouse/pull/9113) ([dimarub2000](https://github.com/dimarub2000)).
* 带 FINAL 的 SELECT 查询现已支持并行执行。新增设置 `max_final_threads`，用于限制使用的线程数。[#10463](https://github.com/ClickHouse/ClickHouse/pull/10463) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在生成较小块时 (并行解析时的典型情况) ，可通过 `INSERT SELECT` 或使用 clickhouse-client 执行 INSERT 来提升 INSERT 查询性能。此修复解决了 [#11275](https://github.com/ClickHouse/ClickHouse/issues/11275)。修复了 CONSTRAINT 对 DEFAULT 字段不起作用的问题。此修复解决了 [#11273](https://github.com/ClickHouse/ClickHouse/issues/11273)。修复了 TEMPORARY 表中 CONSTRAINTS 被忽略的问题。此修复解决了 [#11274](https://github.com/ClickHouse/ClickHouse/issues/11274)。[#11276](https://github.com/ClickHouse/ClickHouse/pull/11276) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 一项优化：消除 `SELECT` 部分中对 `GROUP BY` 键使用的 min/max/any 聚合器，可通过 `optimize_aggregators_of_group_by_keys` 设置启用。[#11667](https://github.com/ClickHouse/ClickHouse/pull/11667) ([xPoSx](https://github.com/xPoSx)). [#11806](https://github.com/ClickHouse/ClickHouse/pull/11806) ([Azat Khuzhin](https://github.com/azat)).
* 一项新的优化，可将所有操作移出 `any` 函数，通过 `optimize_move_functions_out_of_any` 启用 [#11529](https://github.com/ClickHouse/ClickHouse/pull/11529) ([Ruslan](https://github.com/kamalov-ruslan)) 。
* 在交互模式下使用 Pretty formats 时，改进了 `clickhouse-client` 的性能。在之前的版本中，计算 UTF-8 字符串的可见宽度可能会花费大量时间。此更改关闭了 [#11323](https://github.com/ClickHouse/ClickHouse/issues/11323)。[#11323](https://github.com/ClickHouse/ClickHouse/pull/11323) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 优化了带有 `ORDER BY` 且 `LIMIT` 较小 (小于 `max_block_size`) 的查询性能。[#11171](https://github.com/ClickHouse/ClickHouse/pull/11171) ([Albert Kidrachev](https://github.com/Provet)) 。
* 添加运行时 CPU 检测，以选择并调度最佳的函数实现。新增对面向多个目标进行代码生成的支持。此项已关闭 [#1017](https://github.com/ClickHouse/ClickHouse/issues/1017)。[#10058](https://github.com/ClickHouse/ClickHouse/pull/10058) ([DimasKovas](https://github.com/DimasKovas)).
* 默认启用对 `clickhouse` 二进制文件的 `mlock`。这可以防止 `clickhouse` 可执行文件在高 IO 负载下被换出到磁盘。[#11139](https://github.com/ClickHouse/ClickHouse/pull/11139) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 使使用 `sum` 聚合函数且不带 GROUP BY 键的查询运行速度提高数倍。[#10992](https://github.com/ClickHouse/ClickHouse/pull/10992) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 通过消除一些冗余的数据移动，优化了 radix sort (用于在 `ORDER BY` 中处理简单键) 。[#10981](https://github.com/ClickHouse/ClickHouse/pull/10981) ([Arslan Gumerov](https://github.com/g-arslan)) 。
* 在 MergeJoin 中对左表中较大的 parts 进行排序。将左侧块缓存在内存中。新增 `partial_merge_join_left_table_buffer_bytes` 设置，用于控制左侧块缓冲区的大小。[#10601](https://github.com/ClickHouse/ClickHouse/pull/10601) ([Artem Zuikov](https://github.com/4ertus2)).
* 移除子查询中重复的 ORDER BY 和 DISTINCT；此优化可通过 `optimize_duplicate_order_by_and_distinct` 启用 [#10067](https://github.com/ClickHouse/ClickHouse/pull/10067) ([Mikhail Malafeev](https://github.com/demo-99)) 。
* 此功能会消除 GROUP BY 部分中其他键上的函数，可通过 `optimize_group_by_function_keys` 启用 [#10051](https://github.com/ClickHouse/ClickHouse/pull/10051) ([xPoSx](https://github.com/xPoSx)).
* 新增了一项优化：将算术运算从聚合函数中移出，可通过 `optimize_arithmetic_operations_in_aggregate_functions` 启用 [#10047](https://github.com/ClickHouse/ClickHouse/pull/10047) ([Ruslan](https://github.com/kamalov-ruslan)) 。
* 使用基于 Poco 而不是 curl 的 S3 HTTP 客户端。这将提升 S3 存储和表函数的性能，并降低其内存占用。[#11230](https://github.com/ClickHouse/ClickHouse/pull/11230) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了与基于限制的重调度有关的 Kafka 性能问题；此前这些限制总是会被应用。[#11149](https://github.com/ClickHouse/ClickHouse/pull/11149) ([filimonov](https://github.com/filimonov)).
* 为 jemalloc 启用 percpu\_arena:percpu (这将减少线程池导致的内存碎片) 。[#11084](https://github.com/ClickHouse/ClickHouse/pull/11084) ([Azat Khuzhin](https://github.com/azat)).
* 优化从 S3 HTTP 客户端读取响应时的内存占用。 [#11561](https://github.com/ClickHouse/ClickHouse/pull/11561) ([Pavel Kovalenko](https://github.com/Jokser)).
* 调整默认 Kafka 设置以提升性能。[#11388](https://github.com/ClickHouse/ClickHouse/pull/11388) ([filimonov](https://github.com/filimonov)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增数据类型 `Point` (Tuple(Float64, Float64)) 和 `Polygon` (Array(Array(Tuple(Float64, Float64)))。[#10678](https://github.com/ClickHouse/ClickHouse/pull/10678) ([Alexey Ilyukhov](https://github.com/livace)) 。
* 新增 `hasSubstr` 函数，可用于在数组中查找子序列。注意：该函数很可能会在不另行通知的情况下更名。[#11071](https://github.com/ClickHouse/ClickHouse/pull/11071) ([Ryad Zenine](https://github.com/r-zenine)) 。
* 新增了 OpenCL 支持和 bitonic 排序算法，可用于对单列中的整数类型数据排序。构建时需要使用标志 `-DENABLE_OPENCL=1`。若要使用 bitonic 排序算法而非其他算法，需要将 Setting 选项 `special_sort` 设置为 `bitonic_sort`，并确保 OpenCL 可用。此功能不会提升性能或带来其他改进，仅作为示例和演示用途提供。如果这一方向后续没有进一步发展，它很可能会在不久的将来被移除。[#10232](https://github.com/ClickHouse/ClickHouse/pull/10232) ([Ri](https://github.com/margaritiko)) 。

<div id="buildtestingpackaging-improvement-11">
  #### 构建、测试和打包改进
</div>

* 对 programs 和 utils 启用 clang-tidy。[#10991](https://github.com/ClickHouse/ClickHouse/pull/10991) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 移除对 `tzdata` 的依赖：如果 `/usr/share/zoneinfo` 目录不存在，也不会报错。请注意，即使系统中未安装 tzdata，ClickHouse 中的所有时区也都能正常工作。[#11827](https://github.com/ClickHouse/ClickHouse/pull/11827) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了 MSan 和 UBSan 压力测试。请注意，我们已经有用于功能测试的 MSan 和 UBSan，而 "stress" 测试则是另一类测试。[#10871](https://github.com/ClickHouse/ClickHouse/pull/10871) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在崩溃消息中打印编译器构建 ID。这能让我们更准确地判断发生崩溃的是哪个 binary。新增函数 `buildId`。[#11824](https://github.com/ClickHouse/ClickHouse/pull/11824) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一项测试，以确保在执行 FREEZE 查询后，变更操作仍能正常工作。[#11820](https://github.com/ClickHouse/ClickHouse/pull/11820) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 不允许测试名称中包含子串 "fail"，因为这样一来，当你在浏览器中查看测试结果并按下 Ctrl+F 搜索 "fail" 时，就没那么方便了。[#11817](https://github.com/ClickHouse/ClickHouse/pull/11817) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 移除了 HTTPHandlerFactory 中未使用的导入。[#11660](https://github.com/ClickHouse/ClickHouse/pull/11660) ([Bharat Nallan](https://github.com/bharatnc)).
* 新增了对执行 copier 的实例进行随机采样，以避免出现 `Too many simultaneous queries` 错误。同时还延长了超时时间并降低了故障概率。[#11573](https://github.com/ClickHouse/ClickHouse/pull/11573) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复遗漏的 include 文件。[#11525](https://github.com/ClickHouse/ClickHouse/pull/11525) ([Matwey V. Kornilov](https://github.com/matwey)) 。
* 通过删除旧示例程序加快了构建速度。还发现了一些遗留的功能测试。[#11486](https://github.com/ClickHouse/ClickHouse/pull/11486) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在 CI 中增大构建时的 ccache 大小。[#11450](https://github.com/ClickHouse/ClickHouse/pull/11450) ([alesapin](https://github.com/alesapin)).
* 在 deb 构建中只保留 unit\_tests\_dbms。[#11429](https://github.com/ClickHouse/ClickHouse/pull/11429) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 将 librdkafka 升级到 [1.4.2](https://github.com/edenhill/librdkafka/releases/tag/v1.4.2) 版本。[#11256](https://github.com/ClickHouse/ClickHouse/pull/11256) ([filimonov](https://github.com/filimonov)) 。
* 重构了 CMake 构建文件。[#11390](https://github.com/ClickHouse/ClickHouse/pull/11390) ([Ivan](https://github.com/abyss7)) 。
* 修复若干个偶发失败的集成测试。[#11355](https://github.com/ClickHouse/ClickHouse/pull/11355) ([alesapin](https://github.com/alesapin)).
* 新增了对使用 UBSan 运行单元测试的支持。[#11345](https://github.com/ClickHouse/ClickHouse/pull/11345) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 从集成测试 `test_insertion_sync_fails_with_timeout` 中移除多余的超时设置。[#11343](https://github.com/ClickHouse/ClickHouse/pull/11343) ([alesapin](https://github.com/alesapin)).
* 改进了对 clickhouse-test 中挂起查询的检查。[#11321](https://github.com/ClickHouse/ClickHouse/pull/11321) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果 server 构建为调试版本或启用了 sanitizers，则发出警告。[#11304](https://github.com/ClickHouse/ClickHouse/pull/11304) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 现在，`clickhouse-test` 会在测试开始前检查服务器是否在线。[#11285](https://github.com/ClickHouse/ClickHouse/pull/11285) ([alesapin](https://github.com/alesapin)) 。
* 修复了可能存在不稳定性的测试 `00731_long_merge_tree_select_opened_files.sh`。该测试并不经常失败，但我们在使用 ThreadFuzzer 进行实验时，发现其中存在潜在的竞态条件：[#9814](https://github.com/ClickHouse/ClickHouse/issues/9814)。示例见[链接](https://clickhouse-test-reports.s3.yandex.net/9814/40e3023e215df22985d275bf85f4d2290897b76b/functional_stateless_tests_\(unbundled\).html#fail1)。[#11270](https://github.com/ClickHouse/ClickHouse/pull/11270) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 如果 `curl` 调用超时，则在 CI 中重新运行测试。这可能是由于我们的 CI 基础设施中常见的、持续 10 秒以上的系统卡顿造成的。此更改修复了 [#11267](https://github.com/ClickHouse/ClickHouse/issues/11267)。[#11268](https://github.com/ClickHouse/ClickHouse/pull/11268) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 由 @donmikel 为 Join 表引擎添加了一项测试。此更改关闭了 [#9158](https://github.com/ClickHouse/ClickHouse/issues/9158)。[#11265](https://github.com/ClickHouse/ClickHouse/pull/11265) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了单元测试中的几个无关紧要的错误。[#11262](https://github.com/ClickHouse/ClickHouse/pull/11262) ([alesapin](https://github.com/alesapin)) 。
* 现在，`cctz` 库的链接器命令部分将不会再与其他库交错在一起。[#11213](https://github.com/ClickHouse/ClickHouse/pull/11213) ([alesapin](https://github.com/alesapin)) 。
* 将 /programs/server 拆分为实际的可执行程序和库。[#11186](https://github.com/ClickHouse/ClickHouse/pull/11186) ([Ivan](https://github.com/abyss7)) 。
* 改进 protobuf 和 gRPC 的构建脚本。 [#11172](https://github.com/ClickHouse/ClickHouse/pull/11172) ([Vitaly Baranov](https://github.com/vitlibar)).
* 启用此前未能正常工作的性能测试。[#11158](https://github.com/ClickHouse/ClickHouse/pull/11158) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在启动任何 CH 实例之前，先为测试创建根 S3 bucket。[#11142](https://github.com/ClickHouse/ClickHouse/pull/11142) ([Pavel Kovalenko](https://github.com/Jokser)) 。
* 为非常量 Polygon 增加性能测试。[#11141](https://github.com/ClickHouse/ClickHouse/pull/11141) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 `00979_live_view_watch_continuous_aggregates` 测试。[#11024](https://github.com/ClickHouse/ClickHouse/pull/11024) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 新增了在集成测试中通过 tmpfs 运行 zookeeper 的能力。[#11002](https://github.com/ClickHouse/ClickHouse/pull/11002) ([alesapin](https://github.com/alesapin)).
* 使用指数退避机制等待 odbc-bridge。此前在我们的 CI 环境中，200 ms 的等待时间还不够。 [#10990](https://github.com/ClickHouse/ClickHouse/pull/10990) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复非确定性的测试。[#10989](https://github.com/ClickHouse/ClickHouse/pull/10989) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为外部空数据添加了相关测试。[#10926](https://github.com/ClickHouse/ClickHouse/pull/10926) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 每次测试都会重新创建数据库。这样可以更好地隔离各项测试。 [#10902](https://github.com/ClickHouse/ClickHouse/pull/10902) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在列代码中增加了更多断言。[#10833](https://github.com/ClickHouse/ClickHouse/pull/10833) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 改进了与 sanitizers 的配合。在 sanitizer 失败消息中打印 query\_id 信息。[#10832](https://github.com/ClickHouse/ClickHouse/pull/10832) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 "Split build smoke test" 检查中明显的竞态条件。[#10820](https://github.com/ClickHouse/ClickHouse/pull/10820) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 MergeTreeIndexFullText 中的 MSan (误报) 报告。该问题最早出现在 [#9968](https://github.com/ClickHouse/ClickHouse/issues/9968)。[#10801](https://github.com/ClickHouse/ClickHouse/pull/10801) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 MariaDB Client 库添加 MSan 抑制规则。 [#10800](https://github.com/ClickHouse/ClickHouse/pull/10800) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* GRPC make 未能找到 protobuf 文件，因此通过添加正确的链接修改了 make 文件。[#10794](https://github.com/ClickHouse/ClickHouse/pull/10794) ([mnkonkova](https://github.com/mnkonkova)) 。
* 为 base、utils 和 programs 启用额外警告 (`-Weverything`) 。请注意，我们已经在大部分代码中启用了该警告。[#10779](https://github.com/ClickHouse/ClickHouse/pull/10779) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在 [#10396](https://github.com/ClickHouse/ClickHouse/issues/10396) 中，来自库的警告抑制被误声明为公开。[#10776](https://github.com/ClickHouse/ClickHouse/pull/10776) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 恢复了一个在 [#10396](https://github.com/ClickHouse/ClickHouse/issues/10396) 中被意外删除的补丁。[#10774](https://github.com/ClickHouse/ClickHouse/pull/10774) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复性能测试中的错误，第二部分。 [#10773](https://github.com/ClickHouse/ClickHouse/pull/10773) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复性能测试中的错误。[#10766](https://github.com/ClickHouse/ClickHouse/pull/10766) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 将交叉构建更新为使用 clang-10 编译器。[#10724](https://github.com/ClickHouse/ClickHouse/pull/10724) ([Ivan](https://github.com/abyss7)) 。
* 更新了 RPM 软件包安装说明。这项修改由 Denis (TG 登录名 @ldviolet) 建议，Arkady Shejn 完成实现。[#10707](https://github.com/ClickHouse/ClickHouse/pull/10707) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 尝试修复 `tests/queries/0_stateless/01246_insert_into_watch_live_view.py` 测试。[#10670](https://github.com/ClickHouse/ClickHouse/pull/10670) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 修复并重新启用 00979\_live\_view\_watch\_continuous\_aggregates.py 测试。 [#10658](https://github.com/ClickHouse/ClickHouse/pull/10658) ([vzakaznikov](https://github.com/vzakaznikov)) 。
* 修复 ASan 压力测试中的 OOM 问题。 [#10646](https://github.com/ClickHouse/ClickHouse/pull/10646) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了迁移到 clang-10 后在 HashTable 中出现的 UBSan 报告问题 (向 nullptr 加 0) 。[#10638](https://github.com/ClickHouse/ClickHouse/pull/10638) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 在编译时处理 tzdata 期间，移除对 `ld` (bfd) 链接器的外部调用。[#10634](https://github.com/ClickHouse/ClickHouse/pull/10634) ([alesapin](https://github.com/alesapin)).
* 支持使用 `lld` 链接 blob (资源) 。[#10632](https://github.com/ClickHouse/ClickHouse/pull/10632) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 `LZ4` 库中 UBSan 报告的问题。[#10631](https://github.com/ClickHouse/ClickHouse/pull/10631) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。另请参见 [https://github.com/lz4/lz4/issues/857](https://github.com/lz4/lz4/issues/857)
* 将 LZ4 更新到最新的开发分支。[#10630](https://github.com/ClickHouse/ClickHouse/pull/10630) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一个自动生成的、机器可读的文件，包含稳定版本列表。[#10628](https://github.com/ClickHouse/ClickHouse/pull/10628) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 `capnp::UnalignedFlatArrayMessageReader` 的 `capnproto` 版本检查问题。[#10618](https://github.com/ClickHouse/ClickHouse/pull/10618) ([Matwey V. Kornilov](https://github.com/matwey)) 。
* 降低测试中的内存占用。[#10617](https://github.com/ClickHouse/ClickHouse/pull/10617) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了新 live view 测试中的硬编码超时问题。[#10604](https://github.com/ClickHouse/ClickHouse/pull/10604) ([vzakaznikov](https://github.com/vzakaznikov)).
* 在 tests/queries/0\_stateless/helpers/client.py 中，打开客户端时增加超时时间。[#10599](https://github.com/ClickHouse/ClickHouse/pull/10599) ([vzakaznikov](https://github.com/vzakaznikov)).
* 为 clang 构建启用 ThinLTO，作为 [#10435](https://github.com/ClickHouse/ClickHouse/pull/10435) 的延续。[#10585](https://github.com/ClickHouse/ClickHouse/pull/10585) ([Amos Bird](https://github.com/amosbird)) 。
* 添加 fuzzers，并为集成到 oss-fuzz 做准备。[#10546](https://github.com/ClickHouse/ClickHouse/pull/10546) ([kyprizel](https://github.com/kyprizel)).
* 修复 FreeBSD 的构建问题。[#10150](https://github.com/ClickHouse/ClickHouse/pull/10150) ([Ivan](https://github.com/abyss7)) 。
* 新增了一个基于 pytest 框架的查询测试构建。[#10039](https://github.com/ClickHouse/ClickHouse/pull/10039) ([Ivan](https://github.com/abyss7)) 。

<div id="clickhouse-release-v204">
  ## ClickHouse 发布版本 v20.4
</div>

<div id="clickhouse-release-v204899-stable-2020-08-10">
  ### ClickHouse 发布版本 v20.4.8.99-稳定版本 2020-08-10
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 `parseDateTimeBestEffort` 函数在将 Unix 时间戳作为参数传入时出现的错误。修复了 [#13362](https://github.com/ClickHouse/ClickHouse/issues/13362)。[#13441](https://github.com/ClickHouse/ClickHouse/pull/13441) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了对包含 NaN 值的 Float 类型调用 `uniqExact`、`topK`、`sumDistinct` 及类似聚合函数时，可能出现的性能偏低和结果略有偏差的问题。该问题还会在 debug 构建中触发断言。此修复解决了 [#12491](https://github.com/ClickHouse/ClickHouse/issues/12491)。[#13254](https://github.com/ClickHouse/ClickHouse/pull/13254) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了当 cond 为 Nullable constexpr 且不是字面量 NULL 时的 if 函数问题。修复了 [#12463](https://github.com/ClickHouse/ClickHouse/issues/12463)。[#13226](https://github.com/ClickHouse/ClickHouse/pull/13226) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `arrayElement` 函数中的断言错误，该错误会在数组元素为 Nullable 且数组下标也为 Nullable 时发生。此修复解决了 [#12172](https://github.com/ClickHouse/ClickHouse/issues/12172)。[#13224](https://github.com/ClickHouse/ClickHouse/pull/13224) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了带有函数的索引分析错误。在读取 `MergeTree` 表时，这可能会导致错误地剪枝 parts。修复了 [#13060](https://github.com/ClickHouse/ClickHouse/issues/13060)。修复了 [#12406](https://github.com/ClickHouse/ClickHouse/issues/12406)。[#13081](https://github.com/ClickHouse/ClickHouse/pull/13081) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了从本地副本执行 select 时，对线程数量施加的不必要限制。[#12840](https://github.com/ClickHouse/ClickHouse/pull/12840) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了数据中可能出现额外溢出行的问题，该问题可能发生在带有 `WITH TOTALS` 的查询中。[#12747](https://github.com/ClickHouse/ClickHouse/pull/12747) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `IN` 子句中将大型 Tuple 解释为函数时的性能问题。也就是用户出于某种莫名其妙的原因写成 `WHERE x IN tuple(1, 2, ...)`，而不是 `WHERE x IN (1, 2, ...)` 的情况。[#12700](https://github.com/ClickHouse/ClickHouse/pull/12700) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `input_format_parallel_parsing` 的内存跟踪问题 (通过将线程关联到组) 。[#12672](https://github.com/ClickHouse/ClickHouse/pull/12672) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 [#12293](https://github.com/ClickHouse/ClickHouse/issues/12293)：当子查询包含 WITH 子句时，允许下推谓词。[#12663](https://github.com/ClickHouse/ClickHouse/pull/12663) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 [#10572](https://github.com/ClickHouse/ClickHouse/issues/10572) 中布隆过滤器索引在 const 表达式下的问题。[#12659](https://github.com/ClickHouse/ClickHouse/pull/12659) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 `StorageKafka` 在 broker 不可用等情况下出现的 `SIGSEGV`。 [#12658](https://github.com/ClickHouse/ClickHouse/pull/12658) ([Azat Khuzhin](https://github.com/azat)).
* 新增了对参数为 `Array(UUID)` 的函数 `if` 的支持。此更改修复了 [#11066](https://github.com/ClickHouse/ClickHouse/issues/11066)。[#12648](https://github.com/ClickHouse/ClickHouse/pull/12648) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了使用 cache 布局的外部字典中的竞态条件，该问题可能导致服务器崩溃。[#12566](https://github.com/ClickHouse/ClickHouse/pull/12566) ([alesapin](https://github.com/alesapin)).
* 在 DROP TABLE 时，会删除分布式表的数据 (来自异步 INSERT 的块) 。[#12556](https://github.com/ClickHouse/ClickHouse/pull/12556) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个 bug：当 `enable_mixed_granularity_parts=1` 时，执行 `ALTER DELETE` 查询后，旧的 parts 会损坏。修复了 [#12536](https://github.com/ClickHouse/ClickHouse/issues/12536)。[#12543](https://github.com/ClickHouse/ClickHouse/pull/12543) ([alesapin](https://github.com/alesapin)) 。
* 改进了函数 `in` 在参数个数无效时的异常信息。[#12529](https://github.com/ClickHouse/ClickHouse/pull/12529) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了读取 compact parts 时的性能问题。[#12492](https://github.com/ClickHouse/ClickHouse/pull/12492) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了使用字典进行 JOIN 时的崩溃问题，该问题会在按字典键表达式进行连接时出现：`t JOIN dict ON expr(dict.id) = t.id`。对此情况禁用了字典 JOIN 优化。[#12458](https://github.com/ClickHouse/ClickHouse/pull/12458) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了 StorageMerge 中可能出现的段错误。关闭了 [#12054](https://github.com/ClickHouse/ClickHouse/issues/12054)。[#12401](https://github.com/ClickHouse/ClickHouse/pull/12401) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `WITH FILL` 修饰符中的列顺序。此前未遵循 `ORDER BY` 语句中的列顺序。[#12306](https://github.com/ClickHouse/ClickHouse/pull/12306) ([Anton Popov](https://github.com/CurtizJ)).
* 避免在存在按虚拟列 (如 `Merge` 表中的 `_table`) 或系统表中的“索引”列过滤数据的表达式时出现 "bad cast" 异常，例如在查询 `system.tables` 时按 database 名称过滤，且该表达式返回 `Nullable` 类型时。此修复对应 [#12166](https://github.com/ClickHouse/ClickHouse/issues/12166)。[#12305](https://github.com/ClickHouse/ClickHouse/pull/12305) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* TrieDictionary 加载失败后会显示错误信息。[#12290](https://github.com/ClickHouse/ClickHouse/pull/12290) ([Vitaly Baranov](https://github.com/vitlibar)).
* 函数 `arrayFill` 在处理空数组时存在错误，可能会导致崩溃。此修复解决了 [#12263](https://github.com/ClickHouse/ClickHouse/issues/12263)。[#12279](https://github.com/ClickHouse/ClickHouse/pull/12279) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 已实现将 `LowCardinality` 类型转换为通用类型。这使得包含 `LowCardinality` 列和其他列的表可以执行 UNION ALL。此项修复解决了 [#8212](https://github.com/ClickHouse/ClickHouse/issues/8212)。此项修复解决了 [#4342](https://github.com/ClickHouse/ClickHouse/issues/4342)。[#12275](https://github.com/ClickHouse/ClickHouse/pull/12275) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `StorageFile` 中在多次顺序插入期间，某些特殊类型的请求头被重复写入的问题。此修复解决了 [#6155](https://github.com/ClickHouse/ClickHouse/issues/6155)。[#12197](https://github.com/ClickHouse/ClickHouse/pull/12197) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 UInt8 值不等于 0 或 1 时逻辑函数的问题。[#12196](https://github.com/ClickHouse/ClickHouse/pull/12196) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 将 max\_memory\_usage\* 的上限限定为进程常驻内存。 [#12182](https://github.com/ClickHouse/ClickHouse/pull/12182) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在消除 GROUP BY 中的单射函数时对 `dictGet` 参数的检查问题。[#12179](https://github.com/ClickHouse/ClickHouse/pull/12179) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果 ODBC 连接不支持 schema，则不要将字典源的表名拆分为 schema 和表名。[#12165](https://github.com/ClickHouse/ClickHouse/pull/12165) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复了 `ALTER DELETE` 中的错误逻辑：当条件计算结果为 NULL 时，会误删记录。此修复解决了 [#9088](https://github.com/ClickHouse/ClickHouse/issues/9088)，并关闭了 [#12106](https://github.com/ClickHouse/ClickHouse/issues/12106)。[#12153](https://github.com/ClickHouse/ClickHouse/pull/12153) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在存在别名时，发送到外部 DBMS (例如 MySQL、ODBC) 的查询转换问题。此修复解决了 [#12032](https://github.com/ClickHouse/ClickHouse/issues/12032)。[#12151](https://github.com/ClickHouse/ClickHouse/pull/12151) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了整数除法中潜在的溢出问题。该修复解决了 [#12119](https://github.com/ClickHouse/ClickHouse/issues/12119)。[#12140](https://github.com/ClickHouse/ClickHouse/pull/12140) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `greatCircleDistance` 和 `geoDistance` 中潜在的无限循环。此修复解决了 [#12117](https://github.com/ClickHouse/ClickHouse/issues/12117)。[#12137](https://github.com/ClickHouse/ClickHouse/pull/12137) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 规范了 "pid" 文件的处理方式。在之前的版本中，如果 server 在未正常关闭的情况下被强制终止，且存在另一个进程使用了与此前运行的 server 相同的 pid，server 可能会拒绝启动。此外，即使另一个 server 仍在运行，如果 server 启动失败，pid 文件也可能被删除。此修复解决了 [#3501](https://github.com/ClickHouse/ClickHouse/issues/3501)。[#12133](https://github.com/ClickHouse/ClickHouse/pull/12133) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了带有 ENGINE=Dictionary 的表对字典的依赖关系处理问题。此修复解决了 [#10994](https://github.com/ClickHouse/ClickHouse/issues/10994)。此修复解决了 [#10397](https://github.com/ClickHouse/ClickHouse/issues/10397)。[#12116](https://github.com/ClickHouse/ClickHouse/pull/12116) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了带有 `UNION` 的 select 查询因总线程数限制错误导致的性能问题。修复 [#12030](https://github.com/ClickHouse/ClickHouse/issues/12030)。[#12103](https://github.com/ClickHouse/ClickHouse/pull/12103) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `-StateResample` 组合器引发的段错误。[#12092](https://github.com/ClickHouse/ClickHouse/pull/12092) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `system.quey_log` 中针对 SELECT 查询的 `result_rows` 和 `result_bytes` 指标为空的问题。修复了 [#11595](https://github.com/ClickHouse/ClickHouse/issues/11595)。[#12089](https://github.com/ClickHouse/ClickHouse/pull/12089) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从 `VIEW` 执行 select 查询时对线程数进行不必要限制的问题。修复了 [#11937](https://github.com/ClickHouse/ClickHouse/issues/11937)。[#12085](https://github.com/ClickHouse/ClickHouse/pull/12085) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `PREWHERE` 使用错误类型时可能导致的崩溃。修复 [#12053](https://github.com/ClickHouse/ClickHouse/issues/12053)、[#12060](https://github.com/ClickHouse/ClickHouse/issues/12060)。[#12060](https://github.com/ClickHouse/ClickHouse/pull/12060) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了函数 `defaultValueOfArgumentType` 在处理 `LowCardinality` 类型时出现的错误：`Expected single dictionary argument for function`。修复 [#11808](https://github.com/ClickHouse/ClickHouse/issues/11808)。[#12056](https://github.com/ClickHouse/ClickHouse/pull/12056) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了高阶函数在使用 `Tuple(LowCardinality)` 参数时出现的 `Cannot capture column` 错误。修复 [#9766](https://github.com/ClickHouse/ClickHouse/issues/9766)。[#12055](https://github.com/ClickHouse/ClickHouse/pull/12055) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在加载数据库时并行解析表元数据。这修复了表数量较多时服务器启动缓慢的问题。[#12045](https://github.com/ClickHouse/ClickHouse/pull/12045) ([tavplubix](https://github.com/tavplubix)).
* 使 `topK` 聚合函数在处理 Enum 类型时返回 Enum。这修复了 [#3740](https://github.com/ClickHouse/ClickHouse/issues/3740)。[#12043](https://github.com/ClickHouse/ClickHouse/pull/12043) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了对约束是否为常量表达式的检查。此修复解决了 [#11360](https://github.com/ClickHouse/ClickHouse/issues/11360)。[#12042](https://github.com/ClickHouse/ClickHouse/pull/12042) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了对带有 `Nullable` 列的元组进行比较时的错误。修复了 [#11985](https://github.com/ClickHouse/ClickHouse/issues/11985)。[#12039](https://github.com/ClickHouse/ClickHouse/pull/12039) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 allow\_introspection\_functions=0 时对访问权限的计算问题。[#12031](https://github.com/ClickHouse/ClickHouse/pull/12031) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了调用函数 `if` 时，如果 `FixedString` 类型的参数长度不同，可能导致结果错误和潜在崩溃的问题。此修复解决了 [#11362](https://github.com/ClickHouse/ClickHouse/issues/11362)。[#12021](https://github.com/ClickHouse/ClickHouse/pull/12021) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果查询中唯一返回的表达式是函数 `neighbor`，且该函数使用偏移量 `-9223372036854775808` 调用，则查询可能返回空结果。此修复解决了 [#11367](https://github.com/ClickHouse/ClickHouse/issues/11367)。[#12019](https://github.com/ClickHouse/ClickHouse/pull/12019) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在 allow\_ddl=0 时访问权限计算错误的问题。 [#12015](https://github.com/ClickHouse/ClickHouse/pull/12015) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复了 generateRandom 中可能导致崩溃的数组大小潜在溢出问题。修复了 [#11371](https://github.com/ClickHouse/ClickHouse/issues/11371)。[#12013](https://github.com/ClickHouse/ClickHouse/pull/12013) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了潜在的浮点异常。此修复已关闭 [#11378](https://github.com/ClickHouse/ClickHouse/issues/11378)。[#12005](https://github.com/ClickHouse/ClickHouse/pull/12005) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 server 启动时日志消息中的错误设置项名称。[#11997](https://github.com/ClickHouse/ClickHouse/pull/11997) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `Values` 格式中 `Query parameter was not set` 的问题。修复 [#11918](https://github.com/ClickHouse/ClickHouse/issues/11918)。[#11936](https://github.com/ClickHouse/ClickHouse/pull/11936) ([tavplubix](https://github.com/tavplubix))。
* 在查询 (参数化查询) 中保留用于替换的别名。这修复了 [#11914](https://github.com/ClickHouse/ClickHouse/issues/11914)。[#11916](https://github.com/ClickHouse/ClickHouse/pull/11916) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了将存储策略从默认策略更改后未发生 moves 的问题。 [#11893](https://github.com/ClickHouse/ClickHouse/pull/11893) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 修复了解析 `DateTime64` 时可能出现的浮点异常。此修复解决了 [#11374](https://github.com/ClickHouse/ClickHouse/issues/11374)。[#11875](https://github.com/ClickHouse/ClickHouse/pull/11875) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了通过 HTTP 接口进行内存统计的问题 (在 `wait_end_of_query=1` 时，这一问题的影响可能很大) 。[#11840](https://github.com/ClickHouse/ClickHouse/pull/11840) ([Azat Khuzhin](https://github.com/azat)) 。
* 在检查是否相等之前，先解析存储在 zookeeper 中的元数据。[#11739](https://github.com/ClickHouse/ClickHouse/pull/11739) ([Azat Khuzhin](https://github.com/azat)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 对于带字面量的 IN 运算符，此前不会使用索引；这是大约在 v19.3 中引入的性能回退问题。此修复解决了 [#10574](https://github.com/ClickHouse/ClickHouse/issues/10574)。[#12062](https://github.com/ClickHouse/ClickHouse/pull/12062) ([nvartolomei](https://github.com/nvartolomei)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 在 Dockerfile 中，首次执行 `apt-get update` 之前安装 `ca-certificates`。[#12095](https://github.com/ClickHouse/ClickHouse/pull/12095) ([Ivan Blinkov](https://github.com/blinkov)) 。

<div id="clickhouse-release-v204653-stable-2020-06-25">
  ### 发布版本 v20.4.6.53-稳定版本 2020-06-25
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在 prewhere 条件中使用 `Nullable` 列导致的罕见崩溃。此修复是 [#11608](https://github.com/ClickHouse/ClickHouse/issues/11608) 的延续。[#11869](https://github.com/ClickHouse/ClickHouse/pull/11869) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 不允许在高阶函数中使用 arrayJoin，否则会导致协议同步异常。此修复关闭了 [#3933](https://github.com/ClickHouse/ClickHouse/issues/3933)。 [#11846](https://github.com/ClickHouse/ClickHouse/pull/11846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 FixedString 与常量 String 比较时结果错误的问题。此修复对应 [#11393](https://github.com/ClickHouse/ClickHouse/issues/11393)。该缺陷出现在 20.4 版本中。[#11828](https://github.com/ClickHouse/ClickHouse/pull/11828) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了条件中包含 NULL 时 `if()` 返回错误结果的问题。[#11807](https://github.com/ClickHouse/ClickHouse/pull/11807) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复查询使用线程过多的问题。[#11788](https://github.com/ClickHouse/ClickHouse/pull/11788) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `SELECT *, xyz.*` 这类查询的异常行为：这类查询原本会执行成功，但按预期应当报错。[#11753](https://github.com/ClickHouse/ClickHouse/pull/11753) ([hexiaoting](https://github.com/hexiaoting)).
* 现在，在修改元数据时，副本拉取操作会被取消。[#11744](https://github.com/ClickHouse/ClickHouse/pull/11744) ([alesapin](https://github.com/alesapin)) 。
* 修复了 Values 输入格式中复杂字面量类型推导错误导致的 LOGICAL\_ERROR。[#11732](https://github.com/ClickHouse/ClickHouse/pull/11732) ([tavplubix](https://github.com/tavplubix)).
* 修复 `ORDER BY ... WITH FILL` 在常量列上的问题。[#11697](https://github.com/ClickHouse/ClickHouse/pull/11697) ([Anton Popov](https://github.com/CurtizJ)) 。
* 与 XDBC bridge 通信时传递正确的超时时间。最近在检查 bridge 存活状态和接收元信息时，超时时间未得到正确处理。[#11690](https://github.com/ClickHouse/ClickHouse/pull/11690) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了将 `LIMIT n WITH TIES` 与包含别名的 `ORDER BY` 语句一起使用时的问题。[#11689](https://github.com/ClickHouse/ClickHouse/pull/11689) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了一个会导致 `system.mutations` 状态异常的错误。该错误可能会显示整个变更已完成，但服务器的复制队列中仍有 `MUTATE_PART` 任务，并继续尝试执行这些任务。此修复解决了 [#11611](https://github.com/ClickHouse/ClickHouse/issues/11611)。[#11681](https://github.com/ClickHouse/ClickHouse/pull/11681) ([alesapin](https://github.com/alesapin)).
* 新增了对带不区分大小写标志的正则表达式的支持。此项修复解决了 [#11101](https://github.com/ClickHouse/ClickHouse/issues/11101) 和 [#11506](https://github.com/ClickHouse/ClickHouse/issues/11506)。[#11649](https://github.com/ClickHouse/ClickHouse/pull/11649) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果设置了行级安全性，则移除简单的 `count` 查询优化。在之前的版本中，用户获得的是表中的记录总数，而不是过滤后的数量。此修复解决了 [#11352](https://github.com/ClickHouse/ClickHouse/issues/11352)。[#11644](https://github.com/ClickHouse/ClickHouse/pull/11644) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 String 类型的布隆过滤器 (数据跳过索引) 问题。[#11638](https://github.com/ClickHouse/ClickHouse/pull/11638) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 prewhere 条件中使用 `Nullable` 列时导致的罕见崩溃。 (可能与 [#11572](https://github.com/ClickHouse/ClickHouse/issues/11572) 在某种程度上有关) 。[#11608](https://github.com/ClickHouse/ClickHouse/pull/11608) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从 `Buffer` 表读取且使用采样的查询中出现的 `Block structure mismatch` 错误。[#11602](https://github.com/ClickHouse/ClickHouse/pull/11602) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `clickhouse-client` 在 exception.code() % 256 = 0 时退出码错误的问题。[#11601](https://github.com/ClickHouse/ClickHouse/pull/11601) ([filimonov](https://github.com/filimonov)) 。
* 修复了 server 启动时日志消息 "Mark cache size was lowered" 中的一个小错误。此修复关闭了 [#11399](https://github.com/ClickHouse/ClickHouse/issues/11399)。[#11589](https://github.com/ClickHouse/ClickHouse/pull/11589) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在使用 `PREWHERE column in (subquery)` 和 `ARRAY JOIN` 的查询中出现的错误 `Size of offsets does not match size of column`。[#11580](https://github.com/ClickHouse/ClickHouse/pull/11580) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `SHOW CREATE TABLE` 中罕见的段错误。见 [#11490](https://github.com/ClickHouse/ClickHouse/issues/11490)。[#11579](https://github.com/ClickHouse/ClickHouse/pull/11579) ([tavplubix](https://github.com/tavplubix)).
* HTTP 会话中的所有查询此前都使用相同的 query\_id。此问题已修复。[#11578](https://github.com/ClickHouse/ClickHouse/pull/11578) ([tavplubix](https://github.com/tavplubix)).
* 现在，clickhouse-server Docker 容器在检查服务器存活状态时将优先使用 IPv6。[#11550](https://github.com/ClickHouse/ClickHouse/pull/11550) ([Ivan Starkov](https://github.com/istarkov)) 。
* 修复了 `<node>` 的 shard\_num/replica\_num (此前会导致 use\_compact\_format\_in\_distributed\_parts\_names 失效) 。[#11528](https://github.com/ClickHouse/ClickHouse/pull/11528) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个竞态条件，该问题可能会在删除表时导致异常。这个问题有点棘手，但完全没有风险。如果你想了解具体原因，直接在 Telegram 上联系我即可。[#11523](https://github.com/ClickHouse/ClickHouse/pull/11523) ([alesapin](https://github.com/alesapin)).
* 修复了在使用 -State 函数进行聚合时，如果在中途抛出异常就会发生的内存泄漏问题。此修复对应 [#8995](https://github.com/ClickHouse/ClickHouse/issues/8995)。[#11496](https://github.com/ClickHouse/ClickHouse/pull/11496) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果数据跳过索引依赖于会在后台合并期间发生变化的列 (SummingMergeTree、AggregatingMergeTree 以及 TTL GROUP BY 都会出现这种情况) ，其计算结果就会不正确。该问题已通过将索引计算移至合并之后修复，从而确保索引基于合并后的数据进行计算。[#11162](https://github.com/ClickHouse/ClickHouse/pull/11162) ([Azat Khuzhin](https://github.com/azat)).
* 移除旧版 libunwind 补丁。[https://github.com/ClickHouse-Extras/libunwind/commit/500aa227911bd185a94bfc071d68f4d3b03cb3b1#r39048012](https://github.com/ClickHouse-Extras/libunwind/commit/500aa227911bd185a94bfc071d68f4d3b03cb3b1#r39048012) 这样一来，就可以在 `clang` 构建中禁用 `-fno-omit-frame-pointer`，平均可将性能提升至少 1%。[#10761](https://github.com/ClickHouse/ClickHouse/pull/10761) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在使用 'FINAL' 修饰符和 'ORDER BY' 优化时，主键被包装在函数中导致的问题。[#10715](https://github.com/ClickHouse/ClickHouse/pull/10715) ([Anton Popov](https://github.com/CurtizJ)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了单元测试中的若干处无关紧要的错误。[#11262](https://github.com/ClickHouse/ClickHouse/pull/11262) ([alesapin](https://github.com/alesapin)).
* 修复了 MergeTreeIndexFullText 中的 MSan (误报) 问题。该问题最早出现在 [#9968](https://github.com/ClickHouse/ClickHouse/issues/9968)。[#10801](https://github.com/ClickHouse/ClickHouse/pull/10801) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="clickhouse-release-v204536-stable-2020-06-10">
  ### ClickHouse 发布版本 v20.4.5.36-稳定版本 2020-06-10
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了错误 `Data compressed with different methods`：如果启用了 `min_bytes_to_use_direct_io`，且 PREWHERE 生效，并使用 SAMPLE 或较多线程时，可能会发生此错误。此修复解决了 [#11539](https://github.com/ClickHouse/ClickHouse/issues/11539)。[#11540](https://github.com/ClickHouse/ClickHouse/pull/11540) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复编解码器返回的压缩后大小。[#11448](https://github.com/ClickHouse/ClickHouse/pull/11448) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了当某列的压缩编解码器包含非字面量参数时服务器崩溃的问题。修复了 [#11365](https://github.com/ClickHouse/ClickHouse/issues/11365)。[#11431](https://github.com/ClickHouse/ClickHouse/pull/11431) ([alesapin](https://github.com/alesapin)) 。
* 修复了 pointInPolygon 在点为 NaN 时的问题。修复 [#11375](https://github.com/ClickHouse/ClickHouse/issues/11375)。[#11421](https://github.com/ClickHouse/ClickHouse/pull/11421) ([Alexey Ilyukhov](https://github.com/livace))。
* 修复了在 MergeTree 关闭过程中，如果表未成功创建，可能读取未初始化内存的问题。[#11420](https://github.com/ClickHouse/ClickHouse/pull/11420) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `geohashesInBox` 在参数超出纬度/经度取值范围时的问题。[#11403](https://github.com/ClickHouse/ClickHouse/pull/11403) ([Vasily Nemkov](https://github.com/Enmk)).
* 修复带有外部排序和 limit 的查询可能出现的 `Pipeline stuck` 错误。修复 [#11359](https://github.com/ClickHouse/ClickHouse/issues/11359)。[#11366](https://github.com/ClickHouse/ClickHouse/pull/11366) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在 ReplicatedMergeTree 中发送 parts 时，去除冗余锁。[#11354](https://github.com/ClickHouse/ClickHouse/pull/11354) ([alesapin](https://github.com/alesapin)) 。
* 修复了 clickhouse-client 在多行模式下对 `\G` (垂直输出) 的支持问题。此项修复关闭了 [#9933](https://github.com/ClickHouse/ClickHouse/issues/9933)。[#11350](https://github.com/ClickHouse/ClickHouse/pull/11350) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复使用 `Lazy` 数据库时可能发生的段错误。[#11348](https://github.com/ClickHouse/ClickHouse/pull/11348) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `quantilesExactWeightedArray` 中的崩溃问题。[#11337](https://github.com/ClickHouse/ClickHouse/pull/11337) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 现在，在 `ALTER` 查询更改元数据之前，会先停止合并操作。[#11335](https://github.com/ClickHouse/ClickHouse/pull/11335) ([alesapin](https://github.com/alesapin)).
* 恢复在设置 `parallel_view_processing = 1` 时对 `MATERIALIZED VIEW` 的并行写入。修复 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#11330](https://github.com/ClickHouse/ClickHouse/pull/11330) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `visitParamExtractRaw` 在提取出的 JSON 包含带有未配对 \{ 或 \[ 的字符串时的问题。[#11318](https://github.com/ClickHouse/ClickHouse/pull/11318) ([Ewout](https://github.com/devwout)).
* 修复 ThreadPool 中一种极为罕见的竞态条件。[#11314](https://github.com/ClickHouse/ClickHouse/pull/11314) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 clickhouse-copier 中一个轻微的数据竞争问题。该问题由集成测试发现。[#11313](https://github.com/ClickHouse/ClickHouse/pull/11313) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了转换过程中可能出现的未初始化内存问题。示例：`SELECT toIntervalSecond(now64())`。[#11311](https://github.com/ClickHouse/ClickHouse/pull/11311) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了以下问题：如果表的主键中包含 Array 列，且查询使用 `empty` 或 `notEmpty` 函数按该列进行过滤，索引分析将无法正常工作。此修复对应 [#11286](https://github.com/ClickHouse/ClickHouse/issues/11286)。[#11303](https://github.com/ClickHouse/ClickHouse/pull/11303) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了一个问题：当查询因 `max_network_bandwidth`、`max_execution_speed` 或 `priority` 设置而被限流时，查询速度估算可能不准确，且 `min_execution_speed` 的限制可能失效或行为异常。将 `timeout_before_checking_execution_speed` 的默认值改为非零，因为否则 `min_execution_speed` 和 `max_execution_speed` 设置不会生效。此修复解决了 [#11297](https://github.com/ClickHouse/ClickHouse/issues/11297)。此修复解决了 [#5732](https://github.com/ClickHouse/ClickHouse/issues/5732)。此修复解决了 [#6228](https://github.com/ClickHouse/ClickHouse/issues/6228)。可用性改进：避免在 `clickhouse-client` 中将异常消息与进度条拼接在一起。[#11296](https://github.com/ClickHouse/ClickHouse/pull/11296) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了使用错误参数调用 SET DEFAULT ROLE 时导致的崩溃问题。此修复对应 [#10586](https://github.com/ClickHouse/ClickHouse/issues/10586)。[#11278](https://github.com/ClickHouse/ClickHouse/pull/11278) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了读取 Protobuf 格式的错误数据时发生崩溃的问题。此修复解决了 [#5957](https://github.com/ClickHouse/ClickHouse/issues/5957) 和 [#11203](https://github.com/ClickHouse/ClickHouse/issues/11203)。[#11258](https://github.com/ClickHouse/ClickHouse/pull/11258) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了一个 bug：在仅存在已过期键的情况下，cache 字典可能会返回默认值而不是正常值。该问题仅影响字符串字段。[#11233](https://github.com/ClickHouse/ClickHouse/pull/11233) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了从 `VIEW` 读取时，若内部查询包含常量会出现的错误 `Block structure mismatch in QueryPipeline`。修复 [#11181](https://github.com/ClickHouse/ClickHouse/issues/11181)。[#11205](https://github.com/ClickHouse/ClickHouse/pull/11205) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复可能发生的异常 `Invalid status for associated output`。[#11200](https://github.com/ClickHouse/ClickHouse/pull/11200) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了高阶函数在捕获参数为 `Array(Array(LowCardinality))` 时可能出现的错误 `Cannot capture column`。[#11185](https://github.com/ClickHouse/ClickHouse/pull/11185) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 S3 globbing 在键数量超过 1000 且使用某些后端存储时可能失败的问题。[#11179](https://github.com/ClickHouse/ClickHouse/pull/11179) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 如果数据跳过索引依赖的列会在后台合并期间被修改 (对于 SummingMergeTree、AggregatingMergeTree 以及 TTL GROUP BY) ，则其计算结果会不正确。此问题已通过将索引计算移至合并之后修复，这样索引就会基于合并后的数据进行计算。[#11162](https://github.com/ClickHouse/ClickHouse/pull/11162) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 Kafka 中与基于限制的重新调度相关的性能问题；此前这些限制始终会被应用。[#11149](https://github.com/ClickHouse/ClickHouse/pull/11149) ([filimonov](https://github.com/filimonov)).
* 修复了对 engine=Kafka 的表执行 DROP 时 (或在服务器重启期间) 有时会卡住的问题。[#11145](https://github.com/ClickHouse/ClickHouse/pull/11145) ([filimonov](https://github.com/filimonov)) 。
* 修复了简单查询中过度预留线程的问题 (这是用于减少线程数量的一项优化，但在管道相关变更后部分失效) 。[#11114](https://github.com/ClickHouse/ClickHouse/pull/11114) ([Azat Khuzhin](https://github.com/azat)).
* 修复了带有 `HAVING` 子句的分布式查询在谓词优化 (`enable_optimize_predicate_expression=1`) 中的问题 (即需要在发起 server 上进行过滤时) ：通过保留表达式顺序即可修复；同时还强制聚合器使用列名而非索引。修复：[#10613](https://github.com/ClickHouse/ClickHouse/issues/10613)、[#11413](https://github.com/ClickHouse/ClickHouse/issues/11413)。[#10621](https://github.com/ClickHouse/ClickHouse/pull/10621) ([Azat Khuzhin](https://github.com/azat)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了多个不稳定的集成测试。[#11355](https://github.com/ClickHouse/ClickHouse/pull/11355) ([alesapin](https://github.com/alesapin)) 。

<div id="clickhouse-release-v204418-stable-2020-05-26">
  ### ClickHouse 发布版本 v20.4.4.18-稳定版本 2020-05-26
</div>

与 v20.4.3.16-stable 相比，无变更。

<div id="clickhouse-release-v204316-stable-2020-05-23">
  ### 发布版本 v20.4.3.16-稳定版本 2020-05-23
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 如果未完成任何最终化操作，则移除变更最终化任务的日志记录。[#11109](https://github.com/ClickHouse/ClickHouse/pull/11109) ([alesapin](https://github.com/alesapin)).
* 修复了 registerDiskS3 中的内存泄漏问题。 [#11074](https://github.com/ClickHouse/ClickHouse/pull/11074) ([Pavel Kovalenko](https://github.com/Jokser)).
* 修复了 Kafka 引擎表在终止过程中可能发生的数据遗漏问题。[#11048](https://github.com/ClickHouse/ClickHouse/pull/11048) ([filimonov](https://github.com/filimonov)) 。
* 修复了 `parseDateTime64BestEffort` 参数解析中的问题。[#11038](https://github.com/ClickHouse/ClickHouse/pull/11038) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复了 `MergeTree` 中一个极其罕见的潜在 use-after-free 错误，该错误可能在表未成功创建时发生。[#10986](https://github.com/ClickHouse/ClickHouse/pull/10986), [#10970](https://github.com/ClickHouse/ClickHouse/pull/10970) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 Atomic 数据库中元数据 (重命名时的相对路径) 和数据 (符号链接的相对路径) 的处理问题。[#10980](https://github.com/ClickHouse/ClickHouse/pull/10980) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 `Atomic` 数据库引擎下并发执行 `ALTER` 和 `DROP DATABASE` 查询时导致服务器崩溃的问题。[#10968](https://github.com/ClickHouse/ClickHouse/pull/10968) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `getRawData()` 方法中原始数据大小错误的问题。[#10964](https://github.com/ClickHouse/ClickHouse/pull/10964) ([Igr](https://github.com/ObjatieGroba)).
* 修复了 20.1 及更早版本之间双层聚合的兼容性问题。当发起节点和远程节点使用不同版本的 ClickHouse，且 GROUP BY 结果集较大、聚合仅基于单个 String 字段时，就会出现这种兼容性问题。这会导致结果中同一个键对应多行未合并的数据。[#10952](https://github.com/ClickHouse/ClickHouse/pull/10952) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `DistributedBlockOutputStream` 会发送部分写入文件的问题。[#10940](https://github.com/ClickHouse/ClickHouse/pull/10940) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `SELECT count(notNullIn(NULL, []))` 导致的崩溃问题。[#10920](https://github.com/ClickHouse/ClickHouse/pull/10920) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在对 `Kafka` 表引擎执行 `DROP` 时有时会发生的挂起问题 (也可能发生在服务器重启期间) 。[#10910](https://github.com/ClickHouse/ClickHouse/pull/10910) ([filimonov](https://github.com/filimonov)).
* 修复了无法执行多个 `ALTER RENAME` 操作的问题，例如 `a TO b, c TO a`。[#10895](https://github.com/ClickHouse/ClickHouse/pull/10895) ([alesapin](https://github.com/alesapin)).
* 修复了一个可能发生的竞争条件：当多个线程同时获取同一列的聚合函数状态结果时，可能会触发该问题。只有在从使用 `Memory` 引擎、且存储了 `quantile*` 函数 `AggregateFunction` 状态的表中读取数据时，调用 `finalizeAggregation` 函数才会出现这种情况。[#10890](https://github.com/ClickHouse/ClickHouse/pull/10890) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了分布式表中元组的向后兼容问题。[#10889](https://github.com/ClickHouse/ClickHouse/pull/10889) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `StringHashTable` 中在此类键不存在时会触发的 `SIGSEGV` 问题。[#10870](https://github.com/ClickHouse/ClickHouse/pull/10870) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了从使用 `Atomic` 引擎的数据库中删除 `LiveView` 表后，`WATCH` 卡住的问题。[#10859](https://github.com/ClickHouse/ClickHouse/pull/10859) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `ReplicatedMergeTree` 中的一个 bug：在某个副本变为非活动状态后，某些针对 `OPTIMIZE` 查询的 `ALTER` 可能会因等待该副本而一直挂起。[#10849](https://github.com/ClickHouse/ClickHouse/pull/10849) ([tavplubix](https://github.com/tavplubix)).
* 如果参与 `CONSTRAINT` 表达式的列被重命名，相关约束现在也会随之更新。修复了 [#10844](https://github.com/ClickHouse/ClickHouse/issues/10844)。[#10847](https://github.com/ClickHouse/ClickHouse/pull/10847) ([alesapin](https://github.com/alesapin))。
* 已修复 cache 字典中可能读取未初始化内存的问题。[#10834](https://github.com/ClickHouse/ClickHouse/pull/10834) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `Block::sortColumns()` 后列顺序的问题。[#10826](https://github.com/ClickHouse/ClickHouse/pull/10826) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在未要求为标识符加引号时 `ODBC` bridge 出现的问题。修复 [#7984](https://github.com/ClickHouse/ClickHouse/issues/7984)。[#10821](https://github.com/ClickHouse/ClickHouse/pull/10821) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `DateLUT` 中 `UBSan` 和 `MSan` 的报告问题。[#10798](https://github.com/ClickHouse/ClickHouse/pull/10798) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了主键条件中的错误类型转换。修复 [#6287](https://github.com/ClickHouse/ClickHouse/issues/6287)。[#10791](https://github.com/ClickHouse/ClickHouse/pull/10791) ([Andrew Onyshchuk](https://github.com/oandrew)).
* 修复了 `parallel_view_processing` 的行为。现在，即使发生异常，向 `MATERIALIZED VIEW` 的所有插入操作也都应无一例外地完成。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#10757](https://github.com/ClickHouse/ClickHouse/pull/10757) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `-OrNull` 和 `-OrDefault` 组合器与 `-State` 结合使用时的问题。 [#10741](https://github.com/ClickHouse/ClickHouse/pull/10741) ([hcz](https://github.com/hczhcz)).
* 修复了函数 `h3EdgeAngle` 中可能的缓冲区溢出问题。[#10711](https://github.com/ClickHouse/ClickHouse/pull/10711) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个 bug：当表中有大量 parts 时，会导致并发 ALTER 操作被锁定。[#10659](https://github.com/ClickHouse/ClickHouse/pull/10659) ([alesapin](https://github.com/alesapin)).
* 修复了在表启动前 server 已关闭时 `StorageBuffer` 中 `nullptr` 被解引用的问题。[#10641](https://github.com/ClickHouse/ClickHouse/pull/10641) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `LowCardinality` 场景下 `optimize_skip_unused_shards` 的问题。[#10611](https://github.com/ClickHouse/ClickHouse/pull/10611) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了同步变更的条件变量处理问题。在某些情况下，发往该条件变量的信号可能会丢失。 [#10588](https://github.com/ClickHouse/ClickHouse/pull/10588) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 修复了在 `loadStoredObject()` 完成前调用 `createDictionary()` 可能引发的崩溃问题。[#10587](https://github.com/ClickHouse/ClickHouse/pull/10587) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在 `SELECT` `ALIAS` 列时默认表达式类型与列类型不一致的问题。[#10563](https://github.com/ClickHouse/ClickHouse/pull/10563) ([Azat Khuzhin](https://github.com/azat)).
* 支持了 DateTime64 与 String 值之间的比较。[#10560](https://github.com/ClickHouse/ClickHouse/pull/10560) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 默认禁用 `GROUP BY` 的 sharding\_key 优化 (由于对 sharding\_key 的分析存在一些棘手情况，例如 sharding key 中包含 `if`，因此引入的 `optimize_distributed_group_by_sharding_key` 默认保持关闭) ，并修复了其在 `WITH ROLLUP/CUBE/TOTALS` 中的问题。[#10516](https://github.com/ClickHouse/ClickHouse/pull/10516) ([Azat Khuzhin](https://github.com/azat)) 。
* 已修复 [#10263](https://github.com/ClickHouse/ClickHouse/issues/10263)。[#10486](https://github.com/ClickHouse/ClickHouse/pull/10486) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了关于 `max_rows_to_sort` 设置的测试。[#10268](https://github.com/ClickHouse/ClickHouse/pull/10268) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为创建 bloom filter 索引增加了向后兼容性。[#10551](https://github.com/ClickHouse/ClickHouse/issues/10551)。[#10569](https://github.com/ClickHouse/ClickHouse/pull/10569) ([Winter Zhang](https://github.com/zhang2014)) 。

<div id="clickhouse-release-v20429-2020-05-12">
  ### 发布版本 v20.4.2.9，2020-05-12
</div>

<div id="backward-incompatible-change-8">
  #### 不兼容的变更
</div>

* 系统表 (例如 system.query\_log、system.trace\_log、system.metric\_log) 对大小小于 10 MiB 的 parts 使用 compact 数据分区片段格式。compact 数据分区片段格式自 20.3 版本起受支持。如果你要降级到低于 20.3 的版本，应手动删除 `/var/lib/clickhouse/data/system/` 中系统日志的表数据。
* 当字符串比较涉及 FixedString 且参与比较的参数大小不同时，会按较短字符串填充到与较长字符串相同的长度后再进行比较。这样做是为了兼容 SQL，前提是将 FixedString 数据类型视为对应 SQL CHAR。这关闭了 [#9272](https://github.com/ClickHouse/ClickHouse/issues/9272)。[#10363](https://github.com/ClickHouse/ClickHouse/pull/10363) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 使 SHOW CREATE TABLE 以多行形式显示。现在它更易读，也更接近 MySQL。[#10049](https://github.com/ClickHouse/ClickHouse/pull/10049) ([Azat Khuzhin](https://github.com/azat))
* 新增了设置 `validate_polygons`，用于 `pointInPolygon` 函数，且默认启用。[#9857](https://github.com/ClickHouse/ClickHouse/pull/9857) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="new-feature-7">
  #### 新特性
</div>

* 增加了对 ClickHouse 与 Zookeeper 之间安全连接的支持 [#10184](https://github.com/ClickHouse/ClickHouse/pull/10184) ([Konstantin Lebedev](https://github.com/xzkostyan))
* 支持自定义 HTTP 处理器。有关说明，请参见 [#5436](https://github.com/ClickHouse/ClickHouse/issues/5436)。[#7572](https://github.com/ClickHouse/ClickHouse/pull/7572) ([Winter Zhang](https://github.com/zhang2014))
* 新增 MessagePack 输入/输出格式。[#9889](https://github.com/ClickHouse/ClickHouse/pull/9889) ([Kruglov Pavel](https://github.com/Avogar))
* 新增 Regexp 输入格式。[#9196](https://github.com/ClickHouse/ClickHouse/pull/9196) ([Kruglov Pavel](https://github.com/Avogar))
* 新增了输出格式 `Markdown`，用于在 Markdown 文档中嵌入表。[#10317](https://github.com/ClickHouse/ClickHouse/pull/10317) ([Kruglov Pavel](https://github.com/Avogar))
* 新增了对字典中自定义设置部分的支持。同时修复了问题 [#2829](https://github.com/ClickHouse/ClickHouse/issues/2829)。[#10137](https://github.com/ClickHouse/ClickHouse/pull/10137) ([Artem Streltsov](https://github.com/kekekekule))
* 在 DDL 查询中的 `CREATE DICTIONARY` 中新增了对自定义设置的支持 [#10465](https://github.com/ClickHouse/ClickHouse/pull/10465) ([Artem Streltsov](https://github.com/kekekekule))
* 添加了一个简单的服务器级内存分析器，当服务器内存使用量高于下一个分配阈值时，会收集分配上下文。[#10444](https://github.com/ClickHouse/ClickHouse/pull/10444) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 添加设置 `always_fetch_merged_part`，限制副本自行合并 parts，并始终优先从其他副本拉取。 [#10379](https://github.com/ClickHouse/ClickHouse/pull/10379) ([alesapin](https://github.com/alesapin))
* 新增 `JSONExtractKeysAndValuesRaw` 函数，用于从 JSON 对象中提取原始数据 [#10378](https://github.com/ClickHouse/ClickHouse/pull/10378) ([hcz](https://github.com/hczhcz))
* 将操作系统的内存使用情况添加到 `system.asynchronous_metrics`。[#10361](https://github.com/ClickHouse/ClickHouse/pull/10361) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为函数 `least` 和 `greatest` 添加了泛型变体。现在，它们支持任意数量、任意类型的参数。这修复了 [#4767](https://github.com/ClickHouse/ClickHouse/issues/4767) [#10318](https://github.com/ClickHouse/ClickHouse/pull/10318) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在，ClickHouse 在自身侧控制字典源的超时。为 cache 字典配置新增了两个设置：`strict_max_lifetime_seconds`，默认值为 `max_lifetime`；以及 `query_wait_timeout_milliseconds`，默认值为一分钟。第一个设置与 `allow_read_expired_keys` 设置配合使用时也很有用 (可禁止读取过期时间过长的键) 。[#10337](https://github.com/ClickHouse/ClickHouse/pull/10337) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 新增 log\_queries\_min\_type，用于过滤哪些条目会被写入 query\_log [#10053](https://github.com/ClickHouse/ClickHouse/pull/10053) ([Azat Khuzhin](https://github.com/azat))
* 新增函数 `isConstant`。该函数用于检查其参数是否为常量表达式，并返回 1 或 0。此函数主要用于开发、调试和演示。[#10198](https://github.com/ClickHouse/ClickHouse/pull/10198) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增 `joinGetOrNull`，在键缺失时返回 NULL，而不是默认值。[#10094](https://github.com/ClickHouse/ClickHouse/pull/10094) ([Amos Bird](https://github.com/amosbird))
* 如果设置了 `transform_null_in` 选项，则在 `IN` 运算符中会将 `NULL` 视为等于 `NULL`。[#10085](https://github.com/ClickHouse/ClickHouse/pull/10085) ([achimbab](https://github.com/achimbab))
* 为 MergeTree 表引擎家族新增 `ALTER TABLE ... RENAME COLUMN` 支持。[#9948](https://github.com/ClickHouse/ClickHouse/pull/9948) ([alesapin](https://github.com/alesapin))
* 支持并行执行分布式 INSERT SELECT。[#9759](https://github.com/ClickHouse/ClickHouse/pull/9759) ([vxider](https://github.com/Vxider))
* 新增了跨 Distributed 表查询 Distributed 表的能力 (无需 `distributed_group_by_no_merge`) ... [#9923](https://github.com/ClickHouse/ClickHouse/pull/9923) ([Azat Khuzhin](https://github.com/azat))
* 新增函数 `arrayReduceInRanges`，用于对给定范围内的数组元素进行聚合。[#9598](https://github.com/ClickHouse/ClickHouse/pull/9598) ([hcz](https://github.com/hczhcz))
* 为 Prometheus 导出器添加字典状态。[#9622](https://github.com/ClickHouse/ClickHouse/pull/9622) ([Guillaume Tassery](https://github.com/YiuRULE))
* 新增函数 `arrayAUC` [#8698](https://github.com/ClickHouse/ClickHouse/pull/8698) ([taiyang-li](https://github.com/taiyang-li))
* 支持 `DROP VIEW` 语句，以提升对 TPC-H 的兼容性。[#9831](https://github.com/ClickHouse/ClickHouse/pull/9831) ([Amos Bird](https://github.com/amosbird))
* 为 windowFunnel() 新增 'strict\_order' 选项 [#9773](https://github.com/ClickHouse/ClickHouse/pull/9773) ([achimbab](https://github.com/achimbab))
* 支持 `DATE` 和 `TIMESTAMP` SQL 运算符，例如 `SELECT date '2001-01-01'` [#9691](https://github.com/ClickHouse/ClickHouse/pull/9691) ([Artem Zuikov](https://github.com/4ertus2))

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增实验性数据库引擎 Atomic。支持非阻塞的 `DROP` 和 `RENAME TABLE` 查询，以及原子的 `EXCHANGE TABLES t1 AND t2` 查询 [#7512](https://github.com/ClickHouse/ClickHouse/pull/7512) ([tavplubix](https://github.com/tavplubix))
* 初步支持基于 S3 的 ReplicatedMergeTree (目前实现方式还不够理想)  [#10126](https://github.com/ClickHouse/ClickHouse/pull/10126) ([Pavel Kovalenko](https://github.com/Jokser))

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了当 `MATERIALIZED VIEW` 的内部查询包含依赖表时，标量结果不正确的问题 [#10603](https://github.com/ClickHouse/ClickHouse/pull/10603) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了一个 bug：当 `readonly=2` 且 `cancel_http_readonly_queries_on_client_close=1` 时，如果客户端关闭连接，HTTP 请求会卡住。[#10684](https://github.com/ClickHouse/ClickHouse/pull/10684) ([tavplubix](https://github.com/tavplubix))
* 修复了在服务器启动时抛出异常时，StorageBuffer 中出现的段错误。修复 [#10550](https://github.com/ClickHouse/ClickHouse/issues/10550) [#10609](https://github.com/ClickHouse/ClickHouse/pull/10609) ([tavplubix](https://github.com/tavplubix))
* 查询`SYSTEM DROP DNS CACHE`现在还会清除用于检查用户是否允许从某些 IP 地址连接的缓存 [#10608](https://github.com/ClickHouse/ClickHouse/pull/10608) ([tavplubix](https://github.com/tavplubix))
* 修复在同一查询中对同一个集合使用多个 `IN` 运算符的问题。修复 [#10539](https://github.com/ClickHouse/ClickHouse/issues/10539) [#10686](https://github.com/ClickHouse/ClickHouse/pull/10686) ([Anton Popov](https://github.com/CurtizJ))
* 修复了 `generateRandom` 在嵌套类型下崩溃的问题。修复了 [#10583](https://github.com/ClickHouse/ClickHouse/issues/10583)。[#10734](https://github.com/ClickHouse/ClickHouse/pull/10734) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 `SummingMergeTree` 中 `LowCardinality(FixedString)` 键列在合并后可能出现的数据损坏问题。修复 [#10489](https://github.com/ClickHouse/ClickHouse/issues/10489)。[#10721](https://github.com/ClickHouse/ClickHouse/pull/10721) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 aggregation\_memory\_efficient\_merge\_threads 设置的逻辑问题。[#10667](https://github.com/ClickHouse/ClickHouse/pull/10667) ([palasonic1](https://github.com/palasonic1))
* 修复总计消失的问题。如果查询包含 `JOIN`，或包含带外部 `WHERE` 条件的子查询，则总计可能会被过滤掉。修复了 [#10674](https://github.com/ClickHouse/ClickHouse/issues/10674) [#10698](https://github.com/ClickHouse/ClickHouse/pull/10698) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复启用 `distributed_aggregation_memory_efficient` 时远程查询无法并行执行的问题。修复 [#10655](https://github.com/ClickHouse/ClickHouse/issues/10655) [#10664](https://github.com/ClickHouse/ClickHouse/pull/10664) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了带有 `LIMIT` 的查询可能返回错误行数的问题。修复 [#10566](https://github.com/ClickHouse/ClickHouse/issues/10566)、[#10709](https://github.com/ClickHouse/ClickHouse/issues/10709) [#10660](https://github.com/ClickHouse/ClickHouse/pull/10660) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复索引损坏问题；在某些情况下，将 compact parts 合并为另一个 compact part 后，可能会出现该问题。[#10531](https://github.com/ClickHouse/ClickHouse/pull/10531) ([Anton Popov](https://github.com/CurtizJ))
* 修复了一种情况：变更已处理完所有 parts，但仍卡在 `is_done=0`。 [#10526](https://github.com/ClickHouse/ClickHouse/pull/10526) ([alesapin](https://github.com/alesapin))
* 修复了带有相对 UTC 小数偏移时区在 Unix 纪元起始处的溢出问题。修复 [#9335](https://github.com/ClickHouse/ClickHouse/issues/9335)。[#10513](https://github.com/ClickHouse/ClickHouse/pull/10513) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 改进了输入格式的诊断信息。修复了 [#10204](https://github.com/ClickHouse/ClickHouse/issues/10204) [#10418](https://github.com/ClickHouse/ClickHouse/pull/10418) ([tavplubix](https://github.com/tavplubix))
* 修复 `simpleLinearRegression()` 在处理大整数时出现的数值溢出问题 [#10474](https://github.com/ClickHouse/ClickHouse/pull/10474) ([hcz](https://github.com/hczhcz))
* 修复 Distributed 关闭时释放后使用的问题，避免等待发送完所有批次 [#10491](https://github.com/ClickHouse/ClickHouse/pull/10491) ([Azat Khuzhin](https://github.com/azat))
* 向 clickhouse-server Docker 镜像中添加 CA 证书 [#10476](https://github.com/ClickHouse/ClickHouse/pull/10476) ([filimonov](https://github.com/filimonov))
* 修复了一个罕见的死循环问题，该问题可能在使用 `addressToLine` 函数或 AggregateFunctionState 列时发生。[#10466](https://github.com/ClickHouse/ClickHouse/pull/10466) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 处理分布式查询期间的 ZooKeeper "无节点"错误 [#10050](https://github.com/ClickHouse/ClickHouse/pull/10050) ([Daniel Chen](https://github.com/Phantomape))
* 修复了在修改列默认值后，服务器无法附加表的问题。 [#10441](https://github.com/ClickHouse/ClickHouse/pull/10441) ([alesapin](https://github.com/alesapin))
* 对于 ALIAS 列，默认表达式的类型会被隐式转换为列类型 [#10563](https://github.com/ClickHouse/ClickHouse/pull/10563) ([Azat Khuzhin](https://github.com/azat))
* 如果 `ATTACH DATABASE` 失败，不要删除元数据目录 [#10442](https://github.com/ClickHouse/ClickHouse/pull/10442) ([Winter Zhang](https://github.com/zhang2014))
* 避免依赖系统 tzdata。修复了在 CentOS 8 上加载 `Africa/Casablanca` 时区时的问题。修复 [#10211](https://github.com/ClickHouse/ClickHouse/issues/10211) [#10425](https://github.com/ClickHouse/ClickHouse/pull/10425) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了数据以 quorum 方式插入后又被删除 (DROP PARTITION、生存时间 (TTL) 等) 时的一些问题。此前，这会导致 INSERT 操作卡住，或在 SELECT 时出现误报异常。修复了 [#9946](https://github.com/ClickHouse/ClickHouse/issues/9946) [#10188](https://github.com/ClickHouse/ClickHouse/pull/10188) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 创建 BloomFilter 索引时检查参数数量和类型 [#9623](https://github.com/ClickHouse/ClickHouse/issues/9623) [#10431](https://github.com/ClickHouse/ClickHouse/pull/10431) ([Winter Zhang](https://github.com/zhang2014))
* 优先使用 `fallback_to_stale_replicas`，不要使用 `skip_unavailable_shards`；否则，如果同时指定了这两个设置，且没有最新的副本，查询将会失败 (补丁由 @alex-zaitsev 提供) [#10422](https://github.com/ClickHouse/ClickHouse/pull/10422) ([Azat Khuzhin](https://github.com/azat))
* 修复了包含 ARRAY JOIN、ORDER BY 和 LIMIT 的查询可能返回不完整结果的问题。修复 [#10226](https://github.com/ClickHouse/ClickHouse/issues/10226)。[#10427](https://github.com/ClickHouse/ClickHouse/pull/10427) ([Vadim Plakhtinskiy](https://github.com/VadimPlh))
* 在 DETACH/ATTACH 之后，将数据库名称添加到字典名称后。修复了 system.dictionaries 表和 `SYSTEM RELOAD` 查询 [#10415](https://github.com/ClickHouse/ClickHouse/pull/10415) ([Azat Khuzhin](https://github.com/azat))
* 修复处理器管道中 extremes 可能返回错误结果的问题。 [#10131](https://github.com/ClickHouse/ClickHouse/pull/10131) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了在启用设置 `distributed_group_by_no_merge` 时可能发生的段错误 (该设置由 [#10131](https://github.com/ClickHouse/ClickHouse/issues/10131) 在 20.3.7.46 中引入) 。[#10399](https://github.com/ClickHouse/ClickHouse/pull/10399) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复 `Array(Tuple(...))` 数据类型被错误扁平化的问题。修复了 [#10259](https://github.com/ClickHouse/ClickHouse/issues/10259) [#10390](https://github.com/ClickHouse/ClickHouse/pull/10390) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 JOIN 内部常量列名可能与 JOIN 外部常量名称冲突的问题 [#9950](https://github.com/ClickHouse/ClickHouse/pull/9950) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 修复 Block::sortColumns() 后列顺序错误 [#10826](https://github.com/ClickHouse/ClickHouse/pull/10826) ([Azat Khuzhin](https://github.com/azat))
* 修复远程查询中 `ConcatProcessor` 可能出现的 `Pipeline stuck` 错误。[#10381](https://github.com/ClickHouse/ClickHouse/pull/10381) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 不再为聚合计算预留磁盘空间。修复了 [#9241](https://github.com/ClickHouse/ClickHouse/issues/9241) [#10375](https://github.com/ClickHouse/ClickHouse/pull/10375) ([Azat Khuzhin](https://github.com/azat))
* 修复了日期时间函数在 UTC 偏移量会在正负之间切换的时区 (例如 Pacific/Kiritimati) 中的错误行为。修复 [#7202](https://github.com/ClickHouse/ClickHouse/issues/7202) [#10369](https://github.com/ClickHouse/ClickHouse/pull/10369) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 避免 `dictIsIn` 函数中陷入无限循环。修复 #515 [#10365](https://github.com/ClickHouse/ClickHouse/pull/10365) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 默认禁用 GROUP BY sharding\_key 优化，并修复 WITH ROLLUP/CUBE/TOTALS 下的相关问题 [#10516](https://github.com/ClickHouse/ClickHouse/pull/10516) ([Azat Khuzhin](https://github.com/azat))
* 检查 parts 时会检查错误代码；如果错误类似于 "内存不足"，则不要将该 part 标记为损坏。修复了 [#6269](https://github.com/ClickHouse/ClickHouse/issues/6269) [#10364](https://github.com/ClickHouse/ClickHouse/pull/10364) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在系统表中显示未加载字典的信息。[#10234](https://github.com/ClickHouse/ClickHouse/pull/10234) ([Vitaly Baranov](https://github.com/vitlibar))
* 如果在表启动前 server 已关闭，修复 StorageBuffer 中的 nullptr 解引用问题。[#10641](https://github.com/ClickHouse/ClickHouse/pull/10641) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 `ReplicatedMergeTree` 中 `DROP` 与 `OPTIMIZE` 的竞态问题。如果存在并发的 `OPTIMIZE` 查询，`DROP` 可能会在 ZooKeeper 的副本路径中遗留一些垃圾数据。[#10312](https://github.com/ClickHouse/ClickHouse/pull/10312) ([tavplubix](https://github.com/tavplubix))
* 修复在查询中混用逗号和具名 JOIN 时出现的 'Logical error: CROSS JOIN has expressions' 错误。修复 [#9910](https://github.com/ClickHouse/ClickHouse/issues/9910) [#10311](https://github.com/ClickHouse/ClickHouse/pull/10311) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了使用 `max_bytes_before_external_group_by` 的查询相关问题。[#10302](https://github.com/ClickHouse/ClickHouse/pull/10302) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在某些情况下限制 parser 最大递归深度的问题。此修复解决了 [#10283](https://github.com/ClickHouse/ClickHouse/issues/10283)。该修复可能会带来轻微的不兼容性：通过 clickhouse-client 发起的超长且层级很深的查询可能无法执行，你需要相应调整设置 `max_query_size` 和 `max_parser_depth`。[#10295](https://github.com/ClickHouse/ClickHouse/pull/10295) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 允许使用 `count(*)` 配合多个 JOIN。修复了 [#9853](https://github.com/ClickHouse/ClickHouse/issues/9853) [#10291](https://github.com/ClickHouse/ClickHouse/pull/10291) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在 `max_rows_to_group_by` 和 `group_by_overflow_mode = 'break'` 时出现的 `Pipeline stuck` 错误。[#10279](https://github.com/ClickHouse/ClickHouse/pull/10279) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了使用 DDL 查询创建 `range_hashed` 字典时出现的“Cannot add column”错误。修复 [#10093](https://github.com/ClickHouse/ClickHouse/issues/10093)。[#10235](https://github.com/ClickHouse/ClickHouse/pull/10235) ([alesapin](https://github.com/alesapin))
* 修复在极少数情况下可能出现的异常 `Cannot drain connections: cancel first`。[#10239](https://github.com/ClickHouse/ClickHouse/pull/10239) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了一个 bug：当用户尝试对使用 ENGINE = Replicated\* 的表执行 ALTER UPDATE/DELETE 时，ClickHouse 会抛出 "Unknown function lambda." 错误。现在，对非确定性函数的检查已能正确处理 lambda 表达式。[#10237](https://github.com/ClickHouse/ClickHouse/pull/10237) ([Alexander Kazakov](https://github.com/Akazz))
* 修复了 StorageSystemTables 中一个较为少见的段错误：在使用 Lazy 引擎的 database 上运行 SELECT ... FROM system.tables 时会触发该问题。 [#10209](https://github.com/ClickHouse/ClickHouse/pull/10209) ([Alexander Kazakov](https://github.com/Akazz))
* 修复了一个可能导致查询无限执行的问题：从 `system.numbers` 或 `system.zeros` 这类无限源读取时，查询本应在 LIMIT 处停止。[#10206](https://github.com/ClickHouse/ClickHouse/pull/10206) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 Date 类型的 "generateRandom" 函数。此修复解决了 [#9973](https://github.com/ClickHouse/ClickHouse/issues/9973)。修复了一个边界情况：当将年份为 2106 的日期插入采用旧式分区方式的 MergeTree 表时，分区名称却被标记为 1970 年。[#10218](https://github.com/ClickHouse/ClickHouse/pull/10218) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 如果视图的表定义与 SELECT 查询不一致，则进行类型转换。这修复了 [#10180](https://github.com/ClickHouse/ClickHouse/issues/10180) 和 [#10022](https://github.com/ClickHouse/ClickHouse/issues/10022) [#10217](https://github.com/ClickHouse/ClickHouse/pull/10217) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 `parseDateTimeBestEffort` 在处理 RFC-2822 格式字符串时，若星期几为星期二或星期四会出错的问题。此修复对应 [#10082](https://github.com/ClickHouse/ClickHouse/issues/10082) [#10214](https://github.com/ClickHouse/ClickHouse/pull/10214) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 JOIN 内部常量列名可能与 JOIN 外部常量名称发生冲突的问题。[#10207](https://github.com/ClickHouse/ClickHouse/pull/10207) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了在某些情况下存在 arrayJoin 函数时 move-to-prewhere 优化失效的问题。此修复对应于 [#10092](https://github.com/ClickHouse/ClickHouse/issues/10092) [#10195](https://github.com/ClickHouse/ClickHouse/pull/10195) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复原生 mysql-connector-java (JDBC) 在 SCRAMBLE 中出现分隔符的问题 [#10140](https://github.com/ClickHouse/ClickHouse/pull/10140) ([BohuTANG](https://github.com/BohuTANG))
* 修复了在未指定数据库时，访问检查会使用当前数据库的问题。[#10192](https://github.com/ClickHouse/ClickHouse/pull/10192) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复了对包含 compact parts 的表执行 ALTER 时的问题。[#10130](https://github.com/ClickHouse/ClickHouse/pull/10130) ([Anton Popov](https://github.com/CurtizJ))
* 新增了通过 `allow_nondeterministic_mutations` 设置放宽在变更中使用非确定性函数限制的功能。[#10186](https://github.com/ClickHouse/ClickHouse/pull/10186) ([filimonov](https://github.com/filimonov))
* 修复对字典误调用 `DROP TABLE` 的问题 [#10165](https://github.com/ClickHouse/ClickHouse/pull/10165) ([Azat Khuzhin](https://github.com/azat))
* 向 Distributed 表执行 `INSERT` 时，如果结构不匹配，则会转换块 [#10135](https://github.com/ClickHouse/ClickHouse/pull/10135) ([Azat Khuzhin](https://github.com/azat))
* 当插入的块因分区键而被拆分为多个 parts 时，行数被错误地记录为所有 parts 的总和。[#10138](https://github.com/ClickHouse/ClickHouse/pull/10138) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 MySQL Database Engine 增加了一些参数检查，并支持标识符类型的参数 [#10077](https://github.com/ClickHouse/ClickHouse/pull/10077) ([Winter Zhang](https://github.com/zhang2014))
* 修复创建新副本时对 `index_granularity_bytes` 的错误校验。修复 [#10098](https://github.com/ClickHouse/ClickHouse/issues/10098)。[#10121](https://github.com/ClickHouse/ClickHouse/pull/10121) ([alesapin](https://github.com/alesapin))
* 修复了表包含跳过索引时 `CHECK TABLE` 查询中的缺陷。[#10068](https://github.com/ClickHouse/ClickHouse/pull/10068) ([alesapin](https://github.com/alesapin))
* 修复嵌套表仅有一个分片时的 Distributed-over-Distributed 问题 [#9997](https://github.com/ClickHouse/ClickHouse/pull/9997) ([Azat Khuzhin](https://github.com/azat))
* 修复包含 `JOIN` 和 `UNION ALL` 的查询可能出现的行丢失问题。修复了 [#9826](https://github.com/ClickHouse/ClickHouse/issues/9826)、[#10113](https://github.com/ClickHouse/ClickHouse/issues/10113)。... [#10099](https://github.com/ClickHouse/ClickHouse/pull/10099) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了将本地 ClickHouse server 用作源时字典中的一个错误。如果字典和源中的类型不兼容，可能会导致内存损坏。[#10071](https://github.com/ClickHouse/ClickHouse/pull/10071) ([alesapin](https://github.com/alesapin))
* 修复了从旧版 ClickHouse 升级时复制表的启动问题：在该旧版本中，`/table/replicas/replica_name/metadata` 节点不存在。修复了 [#10037](https://github.com/ClickHouse/ClickHouse/issues/10037)。[#10095](https://github.com/ClickHouse/ClickHouse/pull/10095) ([alesapin](https://github.com/alesapin))
* 修复错误 `Cannot clone block with columns because block has 0 columns ... While executing GroupingAggregatedTransform`。该问题发生在启用 `distributed_aggregation_memory_efficient` 设置时：分布式查询从不同分片读取了混合单级聚合和两级聚合的聚合数据。 [#10063](https://github.com/ClickHouse/ClickHouse/pull/10063) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了启动时包含 materialized view 的数据库 attach 失败时发生的死锁问题 [#10054](https://github.com/ClickHouse/ClickHouse/pull/10054) ([Azat Khuzhin](https://github.com/azat))
* 修复了在对末尾包含零字节的字符串键执行 GROUP BY 时可能发生的段错误 ([#8636](https://github.com/ClickHouse/ClickHouse/issues/8636), [#8925](https://github.com/ClickHouse/ClickHouse/issues/8925)) 。... [#10025](https://github.com/ClickHouse/ClickHouse/pull/10025) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 修复了在别名可能覆盖带限定符的列名时，分布式查询结果错误的问题。修复 [#9672](https://github.com/ClickHouse/ClickHouse/issues/9672) [#9714](https://github.com/ClickHouse/ClickHouse/issues/9714) [#9972](https://github.com/ClickHouse/ClickHouse/pull/9972) ([Artem Zuikov](https://github.com/4ertus2))
* 修复 `SYSTEM RESTART REPLICAS` 中可能的死锁 [#9955](https://github.com/ClickHouse/ClickHouse/pull/9955) ([tavplubix](https://github.com/tavplubix))
* 修正了远程查询执行使用的线程数 (自 20.3 起出现的性能回退) 。该问题发生在对 `Distributed` 表的查询同时在本地和远程分片上执行时。修复了 [#9965](https://github.com/ClickHouse/ClickHouse/issues/9965) [#9971](https://github.com/ClickHouse/ClickHouse/pull/9971) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 `ATTACH PART` 中的 `DeleteOnDestroy` 逻辑问题，该问题可能导致已附加的分片被自动删除，并新增了几个测试 [#9410](https://github.com/ClickHouse/ClickHouse/pull/9410) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了服务器启动时 `ON CLUSTER` DDL 查询卡死的问题。[#9927](https://github.com/ClickHouse/ClickHouse/pull/9927) ([Gagan Arneja](https://github.com/garneja))
* 修复了一个问题：在针对某些数据库的查询处理过程中的某个阶段，未能获取到所需的表。修复 [#9699](https://github.com/ClickHouse/ClickHouse/issues/9699)。[#9949](https://github.com/ClickHouse/ClickHouse/pull/9949) ([achulkov2](https://github.com/achulkov2))
* 修复了 `JOIN` 与 `TOTALS` 同时出现时的'块中找不到列'错误。修复 [#9839](https://github.com/ClickHouse/ClickHouse/issues/9839) [#9939](https://github.com/ClickHouse/ClickHouse/pull/9939) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在 `CREATE USER` 命令中设置多个主机时的解析问题 [#9924](https://github.com/ClickHouse/ClickHouse/pull/9924) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复 Join 表引擎中的 `TRUNCATE` 问题 ([#9917](https://github.com/ClickHouse/ClickHouse/issues/9917)) 。[#9920](https://github.com/ClickHouse/ClickHouse/pull/9920) ([Amos Bird](https://github.com/amosbird))
* 修复了 `ReplicatedMergeTree` 中 `drop` 与 optimize 操作之间的竞态条件。[#9901](https://github.com/ClickHouse/ClickHouse/pull/9901) ([alesapin](https://github.com/alesapin))
* 修复了在设置 `optimize_skip_unused_shards` 时 Distributed 表上 `DISTINCT` 的问题。[#9808](https://github.com/ClickHouse/ClickHouse/pull/9808) ([Azat Khuzhin](https://github.com/azat))
* 修复 ALTER 操作中的“scalar does not exist”错误 ([#9878](https://github.com/ClickHouse/ClickHouse/issues/9878)) 。... [#9904](https://github.com/ClickHouse/ClickHouse/pull/9904) ([Amos Bird](https://github.com/amosbird))
* 修复 `distributed_product_mode=\'local\'` 中限定名称相关的错误。修复 [#4756](https://github.com/ClickHouse/ClickHouse/issues/4756) [#9891](https://github.com/ClickHouse/ClickHouse/pull/9891) ([Artem Zuikov](https://github.com/4ertus2))
* 对于 INSERT 查询，各分片现在会将来自发起节点的设置值限制在自身约束范围内，而不是抛出异常。此修复使得可以将 INSERT 查询发送到具有不同约束的分片。此更改进一步完善了对 [#9447](https://github.com/ClickHouse/ClickHouse/issues/9447) 的修复。[#9852](https://github.com/ClickHouse/ClickHouse/pull/9852) ([Vitaly Baranov](https://github.com/vitlibar))
* 在向 Kafka broker 提交 offset 时增加重试次数，因为如果在 `offsets.commit.timeout.ms` 期间，`__consumer_offsets` topic 没有足够的副本可用，broker 可能会拒绝此次提交 [#9884](https://github.com/ClickHouse/ClickHouse/pull/9884) ([filimonov](https://github.com/filimonov))
* 修复在 `WHERE` 中使用底层表虚拟列时 Distributed engine 的行为问题 [#9847](https://github.com/ClickHouse/ClickHouse/pull/9847) ([Azat Khuzhin](https://github.com/azat))
* 修复了某些情况下未正确使用函数参数 timezone 的问题。[#9574](https://github.com/ClickHouse/ClickHouse/pull/9574) ([Vasily Nemkov](https://github.com/Enmk))
* 修复了在分布式表上查询同时包含 PREWHERE 和 WHERE，且 `SET distributed_product_mode = 'local'` 时出现的“Different expressions with the same alias”错误。[#9871](https://github.com/ClickHouse/ClickHouse/pull/9871) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了复合主键表在执行变更时内存占用过高的问题。此修复解决了 [#9850](https://github.com/ClickHouse/ClickHouse/issues/9850)。[#9860](https://github.com/ClickHouse/ClickHouse/pull/9860) ([alesapin](https://github.com/alesapin))
* 修复根据设置 `allow_introspection_functions` 计算内部信息函数授权时的问题。[#9840](https://github.com/ClickHouse/ClickHouse/pull/9840) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复启用和未启用处理器时的 max\_distributed\_connections 问题 [#9673](https://github.com/ClickHouse/ClickHouse/pull/9673) ([Azat Khuzhin](https://github.com/azat))
* 修复客户端可能出现的异常 `Got 0 in totals chunk, expected 1`。该问题会在包含 `JOIN` 的查询中出现：如果右侧连接表中没有行，就会触发该异常。示例：`select * from system.one t1 join system.one t2 on t1.dummy = t2.dummy limit 0 FORMAT TabSeparated;`。修复了 [#9777](https://github.com/ClickHouse/ClickHouse/issues/9777)。... [#9823](https://github.com/ClickHouse/ClickHouse/pull/9823) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了以下错误：在子查询中使用位于表列表之外 (即在 WHERE 中) 的 COMMA JOIN 时，会出现 'COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query' 错误。修复 [#9782](https://github.com/ClickHouse/ClickHouse/issues/9782) [#9830](https://github.com/ClickHouse/ClickHouse/pull/9830) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在设置 `optimize_skip_unused_shards` 且用于 key 的 expression 无法转换为其 field 类型时，server 崩溃的问题 [#9804](https://github.com/ClickHouse/ClickHouse/pull/9804) ([Azat Khuzhin](https://github.com/azat))
* 修复 `splitByString` 对空字符串的处理问题。[#9767](https://github.com/ClickHouse/ClickHouse/pull/9767) ([hcz](https://github.com/hczhcz))
* 修复 compact parts 上失效的 `ALTER TABLE DELETE COLUMN` 查询。[#9779](https://github.com/ClickHouse/ClickHouse/pull/9779) ([alesapin](https://github.com/alesapin))
* 修复了通过 HTTP 执行查询且使用处理器管道时缺少 `rows_before_limit_at_least` 的问题。修复 [#9730](https://github.com/ClickHouse/ClickHouse/issues/9730) [#9757](https://github.com/ClickHouse/ClickHouse/pull/9757) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复 `ALTER` 查询 (变更) 中过高的内存占用。此修复解决了 [#9533](https://github.com/ClickHouse/ClickHouse/issues/9533) 和 [#9670](https://github.com/ClickHouse/ClickHouse/issues/9670)。[#9754](https://github.com/ClickHouse/ClickHouse/pull/9754) ([alesapin](https://github.com/alesapin))
* 修复可能持续出现的“Cannot schedule a task”错误。[#9154](https://github.com/ClickHouse/ClickHouse/pull/9154) ([Azat Khuzhin](https://github.com/azat))
* 修复了外部字典 DDL 中反引号引用的问题。修复了 [#9619](https://github.com/ClickHouse/ClickHouse/issues/9619)。[#9734](https://github.com/ClickHouse/ClickHouse/pull/9734) ([alesapin](https://github.com/alesapin))
* 修复了 `text_log` 中的数据竞争问题。这并不对应任何实际的 bug。[#9726](https://github.com/ClickHouse/ClickHouse/pull/9726) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了复制中的一个错误：如果用户在上一版本中执行过变更，复制将无法正常工作。此修复解决了 [#9645](https://github.com/ClickHouse/ClickHouse/issues/9645)。[#9652](https://github.com/ClickHouse/ClickHouse/pull/9652) ([alesapin](https://github.com/alesapin))
* 修复了 `sumKahan` 和 `sumWithOverflow` 的内部函数名错误的问题。此前在远程查询中使用这些函数时会引发异常。[#9636](https://github.com/ClickHouse/ClickHouse/pull/9636) ([Azat Khuzhin](https://github.com/azat))
* 新增设置 `use_compact_format_in_distributed_parts_names`，支持将写入 `Distributed` 表的 `INSERT` 查询文件采用更紧凑的格式。这修复了 [#9647](https://github.com/ClickHouse/ClickHouse/issues/9647)。[#9653](https://github.com/ClickHouse/ClickHouse/pull/9653) ([alesapin](https://github.com/alesapin))
* 修复了 JOIN 连接键中使用 LowCardinality 时 RIGHT 和 FULL JOIN 的问题。[#9610](https://github.com/ClickHouse/ClickHouse/pull/9610) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了 `MergeTreeRangeReader` 中可能发生的异常：`Size of filter does not match size of column` 和 `Invalid number of rows in Chunk`。这些异常在某些情况下执行 `PREWHERE` 时可能会出现。[#9612](https://github.com/ClickHouse/ClickHouse/pull/9612) ([Anton Popov](https://github.com/CurtizJ))
* 允许对使用内部复制的分布式表执行 `ALTER ON CLUSTER`。修复了 [#3268](https://github.com/ClickHouse/ClickHouse/issues/3268) [#9617](https://github.com/ClickHouse/ClickHouse/pull/9617) ([shinoi2](https://github.com/shinoi2))
* 修复了一个问题：如果编写简单的算术表达式，如 `time + 1` (而不是 `time + INTERVAL 1 SECOND` 这样的表达式) ，则不会保留时区。此修复对应于 [#5743](https://github.com/ClickHouse/ClickHouse/issues/5743) [#9323](https://github.com/ClickHouse/ClickHouse/pull/9323) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="improvement">
  #### 改进
</div>

* 在将 DateTime 与字符串字面量比较时使用时区。此修复解决了 [#5206](https://github.com/ClickHouse/ClickHouse/issues/5206)。[#10515](https://github.com/ClickHouse/ClickHouse/pull/10515) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 如果无法从文本输入格式中解析出 Decimal 值，则会输出详细的诊断信息。[#10205](https://github.com/ClickHouse/ClickHouse/pull/10205) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 distributed/buffer 调度池新增任务/内存指标 [#10449](https://github.com/ClickHouse/ClickHouse/pull/10449) ([Azat Khuzhin](https://github.com/azat))
* 在 clickhouse-local 和 HTTP 接口中，SELECT DISTINCT 查询的结果一准备好就会立即显示。此项修复解决了 [#8951](https://github.com/ClickHouse/ClickHouse/issues/8951) [#9559](https://github.com/ClickHouse/ClickHouse/pull/9559) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 允许在 `clickhouse-copier` 中使用 `SAMPLE OFFSET` 查询来代替 `cityHash64(PRIMARY KEY) % N == n` 进行拆分。要使用此功能，请将 `--experimental-use-sample-offset 1` 作为命令行参数传入。[#10414](https://github.com/ClickHouse/ClickHouse/pull/10414) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 如果第一列的值中不会包含 BOM，则允许在 TSV 中解析 BOM。这修复了 [#10301](https://github.com/ClickHouse/ClickHouse/issues/10301) [#10424](https://github.com/ClickHouse/ClickHouse/pull/10424) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增对 Avro 嵌套字段插入的支持 [#10354](https://github.com/ClickHouse/ClickHouse/pull/10354) ([Andrew Onyshchuk](https://github.com/oandrew))
* 当指定的类型相同时，允许在非修改数据模式下更改列。[#10382](https://github.com/ClickHouse/ClickHouse/pull/10382) ([Vladimir Chebotarev](https://github.com/excitoon))
* 按分片键执行 `GROUP BY` 时自动启用 `distributed_group_by_no_merge` (如果设置了 `optimize_skip_unused_shards`) [#10341](https://github.com/ClickHouse/ClickHouse/pull/10341) ([Azat Khuzhin](https://github.com/azat))
* 优化带有 GROUP BY sharding\_key 的 Distributed 表上的 LIMIT/LIMIT BY/ORDER BY 查询 [#10373](https://github.com/ClickHouse/ClickHouse/pull/10373) ([Azat Khuzhin](https://github.com/azat))
* 新增设置 `max_server_memory_usage`，用于限制服务器的总内存使用量。指标 `MemoryTracking` 现在计算时不再存在偏差。设置 `max_memory_usage_for_all_queries` 现已废弃，不再生效。此更改修复了 [#10293](https://github.com/ClickHouse/ClickHouse/issues/10293)。[#10362](https://github.com/ClickHouse/ClickHouse/pull/10362) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增配置选项 `system_tables_lazy_load`。如果将其设为 false，则包含日志的系统表会在服务器启动时加载。[Alexander Burmak](https://github.com/Alex-Burmak)、[Svyatoslav Tkhon Il Pak](https://github.com/DeifyTheGod)、[#9642](https://github.com/ClickHouse/ClickHouse/pull/9642) [#10359](https://github.com/ClickHouse/ClickHouse/pull/10359) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 分布式发送改用后台线程池 (background\_schedule\_pool\_size) [#10263](https://github.com/ClickHouse/ClickHouse/pull/10263) ([Azat Khuzhin](https://github.com/azat))
* 使用后台线程池执行后台缓冲区刷新。[#10315](https://github.com/ClickHouse/ClickHouse/pull/10315) ([Azat Khuzhin](https://github.com/azat))
* 支持一种删除未完整写入的 parts 的特殊情况处理。此项修复了 [#9940](https://github.com/ClickHouse/ClickHouse/issues/9940)。[#10221](https://github.com/ClickHouse/ClickHouse/pull/10221) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 使用 isInjective() 代替手动维护此类函数列表，以优化 GROUP BY。[#10342](https://github.com/ClickHouse/ClickHouse/pull/10342) ([Azat Khuzhin](https://github.com/azat))
* 如果客户端在建立连接后立即发送 RST 数据包，则不要在日志中打印错误信息。这是使用 keepalived 和 VRRP 的 IPVS 负载均衡器的典型行为。此修复参见 [#1851](https://github.com/ClickHouse/ClickHouse/issues/1851) [#10274](https://github.com/ClickHouse/ClickHouse/pull/10274) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 支持将 `+inf` 解析为浮点类型值。此更改关闭了 [#1839](https://github.com/ClickHouse/ClickHouse/issues/1839) [#10272](https://github.com/ClickHouse/ClickHouse/pull/10272) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 已实现支持 Nested 类型的 `generateRandom` 表函数。此项改动修复了 [#9903](https://github.com/ClickHouse/ClickHouse/issues/9903) [#10219](https://github.com/ClickHouse/ClickHouse/pull/10219) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 MySQL 兼容接口中新增 `max_allowed_packed`，以帮助某些客户端通过 MySQL 协议与 ClickHouse 通信。[#10199](https://github.com/ClickHouse/ClickHouse/pull/10199) ([BohuTANG](https://github.com/BohuTANG))
* 允许在 GLOBAL IN 中使用字面量 (即 `SELECT * FROM remote('localhost', system.one) WHERE dummy global in (0)`) [#10196](https://github.com/ClickHouse/ClickHouse/pull/10196) ([Azat Khuzhin](https://github.com/azat))
* 修复了 `clickhouse-client` 交互模式中的若干小问题 [#10194](https://github.com/ClickHouse/ClickHouse/pull/10194) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 避免多余的字典加载 (system.tables、DROP/SHOW CREATE TABLE) [#10164](https://github.com/ClickHouse/ClickHouse/pull/10164) ([Azat Khuzhin](https://github.com/azat))
* 更新 RWLock：为 getLock() 增加 `timeout` 参数，并将实现重构为相位公平机制 [#10073](https://github.com/ClickHouse/ClickHouse/pull/10073) ([Alexander Kazakov](https://github.com/Akazz))
* 增强了与原生 mysql-connector-java (JDBC) 的兼容性 [#10021](https://github.com/ClickHouse/ClickHouse/pull/10021) ([BohuTANG](https://github.com/BohuTANG))
* 函数 `toString` 被视为单调函数，即使在将其用于参数为 String 或 LowCardinality(String) 的恒等情形时，也可用于索引分析。[#10110](https://github.com/ClickHouse/ClickHouse/pull/10110) ([Amos Bird](https://github.com/amosbird))
* 为命令 `{CREATE|DROP} USER/ROLE/ROW POLICY/SETTINGS PROFILE/QUOTA`、`GRANT` 添加对 `ON CLUSTER` 子句的支持。[#9811](https://github.com/ClickHouse/ClickHouse/pull/9811) ([Vitaly Baranov](https://github.com/vitlibar))
* 支持 S3 URI 的虚拟托管风格 [#9998](https://github.com/ClickHouse/ClickHouse/pull/9998) ([Pavel Kovalenko](https://github.com/Jokser))
* 现在，在字典 DDL 查询中，对于不带参数的字典，其 layout 类型可以省略圆括号直接指定。修复了 [#10057](https://github.com/ClickHouse/ClickHouse/issues/10057)。[#10064](https://github.com/ClickHouse/ClickHouse/pull/10064) ([alesapin](https://github.com/alesapin))
* 新增了在文件路径中使用带前导零的数字范围的功能 [#9989](https://github.com/ClickHouse/ClickHouse/pull/9989) ([Olga Khvostikova](https://github.com/stavrolia))
* 优化了 CROSS JOIN 的内存占用。[#10029](https://github.com/ClickHouse/ClickHouse/pull/10029) ([Artem Zuikov](https://github.com/4ertus2))
* 在获取远程表结构且设置了 skip\_unavailable\_shards 时，会尝试连接到集群中的所有分片。[#7278](https://github.com/ClickHouse/ClickHouse/pull/7278) ([nvartolomei](https://github.com/nvartolomei))
* 在 `system.tables` 表中新增 `total_rows`/`total_bytes`。[#9919](https://github.com/ClickHouse/ClickHouse/pull/9919) ([Azat Khuzhin](https://github.com/azat))
* 系统日志表现已默认使用多态 parts。[#9905](https://github.com/ClickHouse/ClickHouse/pull/9905) ([Anton Popov](https://github.com/CurtizJ))
* 在 system.settings/merge\_tree\_settings 中添加 type 列 [#9909](https://github.com/ClickHouse/ClickHouse/pull/9909) ([Azat Khuzhin](https://github.com/azat))
* 在 server 启动时尽可能早地检测可用的 CPU 指令集。 [#9888](https://github.com/ClickHouse/ClickHouse/pull/9888) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 从变更中移除 `ORDER BY` 阶段，因为我们是在单个线程中从单个有序分片读取数据。同时新增检查，以确保变更中的行按排序键排序，且这一顺序不会被破坏。[#9886](https://github.com/ClickHouse/ClickHouse/pull/9886) ([alesapin](https://github.com/alesapin))
* 支持在左操作数为 FixedString 时使用 LIKE 运算符。这有助于更好地支持 TPC-DS 查询。[#9890](https://github.com/ClickHouse/ClickHouse/pull/9890) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增 `force_optimize_skip_unused_shards_no_nested`，用于对嵌套的分布式表禁用 `force_optimize_skip_unused_shards` [#9812](https://github.com/ClickHouse/ClickHouse/pull/9812) ([Azat Khuzhin](https://github.com/azat))
* 现在对于 MergeTree 数据分区片段，列大小只计算一次。[#9827](https://github.com/ClickHouse/ClickHouse/pull/9827) ([alesapin](https://github.com/alesapin))
* 支持对 `optimize_skip_unused_shards` 中的常量表达式求值 (即 `SELECT * FROM foo_dist WHERE key=xxHash32(0)`) [#8846](https://github.com/ClickHouse/ClickHouse/pull/8846) ([Azat Khuzhin](https://github.com/azat))
* 已移除对生存时间 (TTL) 表达式中使用 `Date` 或 `DateTime` 列的检查。[#9967](https://github.com/ClickHouse/ClickHouse/pull/9967) ([Vladimir Chebotarev](https://github.com/excitoon))
* 优化了 DiskS3 硬链接的实现。[#9760](https://github.com/ClickHouse/ClickHouse/pull/9760) ([Pavel Kovalenko](https://github.com/Jokser))
* 如果设置 `set multiple_joins_rewriter_version = 2`，将启用多重 JOIN 改写的第二版，该版本会保留未发生冲突的列名。它支持带 `USING` 的多重 JOIN，并允许在包含子查询的 JOIN 中使用 `select *`。[#9739](https://github.com/ClickHouse/ClickHouse/pull/9739) ([Artem Zuikov](https://github.com/4ertus2))
* 为 StorageMergeTree 实现“非阻塞” alter 操作 [#9606](https://github.com/ClickHouse/ClickHouse/pull/9606) ([alesapin](https://github.com/alesapin))
* 为 DiskS3 增加对 MergeTree 的完整支持 [#9646](https://github.com/ClickHouse/ClickHouse/pull/9646) ([Pavel Kovalenko](https://github.com/Jokser))
* 扩展 `splitByString`，使其支持将空字符串作为分隔符。[#9742](https://github.com/ClickHouse/ClickHouse/pull/9742) ([hcz](https://github.com/hczhcz))
* 向 `system.trace_log` 添加 `timestamp_ns` 列。该列包含 trace 事件的高精度时间戳，可用于构建线程 profile 的时间线 (“火焰图”) 。[#9696](https://github.com/ClickHouse/ClickHouse/pull/9696) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 启用 `send_logs_level` 设置后，可避免日志消息与查询进度混杂在一起。[#9634](https://github.com/ClickHouse/ClickHouse/pull/9634) ([Azat Khuzhin](https://github.com/azat))
* 新增了对 `MATERIALIZE TTL IN PARTITION` 的支持。[#9581](https://github.com/ClickHouse/ClickHouse/pull/9581) ([Vladimir Chebotarev](https://github.com/excitoon))
* 支持 Avro 嵌套字段中的复杂类型 [#10502](https://github.com/ClickHouse/ClickHouse/pull/10502) ([Andrew Onyshchuk](https://github.com/oandrew))

<div id="performance-improvement">
  #### 性能改进
</div>

* 改进了 Partial MergeJoin 中右表的插入逻辑。[#10467](https://github.com/ClickHouse/ClickHouse/pull/10467) ([Artem Zuikov](https://github.com/4ertus2))
* 提升了行式格式的性能 (对于窄表，CSV 提升超过 10%，Avro 提升超过 35%) 。[#10503](https://github.com/ClickHouse/ClickHouse/pull/10503) ([Andrew Onyshchuk](https://github.com/oandrew))
* 提升了左侧为元组、右侧为显式定义集合的 IN 运算符查询性能。[#10385](https://github.com/ClickHouse/ClickHouse/pull/10385) ([Anton Popov](https://github.com/CurtizJ))
* 降低了 HashJoin 中哈希表的内存占用。[#10416](https://github.com/ClickHouse/ClickHouse/pull/10416) ([Artem Zuikov](https://github.com/4ertus2))
* 为 StorageDictionary 提供了专用的 HashJoin。允许将 `dictGet()` 函数重写为 JOIN。该改动本身并不破坏向后兼容性，但可能会在某些安装环境中暴露 [#8400](https://github.com/ClickHouse/ClickHouse/issues/8400) 问题。[#10133](https://github.com/ClickHouse/ClickHouse/pull/10133) ([Artem Zuikov](https://github.com/4ertus2))
* 当 materialized view 的目标表支持时，启用其并行插入。[#10052](https://github.com/ClickHouse/ClickHouse/pull/10052) ([vxider](https://github.com/Vxider))
* 提升了单调函数场景下的索引分析性能。[#9607](https://github.com/ClickHouse/ClickHouse/pull/9607)[#10026](https://github.com/ClickHouse/ClickHouse/pull/10026) ([Anton Popov](https://github.com/CurtizJ))
* 使用 SSE2 或 SSE4.2 SIMD 内在函数来加速布隆过滤器中的标记化。[#9968](https://github.com/ClickHouse/ClickHouse/pull/9968) ([Vasily Nemkov](https://github.com/Enmk))
* 提升了 IN 运算符右侧为显式定义集合的查询性能。修复了 20.3 版本中的性能回退问题。[#9740](https://github.com/ClickHouse/ClickHouse/pull/9740) ([Anton Popov](https://github.com/CurtizJ))
* 现在 clickhouse-copier 会将每个分区拆分成若干部分，并分别复制。[#9075](https://github.com/ClickHouse/ClickHouse/pull/9075) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 增加了更多聚合方法。例如，TPC-H 查询 1 现在会选择 `FixedHashMap<UInt16, AggregateDataPtr>`，性能提升 25% [#9829](https://github.com/ClickHouse/ClickHouse/pull/9829) ([Amos Bird](https://github.com/amosbird))
* 在 pre-limit transform 中为多个流使用单个行计数器。这有助于避免在带有 `limit` 但不带 `order by` 的查询中 (例如 `select f(x) from (select x from t limit 1000000000)`) 合并管道流，并在后续处理中使用多个线程。[#9602](https://github.com/ClickHouse/ClickHouse/pull/9602) ([Nikolai Kochetov](https://github.com/KochetovNicolai))

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 使用 ClickHouse-Extras 提供的 AWS SDK 库分支 [#10527](https://github.com/ClickHouse/ClickHouse/pull/10527) ([Pavel Kovalenko](https://github.com/Jokser))
* 为新的 ALTER RENAME COLUMN 语句添加集成测试。[#10654](https://github.com/ClickHouse/ClickHouse/pull/10654) ([vzakaznikov](https://github.com/vzakaznikov))
* 修复了使用错误参数调用函数 `now64` 时可能发生的有符号整数溢出问题。此修复关联 [#8973](https://github.com/ClickHouse/ClickHouse/issues/8973) [#10511](https://github.com/ClickHouse/ClickHouse/pull/10511) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 fuzzer 和 sanitizer 配置拆分开，以使构建配置兼容 Oss-fuzz。[#10494](https://github.com/ClickHouse/ClickHouse/pull/10494) ([kyprizel](https://github.com/kyprizel))
* 修复了 clang-10 上与 clang-tidy 相关的问题。[#10420](https://github.com/ClickHouse/ClickHouse/pull/10420) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在错误消息中显示绝对路径。否则，KDevelop 将无法定位到正确的文件，反而会打开一个新文件。[#10434](https://github.com/ClickHouse/ClickHouse/pull/10434) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 添加了 `ASAN_OPTIONS` 环境变量，用于排查在启用 Address sanitizer 的 CI 压力测试中出现的错误。[#10440](https://github.com/ClickHouse/ClickHouse/pull/10440) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 为 clang 构建启用 ThinLTO (Experimental) 。[#10435](https://github.com/ClickHouse/ClickHouse/pull/10435) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除可能出现的对 Z3 的意外依赖；如果系统安装了 Z3 求解器，就可能引入这种依赖。[#10426](https://github.com/ClickHouse/ClickHouse/pull/10426) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将集成测试的 Docker 文件移到 `docker/` 目录中。[#10335](https://github.com/ClickHouse/ClickHouse/pull/10335) ([Ilya Yatsishin](https://github.com/qoega))
* 允许在 CI 中使用 `clang-10`。这确保了 [#10238](https://github.com/ClickHouse/ClickHouse/issues/10238) 中的问题已被修复。[#10384](https://github.com/ClickHouse/ClickHouse/pull/10384) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 OpenSSL 更新到上游 master。修复了一个问题：TLS 连接可能会失败，并显示消息 `OpenSSL SSL_read: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error` 和 `SSL Exception: error:2400006E:random number generator::error retrieving entropy`。该问题存在于 20.1 版本中。[#8956](https://github.com/ClickHouse/ClickHouse/pull/8956) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 clang-10 的构建问题。 [#10238](https://github.com/ClickHouse/ClickHouse/issues/10238) [#10370](https://github.com/ClickHouse/ClickHouse/pull/10370) ([Amos Bird](https://github.com/amosbird))
* 为 [materialized view 的并行 INSERT](https://github.com/ClickHouse/ClickHouse/pull/10052) 新增性能测试。[#10345](https://github.com/ClickHouse/ClickHouse/pull/10345) ([vxider](https://github.com/Vxider))
* 修复不稳定测试 `test_settings_constraints_distributed.test_insert_clamps_settings`。[#10346](https://github.com/ClickHouse/ClickHouse/pull/10346) ([Vitaly Baranov](https://github.com/vitlibar))
* 为 CI 中的 ClickHouse 添加测试结果上传工具 [#10330](https://github.com/ClickHouse/ClickHouse/pull/10330) ([Ilya Yatsishin](https://github.com/qoega))
* 将 junit\_to\_html 工具中的测试结果转换为 JSONEachRow 格式 [#10323](https://github.com/ClickHouse/ClickHouse/pull/10323) ([Ilya Yatsishin](https://github.com/qoega))
* 升级 cctz。[#10215](https://github.com/ClickHouse/ClickHouse/pull/10215) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 支持从最原始的 JUnit XML 报告生成 HTML 报告。[#10247](https://github.com/ClickHouse/ClickHouse/pull/10247) ([Ilya Yatsishin](https://github.com/qoega))
* 更新最低编译器版本检查。修复问题 [#10250](https://github.com/ClickHouse/ClickHouse/issues/10250) 的根本原因 [#10256](https://github.com/ClickHouse/ClickHouse/pull/10256) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 初步支持基于 Distributed 的 live view 表 [#10179](https://github.com/ClickHouse/ClickHouse/pull/10179) ([vzakaznikov](https://github.com/vzakaznikov))
* 修复 MergeTreeIndexFullText 中的 MSan (误报) 报告。该问题最早出现在 [#9968](https://github.com/ClickHouse/ClickHouse/issues/9968)。[#10801](https://github.com/ClickHouse/ClickHouse/pull/10801) ([alexey-milovidov](https://github.com/alexey-milovidov))
* clickhouse-docker-util [#10151](https://github.com/ClickHouse/ClickHouse/pull/10151) ([filimonov](https://github.com/filimonov))
* 将 pdqsort 更新到较新版本 [#10171](https://github.com/ClickHouse/ClickHouse/pull/10171) ([Ivan](https://github.com/abyss7))
* 将 libdivide 更新至 v3.0 [#10169](https://github.com/ClickHouse/ClickHouse/pull/10169) ([Ivan](https://github.com/abyss7))
* 增加对启用多态 parts 的检查。[#10086](https://github.com/ClickHouse/ClickHouse/pull/10086) ([Anton Popov](https://github.com/CurtizJ))
* 新增 FreeBSD 的交叉编译构建支持。此更改修复了 [#9465](https://github.com/ClickHouse/ClickHouse/issues/9465) [#9643](https://github.com/ClickHouse/ClickHouse/pull/9643) ([Ivan](https://github.com/abyss7))
* 新增 [#6924](https://github.com/ClickHouse/ClickHouse/issues/6924) 的性能测试 [#6980](https://github.com/ClickHouse/ClickHouse/pull/6980) ([filimonov](https://github.com/filimonov))
* 在 `File` 表引擎中增加对 `/dev/null` 的支持，以便更好地进行性能测试 [#8455](https://github.com/ClickHouse/ClickHouse/pull/8455) ([Amos Bird](https://github.com/amosbird))
* 将 /dbms 中的所有文件夹上移一级 [#9974](https://github.com/ClickHouse/ClickHouse/pull/9974) ([Ivan](https://github.com/abyss7))
* 添加了一项测试，用于检查在单线程下从 MergeTree 读取时是否按顺序进行。作为对 [#9670](https://github.com/ClickHouse/ClickHouse/issues/9670) 的补充 [#9762](https://github.com/ClickHouse/ClickHouse/pull/9762) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 `00964_live_view_watch_events_heartbeat.py` 测试，以避免出现竞态条件。[#9944](https://github.com/ClickHouse/ClickHouse/pull/9944) ([vzakaznikov](https://github.com/vzakaznikov))
* 修复集成测试 `test_settings_constraints` [#9962](https://github.com/ClickHouse/ClickHouse/pull/9962) ([Vitaly Baranov](https://github.com/vitlibar))
* 将每个函数分别放入各自的文件中，第 12 部分。 [#9922](https://github.com/ClickHouse/ClickHouse/pull/9922) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 增加了针对元组数组分析极慢场景的性能测试。[#9872](https://github.com/ClickHouse/ClickHouse/pull/9872) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 zstd 更新至 1.4.4。它在性能和压缩率方面有一些小幅提升。如果你运行的是不同版本的 ClickHouse 副本，可能会看到带有说明的错误消息 `Data after merge is not byte-identical to data on another replicas.`。这些消息是正常的，无需担心。[#10663](https://github.com/ClickHouse/ClickHouse/pull/10663) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 `system.stack_trace` 中的 TSan 报告问题。[#9832](https://github.com/ClickHouse/ClickHouse/pull/9832) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除了对 `clock_getres` 的依赖。[#9833](https://github.com/ClickHouse/ClickHouse/pull/9833) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了使用 clang-tidy 的标识符命名检查。[#9799](https://github.com/ClickHouse/ClickHouse/pull/9799) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 更新 "builder" Docker 镜像。该镜像未用于 CI，但对开发者很有帮助。[#9809](https://github.com/ClickHouse/ClickHouse/pull/9809) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除 CI 中已不再使用的旧 `performance-test` 工具。`clickhouse-performance-test` 很不错，但我们现在改用了一个强得多的工具，它通过复杂的统计公式进行对比测试，从而即使环境发生各种变化，也能得出可靠的结果。[#9796](https://github.com/ClickHouse/ClickHouse/pull/9796) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了大部分 clang-static-analyzer 检查。[#9765](https://github.com/ClickHouse/ClickHouse/pull/9765) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 Poco 更新到 1.9.3，为支持 MongoDB URI 做准备。[#6892](https://github.com/ClickHouse/ClickHouse/pull/6892) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 修复在使用 `-DUSE_STATIC_LIBRARIES=0 -DENABLE_JEMALLOC=0` 时的构建问题 [#9651](https://github.com/ClickHouse/ClickHouse/pull/9651) ([Artem Zuikov](https://github.com/4ertus2))
* 对于变更日志脚本，如果将合并提交 cherry-pick 到发布分支，则从提交说明中获取 PR 名称。[#9708](https://github.com/ClickHouse/ClickHouse/pull/9708) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 回移脚本现已支持 `vX.X-conflicts` 标签。[#9705](https://github.com/ClickHouse/ClickHouse/pull/9705) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复回移脚本中的 `auto-label`。 [#9685](https://github.com/ClickHouse/ClickHouse/pull/9685) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 在 Darwin 交叉构建中使用 libc++，以与原生构建保持一致。[#9665](https://github.com/ClickHouse/ClickHouse/pull/9665) ([Hui Wang](https://github.com/huiwang))
* 修复不稳定的测试 `01017_uniqCombined_memory_usage`。续 [#7236](https://github.com/ClickHouse/ClickHouse/issues/7236)。[#9667](https://github.com/ClickHouse/ClickHouse/pull/9667) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复使用原生 macOS Clang 编译器时的构建问题 [#9649](https://github.com/ClickHouse/ClickHouse/pull/9649) ([Ivan](https://github.com/abyss7))
* 支持在 `pthread_mutex_lock`、`pthread_mutex_unlock` 函数调用前后注入各种故障。 [#9635](https://github.com/ClickHouse/ClickHouse/pull/9635) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 `packager` 脚本中新增对 `clang-tidy` 的支持。[#9625](https://github.com/ClickHouse/ClickHouse/pull/9625) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了对使用独立 msgpack 的支持。[#10168](https://github.com/ClickHouse/ClickHouse/pull/10168) ([Azat Khuzhin](https://github.com/azat))

<div id="clickhouse-release-v203">
  ## ClickHouse 发布版本 v20.3
</div>

<div id="clickhouse-release-v203212-lts-2020-11-02">
  ### ClickHouse 发布版本 v20.3.21.2-lts，2020-11-02
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 `sharding_key` (以及类似场景，例如函数上下文被永久存储时) 中的 dictGet 问题。[#16205](https://github.com/ClickHouse/ClickHouse/pull/16205) ([Azat Khuzhin](https://github.com/azat)).
* 修复了当查询包含 `WHERE`、`PREWHERE` 和 `GLOBAL IN` 时，从 `Distributed` 表查询会错误返回空结果的问题。修复了 [#15792](https://github.com/ClickHouse/ClickHouse/issues/15792)。[#15933](https://github.com/ClickHouse/ClickHouse/pull/15933) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `TSV/CSVWithNames` 格式中表头缺失或多出的错误。此修复解决了 [#12504](https://github.com/ClickHouse/ClickHouse/issues/12504)。[#13343](https://github.com/ClickHouse/ClickHouse/pull/13343) ([Azat Khuzhin](https://github.com/azat)).

<div id="clickhouse-release-v203206-lts-2020-10-09">
  ### 发布版本 v20.3.20.6-lts，2020-10-09
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 在执行 `MOVE` 或 `REPLACE PARTITION` 后，或者在少数情况下执行 `DETACH` 或 `DROP PARTITION` 后，变更可能会因等待某个不存在的数据分片而卡住。现已修复。[#15724](https://github.com/ClickHouse/ClickHouse/pull/15724), [#15537](https://github.com/ClickHouse/ClickHouse/pull/15537) ([tavplubix](https://github.com/tavplubix)).
* 修复了对同一 `MySQL` engine 表包含大量子查询时查询卡住的问题。此前，如果一个查询中针对同一 `MySQL` 表的子查询超过 16 个，查询就会一直卡住。[#15299](https://github.com/ClickHouse/ClickHouse/pull/15299) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了当查询对 Merge 表执行 JOIN 时，GROUP BY 中出现“Unknown identifier”的问题。[#15242](https://github.com/ClickHouse/ClickHouse/pull/15242) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了当子查询包含 finalizeAggregation function 时，谓词下推无法生效的问题。修复了 [#14847](https://github.com/ClickHouse/ClickHouse/issues/14847)。[#14937](https://github.com/ClickHouse/ClickHouse/pull/14937) ([filimonov](https://github.com/filimonov)).
* 并发执行 `ALTER ... REPLACE/MOVE PARTITION ...` 查询可能导致死锁。现已修复。[#13626](https://github.com/ClickHouse/ClickHouse/pull/13626) ([tavplubix](https://github.com/tavplubix)).

<div id="clickhouse-release-v203194-lts-2020-09-18">
  ### 发布版本 v20.3.19.4-lts，2020-09-18
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 `SELECT` 查询中的一个罕见错误：当被查询的列带有依赖于另一列的 `DEFAULT` 表达式，而另一列同样带有 `DEFAULT`、未出现在 `SELECT` 查询中且磁盘上也不存在时，就会触发该错误。部分修复了 [#14531](https://github.com/ClickHouse/ClickHouse/issues/14531)。[#14845](https://github.com/ClickHouse/ClickHouse/pull/14845) ([alesapin](https://github.com/alesapin)) 。
* 修复了一个 bug：当 `ALTER UPDATE` 变更在赋值表达式中使用 Nullable 列和常量值 (如 `UPDATE x = 42`) 时，可能导致列值错误或发生段错误。修复了 [#13634](https://github.com/ClickHouse/ClickHouse/issues/13634)、[#14045](https://github.com/ClickHouse/ClickHouse/issues/14045)。[#14646](https://github.com/ClickHouse/ClickHouse/pull/14646) ([alesapin](https://github.com/alesapin)) 。
* 修复了由于结果列的小数标度错误而导致的 Decimal 乘法结果错误问题。[#14603](https://github.com/ClickHouse/ClickHouse/pull/14603) ([Artem Zuikov](https://github.com/4ertus2)) 。

<div id="improvement">
  #### 改进
</div>

* compact parts 现已支持自定义编解码器。[#12183](https://github.com/ClickHouse/ClickHouse/pull/12183) ([Anton Popov](https://github.com/CurtizJ)).

<div id="clickhouse-release-v2031810-lts-2020-09-08">
  ### ClickHouse 发布版本 v20.3.18.10-lts，2020-09-08
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 如果异常发生在 `PipelineExecutor` 自身内部，则停止查询执行。这可以避免极少数情况下查询挂起的问题。此项为 [#14334](https://github.com/ClickHouse/ClickHouse/issues/14334) 的后续修复。[#14402](https://github.com/ClickHouse/ClickHouse/pull/14402) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了缓存字典有时会返回默认值，而不是源中实际存在的值的问题。[#13624](https://github.com/ClickHouse/ClickHouse/pull/13624) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了当数据库名或表名包含点号时，无法从 users.xml 解析行策略的问题。此修复解决了 [#5779](https://github.com/ClickHouse/ClickHouse/issues/5779) 和 [#12527](https://github.com/ClickHouse/ClickHouse/issues/12527)。[#13199](https://github.com/ClickHouse/ClickHouse/pull/13199) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复了 CAST(Nullable(String), Enum())。[#12745](https://github.com/ClickHouse/ClickHouse/pull/12745) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 `text_log` 中的数据竞争问题。它不会对应任何实际缺陷。[#9726](https://github.com/ClickHouse/ClickHouse/pull/9726) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="improvement">
  #### 改进
</div>

* 修复长查询返回错误信息不正确的问题。对于正确的查询，此前可能会收到 `Max query size exceeded` 之外的语法错误。 [#13928](https://github.com/ClickHouse/ClickHouse/pull/13928) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 在 parseDateTimeBestEffortOrNull/Zero 函数中，当值未被完全解析时，返回 NULL/0。此修复解决了 [#7876](https://github.com/ClickHouse/ClickHouse/issues/7876)。 [#11653](https://github.com/ClickHouse/ClickHouse/pull/11653) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 对使用 LowCardinality 的超短查询做了小幅优化。[#14129](https://github.com/ClickHouse/ClickHouse/pull/14129) ([Anton Popov](https://github.com/CurtizJ)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了迁移到 clang-10 后在 HashTable 中出现的 UBSan 报告 (对 nullptr 加 0) 。[#10638](https://github.com/ClickHouse/ClickHouse/pull/10638) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。

<div id="clickhouse-release-v20317173-lts-2020-08-15">
  ### ClickHouse 发布版本 v20.3.17.173-lts，2020-08-15
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在 JOIN 与 StorageMerge 一起使用并设置 `set enable_optimize_predicate_expression=1` 时发生崩溃的问题。[#13679](https://github.com/ClickHouse/ClickHouse/pull/13679) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了比较包含 `NULL` 元素的元组时返回类型无效的问题。修复 [#12461](https://github.com/ClickHouse/ClickHouse/issues/12461)。[#13420](https://github.com/ClickHouse/ClickHouse/pull/13420) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了包含常量列且 `ORDER BY` 为主键前缀的查询问题。[#13396](https://github.com/ClickHouse/ClickHouse/pull/13396) ([Anton Popov](https://github.com/CurtizJ)).
* 在 roundUpToPowerOfTwoOrZero() 中，对于设置了 MSB 的数字，返回其原始值。[#13234](https://github.com/ClickHouse/ClickHouse/pull/13234) ([Azat Khuzhin](https://github.com/azat)).

<div id="clickhouse-release-v20316165-lts-2020-08-10">
  ### ClickHouse 发布版本 v20.3.16.165-lts 2020-08-10
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了将 Unix 时间戳作为参数传入 `parseDateTimeBestEffort` 函数时出现的错误。该修复解决了 [#13362](https://github.com/ClickHouse/ClickHouse/issues/13362)。[#13441](https://github.com/ClickHouse/ClickHouse/pull/13441) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在带有 `NaN` 值的 Float 类型上调用 `uniqExact`、`topK`、`sumDistinct` 及类似聚合函数时，可能出现的性能较低和结果略有偏差的问题。该问题还会在调试构建中触发断言。此修复解决了 [#12491](https://github.com/ClickHouse/ClickHouse/issues/12491)。[#13254](https://github.com/ClickHouse/ClickHouse/pull/13254) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 if 函数在 cond 为非字面量 NULL 的 Nullable constexpr 时的问题。修复了 [#12463](https://github.com/ClickHouse/ClickHouse/issues/12463)。[#13226](https://github.com/ClickHouse/ClickHouse/pull/13226) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `arrayElement` 函数中的断言错误，该问题发生在数组元素为 Nullable 且数组下标也为 Nullable 时。此修复对应 [#12172](https://github.com/ClickHouse/ClickHouse/issues/12172)。[#13224](https://github.com/ClickHouse/ClickHouse/pull/13224) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了从本地副本执行查询时，对线程数量施加不必要限制的问题。[#12840](https://github.com/ClickHouse/ClickHouse/pull/12840) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在 `WITH TOTALS` 查询中，数据可能出现额外溢出行的问题。[#12747](https://github.com/ClickHouse/ClickHouse/pull/12747) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `IN` 子句中将大型 Tuple 解释为函数时的性能问题。也就是用户出于某些不明原因，写成 `WHERE x IN tuple(1, 2, ...)` 而不是 `WHERE x IN (1, 2, ...)` 的情况。[#12700](https://github.com/ClickHouse/ClickHouse/pull/12700) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 input\_format\_parallel\_parsing 的内存跟踪问题 (方法是将线程关联到组) 。[#12672](https://github.com/ClickHouse/ClickHouse/pull/12672) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 [#12293](https://github.com/ClickHouse/ClickHouse/issues/12293)：在子查询包含 WITH 子句时，允许进行谓词下推。[#12663](https://github.com/ClickHouse/ClickHouse/pull/12663) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了 [#10572](https://github.com/ClickHouse/ClickHouse/issues/10572) 中布隆过滤器索引在使用 const 表达式时的问题。[#12659](https://github.com/ClickHouse/ClickHouse/pull/12659) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了 StorageKafka 在 broker 不可用等情况下发生的 SIGSEGV。 [#12658](https://github.com/ClickHouse/ClickHouse/pull/12658) ([Azat Khuzhin](https://github.com/azat)).
* 修复了使用 cache 布局的外部字典中的竞态条件，该问题可能导致服务器崩溃。[#12566](https://github.com/ClickHouse/ClickHouse/pull/12566) ([alesapin](https://github.com/alesapin)) 。
* 修复了一个 bug：在 `enable_mixed_granularity_parts=1` 时，执行 `ALTER DELETE` 查询后会导致旧 parts 损坏。修复了 [#12536](https://github.com/ClickHouse/ClickHouse/issues/12536)。[#12543](https://github.com/ClickHouse/ClickHouse/pull/12543) ([alesapin](https://github.com/alesapin)).
* 改进了当函数 `in` 的参数数量无效时抛出的异常信息。[#12529](https://github.com/ClickHouse/ClickHouse/pull/12529) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了读取 compact parts 时的性能问题。[#12492](https://github.com/ClickHouse/ClickHouse/pull/12492) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在启用 `text_log` 时修复了死锁问题。[#12452](https://github.com/ClickHouse/ClickHouse/pull/12452) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 StorageMerge 中可能出现的段错误。关闭 [#12054](https://github.com/ClickHouse/ClickHouse/issues/12054)。[#12401](https://github.com/ClickHouse/ClickHouse/pull/12401) ([tavplubix](https://github.com/tavplubix))。
* 修复了带有 `-State` 和 `Nullable` 参数的聚合函数中 `TOTALS/ROLLUP/CUBE` 的问题。此修复解决了 [#12163](https://github.com/ClickHouse/ClickHouse/issues/12163)。[#12376](https://github.com/ClickHouse/ClickHouse/pull/12376) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `WITH FILL` 修饰符中列的顺序。此前未遵循 `ORDER BY` 语句中的列顺序。[#12306](https://github.com/ClickHouse/ClickHouse/pull/12306) ([Anton Popov](https://github.com/CurtizJ)).
* 避免在存在按虚拟列 (例如 `Merge` 表中的 `_table`) 或系统表中的“索引”列过滤数据的表达式时出现 "bad cast" 异常；例如，在查询 `system.tables` 时按数据库名称过滤，且该表达式返回 `Nullable` 类型。此修复解决了 [#12166](https://github.com/ClickHouse/ClickHouse/issues/12166)。[#12305](https://github.com/ClickHouse/ClickHouse/pull/12305) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `TrieDictionary` 加载失败后会显示错误。[#12290](https://github.com/ClickHouse/ClickHouse/pull/12290) ([Vitaly Baranov](https://github.com/vitlibar)).
* 函数 `arrayFill` 在处理空数组时存在错误，可能导致崩溃。此修复解决了 [#12263](https://github.com/ClickHouse/ClickHouse/issues/12263)。[#12279](https://github.com/ClickHouse/ClickHouse/pull/12279) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `LowCardinality` 类型实现向公共类型的转换。这样一来，就可以对包含 `LowCardinality` 列和其他列的表执行 UNION ALL。这修复了 [#8212](https://github.com/ClickHouse/ClickHouse/issues/8212)。这修复了 [#4342](https://github.com/ClickHouse/ClickHouse/issues/4342)。[#12275](https://github.com/ClickHouse/ClickHouse/pull/12275) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了这样一个问题：在 `StorageFile` 中多次连续插入时，某些特殊类型的请求头会被重复写入多次。此修复解决了 [#6155](https://github.com/ClickHouse/ClickHouse/issues/6155)。[#12197](https://github.com/ClickHouse/ClickHouse/pull/12197) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了当 UInt8 值不为 0 或 1 时逻辑函数的问题。[#12196](https://github.com/ClickHouse/ClickHouse/pull/12196) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了在消除 GROUP BY 中的单射函数时，对 `dictGet` 参数的检查问题。[#12179](https://github.com/ClickHouse/ClickHouse/pull/12179) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `ALTER DELETE` 中的错误逻辑：当条件计算结果为 NULL 时，会误删记录。此修复解决了 [#9088](https://github.com/ClickHouse/ClickHouse/issues/9088)。此更改关闭了 [#12106](https://github.com/ClickHouse/ClickHouse/issues/12106)。[#12153](https://github.com/ClickHouse/ClickHouse/pull/12153) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在存在别名时发送到外部 DBMS (如 MySQL、ODBC) 的查询转换问题。此修复解决了 [#12032](https://github.com/ClickHouse/ClickHouse/issues/12032)。[#12151](https://github.com/ClickHouse/ClickHouse/pull/12151) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了整数除法中潜在的溢出问题。此修复解决了 [#12119](https://github.com/ClickHouse/ClickHouse/issues/12119)。[#12140](https://github.com/ClickHouse/ClickHouse/pull/12140) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `greatCircleDistance`、`geoDistance` 中可能出现的无限循环问题。该修复解决了 [#12117](https://github.com/ClickHouse/ClickHouse/issues/12117)。[#12137](https://github.com/ClickHouse/ClickHouse/pull/12137) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 避免附加到系统日志 (system.query\_log、metric\_log 等) 或 `engine=Buffer` 底层表的、带有 joins 或 subqueries 的 materialized views 出现 `There is no query` 异常。[#12120](https://github.com/ClickHouse/ClickHouse/pull/12120) ([filimonov](https://github.com/filimonov)).
* 修复了因线程总数限制错误导致的带有 `UNION` 的 `SELECT` 查询性能问题。修复了 [#12030](https://github.com/ClickHouse/ClickHouse/issues/12030)。[#12103](https://github.com/ClickHouse/ClickHouse/pull/12103) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复了 `-StateResample` 组合器引发的段错误。[#12092](https://github.com/ClickHouse/ClickHouse/pull/12092) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了从 `VIEW` 查询时对线程数的不必要限制。修复了 [#11937](https://github.com/ClickHouse/ClickHouse/issues/11937)。[#12085](https://github.com/ClickHouse/ClickHouse/pull/12085) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 修复了在 `PREWHERE` 中使用错误类型时可能导致的崩溃。修复 [#12053](https://github.com/ClickHouse/ClickHouse/issues/12053)、[#12060](https://github.com/ClickHouse/ClickHouse/issues/12060)。[#12060](https://github.com/ClickHouse/ClickHouse/pull/12060) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了函数 `defaultValueOfArgumentType` 在使用 `LowCardinality` 类型时出现的错误：`Expected single dictionary argument for function`。修复 [#11808](https://github.com/ClickHouse/ClickHouse/issues/11808)。[#12056](https://github.com/ClickHouse/ClickHouse/pull/12056) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了高阶函数在使用 `Tuple(LowCardinality)` 参数时出现的错误 `Cannot capture column`。修复 [#9766](https://github.com/ClickHouse/ClickHouse/issues/9766)。[#12055](https://github.com/ClickHouse/ClickHouse/pull/12055) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在加载数据库时并行解析表的元数据。这修复了表数量较多时服务器启动缓慢的问题。[#12045](https://github.com/ClickHouse/ClickHouse/pull/12045) ([tavplubix](https://github.com/tavplubix)).
* 使 `topK` 聚合函数在 枚举 类型上返回 枚举 值。这修复了 [#3740](https://github.com/ClickHouse/ClickHouse/issues/3740)。[#12043](https://github.com/ClickHouse/ClickHouse/pull/12043) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了约束为常量表达式时的约束检查问题。此修复解决了 [#11360](https://github.com/ClickHouse/ClickHouse/issues/11360)。[#12042](https://github.com/ClickHouse/ClickHouse/pull/12042) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了将元组与 `Nullable` 列进行错误比较的问题。修复了 [#11985](https://github.com/ClickHouse/ClickHouse/issues/11985)。[#12039](https://github.com/ClickHouse/ClickHouse/pull/12039) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了调用函数 `if` 时，传入不同长度的 `FixedString` 类型参数可能导致结果错误或崩溃的问题。此修复解决了 [#11362](https://github.com/ClickHouse/ClickHouse/issues/11362)。[#12021](https://github.com/ClickHouse/ClickHouse/pull/12021) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果查询中唯一返回的 expression 是函数 `neighbor`，且该函数以偏移量 `-9223372036854775808` 调用，则结果可能为空。此修复解决了 [#11367](https://github.com/ClickHouse/ClickHouse/issues/11367)。[#12019](https://github.com/ClickHouse/ClickHouse/pull/12019) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 generateRandom 中可能导致崩溃的数组大小潜在溢出问题。此项修复对应 [#11371](https://github.com/ClickHouse/ClickHouse/issues/11371)。[#12013](https://github.com/ClickHouse/ClickHouse/pull/12013) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了潜在的浮点异常问题。已关闭 [#11378](https://github.com/ClickHouse/ClickHouse/issues/11378)。[#12005](https://github.com/ClickHouse/ClickHouse/pull/12005) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 server 启动时日志消息中错误的设置名称。[#11997](https://github.com/ClickHouse/ClickHouse/pull/11997) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `Values` 格式中出现的 `Query parameter was not set` 问题。修复 [#11918](https://github.com/ClickHouse/ClickHouse/issues/11918)。[#11936](https://github.com/ClickHouse/ClickHouse/pull/11936) ([tavplubix](https://github.com/tavplubix)) 。
* 在查询 (参数化查询) 中保留用于替换的别名。此项修复解决了 [#11914](https://github.com/ClickHouse/ClickHouse/issues/11914)。[#11916](https://github.com/ClickHouse/ClickHouse/pull/11916) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了解析 DateTime64 时可能发生的浮点异常。此项修复解决了 [#11374](https://github.com/ClickHouse/ClickHouse/issues/11374)。[#11875](https://github.com/ClickHouse/ClickHouse/pull/11875) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了通过 `HTTP` 接口进行内存核算的问题 (在 `wait_end_of_query=1` 时，这一问题的影响可能很大) 。[#11840](https://github.com/ClickHouse/ClickHouse/pull/11840) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在条件中包含 NULL 时，`if()` 返回错误结果的问题。[#11807](https://github.com/ClickHouse/ClickHouse/pull/11807) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 在检查相等性之前，先解析存储在 zookeeper 中的元数据。[#11739](https://github.com/ClickHouse/ClickHouse/pull/11739) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `LIMIT n WITH TIES` 与包含别名的 `ORDER BY` 语句配合使用时的问题。[#11689](https://github.com/ClickHouse/ClickHouse/pull/11689) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 cache 字典中可能读取未初始化内存的问题。[#10834](https://github.com/ClickHouse/ClickHouse/pull/10834) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 使用字面量时，IN 运算符不会使用索引；这是在 v19.3 前后引入的一项性能回退。此修复解决了 [#10574](https://github.com/ClickHouse/ClickHouse/issues/10574)。[#12062](https://github.com/ClickHouse/ClickHouse/pull/12062) ([nvartolomei](https://github.com/nvartolomei)) 。

<div id="clickhouse-release-v20312112-lts-2020-06-25">
  ### 发布版本 v20.3.12.112-lts 2020-06-25
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在 prewhere 条件中使用 `Nullable` 列时偶发的崩溃问题。此修复延续了 [#11608](https://github.com/ClickHouse/ClickHouse/issues/11608)。[#11869](https://github.com/ClickHouse/ClickHouse/pull/11869) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 不允许在高阶函数中使用 arrayJoin。此前这会导致协议同步异常。此修复已关闭 [#3933](https://github.com/ClickHouse/ClickHouse/issues/3933)。[#11846](https://github.com/ClickHouse/ClickHouse/pull/11846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复查询使用线程过多的问题。[#11788](https://github.com/ClickHouse/ClickHouse/pull/11788) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了诸如 `SELECT *, xyz.*` 这类查询的异常行为：这些查询原本应报错，却被成功执行了。[#11753](https://github.com/ClickHouse/ClickHouse/pull/11753) ([hexiaoting](https://github.com/hexiaoting)).
* 现在，在修改元数据期间，副本拉取操作会被取消。[#11744](https://github.com/ClickHouse/ClickHouse/pull/11744) ([alesapin](https://github.com/alesapin)) 。
* 修复了 Values 输入格式中因复杂字面量类型推断错误导致的 LOGICAL\_ERROR。[#11732](https://github.com/ClickHouse/ClickHouse/pull/11732) ([tavplubix](https://github.com/tavplubix)).
* 修复了在常量列上使用 `ORDER BY ... WITH FILL` 时的问题。[#11697](https://github.com/ClickHouse/ClickHouse/pull/11697) ([Anton Popov](https://github.com/CurtizJ)) 。
* 与 XDBC bridge 通信时传递正确的超时设置。最近在检查 bridge 存活状态和接收元信息时，超时设置未生效。 [#11690](https://github.com/ClickHouse/ClickHouse/pull/11690) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了一个会导致 `system.mutations` 状态不正确的错误。它可能显示整个变更已完成，但服务器的复制队列中仍有 `MUTATE_PART` task，并会尝试执行它们。此修复解决了 [#11611](https://github.com/ClickHouse/ClickHouse/issues/11611)。[#11681](https://github.com/ClickHouse/ClickHouse/pull/11681) ([alesapin](https://github.com/alesapin)) 。
* 新增了对带有不区分大小写标志的正则表达式的支持。此修复解决了 [#11101](https://github.com/ClickHouse/ClickHouse/issues/11101) 和 [#11506](https://github.com/ClickHouse/ClickHouse/issues/11506)。[#11649](https://github.com/ClickHouse/ClickHouse/pull/11649) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 如果设置了行级安全性，则移除简单的 `count` 查询优化。在之前的版本中，用户获得的是表中记录的总数，而不是过滤后的数量。此修复解决了 [#11352](https://github.com/ClickHouse/ClickHouse/issues/11352)。[#11644](https://github.com/ClickHouse/ClickHouse/pull/11644) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 String 类型的布隆过滤器 (数据跳过索引) 问题。[#11638](https://github.com/ClickHouse/ClickHouse/pull/11638) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 prewhere 条件中使用 `Nullable` 列时偶发的崩溃问题。 (可能在某种程度上与 [#11572](https://github.com/ClickHouse/ClickHouse/issues/11572) 有关。) [#11608](https://github.com/ClickHouse/ClickHouse/pull/11608) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了对从 `Buffer` 表读取并进行采样的查询报出 `Block structure mismatch` 错误的问题。 [#11602](https://github.com/ClickHouse/ClickHouse/pull/11602) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `clickhouse-client` 在 exception.code() % 256 = 0 时退出码错误的问题。 [#11601](https://github.com/ClickHouse/ClickHouse/pull/11601) ([filimonov](https://github.com/filimonov)).
* 修复了 server 启动时，日志消息 "Mark cache size was lowered" 中的一个小错误。此更改关闭了 [#11399](https://github.com/ClickHouse/ClickHouse/issues/11399)。[#11589](https://github.com/ClickHouse/ClickHouse/pull/11589) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在对包含 `PREWHERE column in (subquery)` 和 `ARRAY JOIN` 的查询执行时出现的错误 `Size of offsets does not match size of column`。[#11580](https://github.com/ClickHouse/ClickHouse/pull/11580) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* HTTP 会话中的所有查询之前都使用相同的 query\_id。此问题已修复。[#11578](https://github.com/ClickHouse/ClickHouse/pull/11578) ([tavplubix](https://github.com/tavplubix)) 。
* 现在，clickhouse-server Docker 容器会优先使用 IPv6 检查服务器是否存活。[#11550](https://github.com/ClickHouse/ClickHouse/pull/11550) ([Ivan Starkov](https://github.com/istarkov)) 。
* 修复 `<node>` 的 shard\_num/replica\_num 问题 (会导致 use\_compact\_format\_in\_distributed\_parts\_names 无法使用) 。[#11528](https://github.com/ClickHouse/ClickHouse/pull/11528) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在使用 `-State` 函数进行聚合时，如果中途抛出异常会导致的内存泄漏问题。此修复对应 [#8995](https://github.com/ClickHouse/ClickHouse/issues/8995)。[#11496](https://github.com/ClickHouse/ClickHouse/pull/11496) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了在别名可能覆盖带限定符列名时，distributed queries 返回错误结果的问题。修复了 [#9672](https://github.com/ClickHouse/ClickHouse/issues/9672) [#9714](https://github.com/ClickHouse/ClickHouse/issues/9714)。[#9972](https://github.com/ClickHouse/ClickHouse/pull/9972) ([Artem Zuikov](https://github.com/4ertus2)).

<div id="clickhouse-release-v2031197-lts-2020-06-10">
  ### ClickHouse 发布版本 v20.3.11.97-lts 2020-06-10
</div>

<div id="new-feature-7">
  #### 新特性
</div>

* 现在，字典源的超时由 ClickHouse 端控制。为 cache 字典配置新增了两项设置：`strict_max_lifetime_seconds`，默认值为 `max_lifetime`；以及 `query_wait_timeout_milliseconds`，默认值为一分钟。第一项设置与 `allow_read_expired_keys` 搭配使用时也很有用 (可禁止读取过期时间过长的键) 。[#10337](https://github.com/ClickHouse/ClickHouse/pull/10337) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在启用 `min_bytes_to_use_direct_io`，且 PREWHERE 生效并使用 SAMPLE 或线程数较高时可能发生的 `Data compressed with different methods` 错误。此修复解决了 [#11539](https://github.com/ClickHouse/ClickHouse/issues/11539)。[#11540](https://github.com/ClickHouse/ClickHouse/pull/11540) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复编解码器返回的压缩后大小有误的问题。[#11448](https://github.com/ClickHouse/ClickHouse/pull/11448) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了当列的压缩编解码器带有非字面量参数时服务端崩溃的问题。修复了 [#11365](https://github.com/ClickHouse/ClickHouse/issues/11365)。[#11431](https://github.com/ClickHouse/ClickHouse/pull/11431) ([alesapin](https://github.com/alesapin)) 。
* 修复 pointInPolygon 在点为 nan 时的问题。修复了 [#11375](https://github.com/ClickHouse/ClickHouse/issues/11375)。[#11421](https://github.com/ClickHouse/ClickHouse/pull/11421) ([Alexey Ilyukhov](https://github.com/livace)) 。
* 修复对 LowCarinality(T) 和 Nullable(T) 执行 JOIN 时发生的崩溃问题。[#11380](https://github.com/ClickHouse/ClickHouse/issues/11380)。[#11414](https://github.com/ClickHouse/ClickHouse/pull/11414) ([Artem Zuikov](https://github.com/4ertus2))。
* 修复 `USING` 键不正确时的错误代码。[#11373](https://github.com/ClickHouse/ClickHouse/issues/11373)。[#11404](https://github.com/ClickHouse/ClickHouse/pull/11404) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了 `geohashesInBox` 在参数超出经纬度取值范围时的问题。[#11403](https://github.com/ClickHouse/ClickHouse/pull/11403) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 改进了 `joinGet()` 函数的错误信息。[#11389](https://github.com/ClickHouse/ClickHouse/pull/11389) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了带有外部排序和 limit 的查询中可能出现的 `Pipeline stuck` error。修复了 [#11359](https://github.com/ClickHouse/ClickHouse/issues/11359)。[#11366](https://github.com/ClickHouse/ClickHouse/pull/11366) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在 ReplicatedMergeTree 中发送 parts 时，移除多余的锁。[#11354](https://github.com/ClickHouse/ClickHouse/pull/11354) ([alesapin](https://github.com/alesapin)) 。
* 修复了 clickhouse-client 在多行模式下对 `\G` (纵向输出) 的支持。此修复解决了 [#9933](https://github.com/ClickHouse/ClickHouse/issues/9933)。[#11350](https://github.com/ClickHouse/ClickHouse/pull/11350) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复直接从 StorageJoin 执行 select (不使用 JOIN) 时发生的崩溃问题以及错误的可空性。[#11340](https://github.com/ClickHouse/ClickHouse/pull/11340) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复 `quantilesExactWeightedArray` 的崩溃问题。[#11337](https://github.com/ClickHouse/ClickHouse/pull/11337) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 现在，在 `ALTER` 查询更改元数据之前，会先停止合并操作。[#11335](https://github.com/ClickHouse/ClickHouse/pull/11335) ([alesapin](https://github.com/alesapin)).
* 重新支持在设置 `parallel_view_processing = 1` 时并行写入 `MATERIALIZED VIEW`。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#11330](https://github.com/ClickHouse/ClickHouse/pull/11330) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `visitParamExtractRaw` 在提取出的 JSON 包含带有不成对的 \{ 或 \[ 的字符串时出现的问题。[#11318](https://github.com/ClickHouse/ClickHouse/pull/11318) ([Ewout](https://github.com/devwout)) 。
* 修复了 ThreadPool 中一个极少见的竞态条件。[#11314](https://github.com/ClickHouse/ClickHouse/pull/11314) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了转换过程中可能出现的未初始化内存问题。示例：`SELECT toIntervalSecond(now64())`。[#11311](https://github.com/ClickHouse/ClickHouse/pull/11311) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了以下问题：当表的主键中包含 Array 列，且查询使用 `empty` 或 `notEmpty` 函数基于该列进行过滤时，索引分析无法生效。此修复对应 [#11286](https://github.com/ClickHouse/ClickHouse/issues/11286)。[#11303](https://github.com/ClickHouse/ClickHouse/pull/11303) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个 bug：当查询速度估算不准确时，如果查询因 `max_network_bandwidth`、`max_execution_speed` 或 `priority` 设置而被限速，`min_execution_speed` 的限制可能不会生效或生效异常。将 `timeout_before_checking_execution_speed` 的默认值改为非零，因为否则 `min_execution_speed` 和 `max_execution_speed` 设置将不起作用。此修复解决了 [#11297](https://github.com/ClickHouse/ClickHouse/issues/11297)。此修复解决了 [#5732](https://github.com/ClickHouse/ClickHouse/issues/5732)。此修复解决了 [#6228](https://github.com/ClickHouse/ClickHouse/issues/6228)。易用性改进：避免在 `clickhouse-client` 中将异常消息与进度条拼接在一起。[#11296](https://github.com/ClickHouse/ClickHouse/pull/11296) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了读取 Protobuf format 格式的畸形数据时发生崩溃的问题。此修复解决了 [#5957](https://github.com/ClickHouse/ClickHouse/issues/5957) 和 [#11203](https://github.com/ClickHouse/ClickHouse/issues/11203)。[#11258](https://github.com/ClickHouse/ClickHouse/pull/11258) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了一个 bug：当 cache-dictionary 中只有已过期的键时，可能会返回默认值而不是正常值。此问题仅影响字符串字段。[#11233](https://github.com/ClickHouse/ClickHouse/pull/11233) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复从带常量的内部查询读取 `VIEW` 时出现的 `Block structure mismatch in QueryPipeline` 错误。修复 [#11181](https://github.com/ClickHouse/ClickHouse/issues/11181)。[#11205](https://github.com/ClickHouse/ClickHouse/pull/11205) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了可能出现的异常 `Invalid status for associated output`。[#11200](https://github.com/ClickHouse/ClickHouse/pull/11200) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了高阶函数在捕获参数为 `Array(Array(LowCardinality))` 时可能出现的 `Cannot capture column` 错误。[#11185](https://github.com/ClickHouse/ClickHouse/pull/11185) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 S3 glob 匹配在键数量超过 1000 且某些后端上可能失败的问题。[#11179](https://github.com/ClickHouse/ClickHouse/pull/11179) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 如果数据跳过索引依赖于会在后台合并过程中被修改的列 (适用于 SummingMergeTree、AggregatingMergeTree 以及 TTL GROUP BY) ，就会导致计算不正确。此问题已通过将索引计算移到合并之后来修复，从而使索引基于合并后的数据进行计算。[#11162](https://github.com/ClickHouse/ClickHouse/pull/11162) ([Azat Khuzhin](https://github.com/azat)).
* 修复了简单查询时预留线程过多的问题 (用于减少线程数量的优化在管道变更后部分失效) 。[#11114](https://github.com/ClickHouse/ClickHouse/pull/11114) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了带有 `HAVING` 子句的分布式查询在谓词优化 (`enable_optimize_predicate_expression=1`) 中的问题 (即需要在发起端服务器上进行过滤时) ：通过保留表达式的顺序即可修复；同时还强制聚合器使用列名而不是索引。修复：[#10613](https://github.com/ClickHouse/ClickHouse/issues/10613)、[#11413](https://github.com/ClickHouse/ClickHouse/issues/11413)。[#10621](https://github.com/ClickHouse/ClickHouse/pull/10621) ([Azat Khuzhin](https://github.com/azat)) 。
* 引入提交重试逻辑，以降低在极少数偏移量提交失败的情况下从 Kafka 获取重复数据的可能性。[#9884](https://github.com/ClickHouse/ClickHouse/pull/9884) ([filimonov](https://github.com/filimonov)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 对每次调用任何读取外部字典的函数，只获取一次字典并检查一次访问权限。[#10928](https://github.com/ClickHouse/ClickHouse/pull/10928) ([Vitaly Baranov](https://github.com/vitlibar)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复若干偶发失败的集成测试。[#11355](https://github.com/ClickHouse/ClickHouse/pull/11355) ([alesapin](https://github.com/alesapin)).

<div id="clickhouse-release-v2031075-lts-2020-05-23">
  ### ClickHouse 发布版本 v20.3.10.75-lts 2020-05-23
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 若未完成任何最终化操作，则移除变更最终化任务的日志输出。[#11109](https://github.com/ClickHouse/ClickHouse/pull/11109) ([alesapin](https://github.com/alesapin)).
* 修复了 `parseDateTime64BestEffort` 参数解析相关的问题。[#11038](https://github.com/ClickHouse/ClickHouse/pull/11038) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复了方法 `getRawData()` 返回的原始数据大小不正确的问题。[#10964](https://github.com/ClickHouse/ClickHouse/pull/10964) ([Igr](https://github.com/ObjatieGroba)).
* 修复了 20.1 及更早版本之间在双层聚合上的兼容性问题。当发起节点和远程节点使用不同版本的 ClickHouse，且 `GROUP BY` 结果集较大，并且聚合是基于单个 `String` field 执行时，就会出现这种兼容性问题。这会导致结果中同一个键对应多行未 merge 的行。[#10952](https://github.com/ClickHouse/ClickHouse/pull/10952) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `Distributed` 表中元组的向后兼容性问题。[#10889](https://github.com/ClickHouse/ClickHouse/pull/10889) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `StringHashTable` 中在该键不存在时出现的 `SIGSEGV`。 [#10870](https://github.com/ClickHouse/ClickHouse/pull/10870) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `ReplicatedMergeTree` 中的一个 bug：在某个副本变为非活动状态后，某些针对 `OPTIMIZE` 查询的 `ALTER` 可能会因一直等待该副本而卡住。[#10849](https://github.com/ClickHouse/ClickHouse/pull/10849) ([tavplubix](https://github.com/tavplubix)).
* 修复了 `Block::sortColumns()` 后的列顺序。[#10826](https://github.com/ClickHouse/ClickHouse/pull/10826) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在不需要为标识符加引号时 `ODBC` bridge 出现的问题。修复 [#7984](https://github.com/ClickHouse/ClickHouse/issues/7984)。[#10821](https://github.com/ClickHouse/ClickHouse/pull/10821) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `DateLUT` 中的 `UBSan` 和 `MSan` 报告问题已修复。[#10798](https://github.com/ClickHouse/ClickHouse/pull/10798) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了键条件中的错误类型转换。修复了 [#6287](https://github.com/ClickHouse/ClickHouse/issues/6287)。[#10791](https://github.com/ClickHouse/ClickHouse/pull/10791) ([Andrew Onyshchuk](https://github.com/oandrew))
* 修复了 `parallel_view_processing` 的行为。现在，即使发生异常，所有对 `MATERIALIZED VIEW` 的插入也都应无一例外地完成。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#10757](https://github.com/ClickHouse/ClickHouse/pull/10757) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了组合器 `-OrNull` 和 `-OrDefault` 与 `-State` 结合使用时的问题。[#10741](https://github.com/ClickHouse/ClickHouse/pull/10741) ([hcz](https://github.com/hczhcz)) 。
* 修复了 `generateRandom` 在嵌套类型情况下崩溃的问题。修复 [#10583](https://github.com/ClickHouse/ClickHouse/issues/10583)。[#10734](https://github.com/ClickHouse/ClickHouse/pull/10734) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `SummingMergeTree` 中 `LowCardinality(FixedString)` 键列在合并后可能发生的数据损坏问题。修复 [#10489](https://github.com/ClickHouse/ClickHouse/issues/10489)。[#10721](https://github.com/ClickHouse/ClickHouse/pull/10721) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了函数 `h3EdgeAngle` 中可能出现的缓冲区溢出问题。[#10711](https://github.com/ClickHouse/ClickHouse/pull/10711) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 totals 消失的问题。如果查询包含 join，或带有外部 WHERE 条件的子查询，totals 可能会被过滤掉。修复了 [#10674](https://github.com/ClickHouse/ClickHouse/issues/10674)。[#10698](https://github.com/ClickHouse/ClickHouse/pull/10698) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在同一查询中多次对相同集合使用 `IN` 运算符的问题。[#10686](https://github.com/ClickHouse/ClickHouse/pull/10686) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了一个 bug：当 `readonly=2` 且 `cancel_http_readonly_queries_on_client_close=1` 时，如果客户端关闭，HTTP 请求会卡住。修复了 [#7939](https://github.com/ClickHouse/ClickHouse/issues/7939)、[#7019](https://github.com/ClickHouse/ClickHouse/issues/7019)、[#7736](https://github.com/ClickHouse/ClickHouse/issues/7736)、[#7091](https://github.com/ClickHouse/ClickHouse/issues/7091)。[#10684](https://github.com/ClickHouse/ClickHouse/pull/10684) ([tavplubix](https://github.com/tavplubix)) 。
* 修正了 `AggregateTransform` 构造函数中参数的顺序。[#10667](https://github.com/ClickHouse/ClickHouse/pull/10667) ([palasonic1](https://github.com/palasonic1)) 。
* 修复了在启用 `distributed_aggregation_memory_efficient` 时远程查询不能并行执行的问题。修复 [#10655](https://github.com/ClickHouse/ClickHouse/issues/10655)。[#10664](https://github.com/ClickHouse/ClickHouse/pull/10664) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了带有 `LIMIT` 的查询返回行数可能不正确的问题。修复了 [#10566](https://github.com/ClickHouse/ClickHouse/issues/10566)、[#10709](https://github.com/ClickHouse/ClickHouse/issues/10709)。[#10660](https://github.com/ClickHouse/ClickHouse/pull/10660) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个 bug：当表中有大量 parts 时，会导致并发 ALTER 操作被锁定。[#10659](https://github.com/ClickHouse/ClickHouse/pull/10659) ([alesapin](https://github.com/alesapin)).
* 修复了一个 bug：执行 `SYSTEM DROP DNS CACHE` 查询时，还会一并删除用于检查用户是否允许从某些 IP 地址连接的缓存。 [#10608](https://github.com/ClickHouse/ClickHouse/pull/10608) ([tavplubix](https://github.com/tavplubix)).
* 修复了 `MATERIALIZED VIEW` 的内部查询在包含依赖表时产生错误 scalar 结果的问题。[#10603](https://github.com/ClickHouse/ClickHouse/pull/10603) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了对默认表达式类型与列类型不一致的 `ALIAS` 列执行 `SELECT` 时的问题。[#10563](https://github.com/ClickHouse/ClickHouse/pull/10563) ([Azat Khuzhin](https://github.com/azat)).
* 支持了 DateTime64 与 String 值之间的比较。[#10560](https://github.com/ClickHouse/ClickHouse/pull/10560) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复了索引损坏问题：在某些情况下，将 compact parts 合并为另一个 compact part 后，可能会出现该问题。[#10531](https://github.com/ClickHouse/ClickHouse/pull/10531) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了一种情况：变更已完成所有 parts，但仍卡在 `is_done=0`。 [#10526](https://github.com/ClickHouse/ClickHouse/pull/10526) ([alesapin](https://github.com/alesapin)).
* 修复了相对 `UTC` 存在小数偏移的时区在 Unix 纪元起始处的溢出问题。此修复解决了 [#9335](https://github.com/ClickHouse/ClickHouse/issues/9335)。[#10513](https://github.com/ClickHouse/ClickHouse/pull/10513) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `Distributed` 存储非正常关闭的问题。[#10491](https://github.com/ClickHouse/ClickHouse/pull/10491) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `simpleLinearRegression` 在处理大整数时的数值溢出问题。[#10474](https://github.com/ClickHouse/ClickHouse/pull/10474) ([hcz](https://github.com/hczhcz)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了 LZ4 库中的 UBSan 报告问题。[#10631](https://github.com/ClickHouse/ClickHouse/pull/10631) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 clang-10 的构建问题。[#10238](https://github.com/ClickHouse/ClickHouse/issues/10238). [#10370](https://github.com/ClickHouse/ClickHouse/pull/10370) ([Amos Bird](https://github.com/amosbird)).
* 新增了关于 `max_rows_to_sort` 设置项的失败测试。[#10268](https://github.com/ClickHouse/ClickHouse/pull/10268) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 改进了 input format 中诊断信息的输出。修复了 [#10204](https://github.com/ClickHouse/ClickHouse/issues/10204)。[#10418](https://github.com/ClickHouse/ClickHouse/pull/10418) ([tavplubix](https://github.com/tavplubix)).
* 在 clickhouse-server Docker image 中添加了 CA certificates。[#10476](https://github.com/ClickHouse/ClickHouse/pull/10476) ([filimonov](https://github.com/filimonov)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复错误 `the BloomFilter false positive must be a double number between 0 and 1`。[#10551](https://github.com/ClickHouse/ClickHouse/issues/10551) [#10569](https://github.com/ClickHouse/ClickHouse/pull/10569) ([Winter Zhang](https://github.com/zhang2014)) 。

<div id="clickhouse-release-v203853-2020-04-23">
  ### ClickHouse 发布版本 v20.3.8.53，2020-04-23
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 datetime 函数在相对于 UTC 的偏移曾在正负之间变动的时区中行为不正确的问题 (例如 Pacific/Kiritimati) 。此修复对应 [#7202](https://github.com/ClickHouse/ClickHouse/issues/7202) [#10369](https://github.com/ClickHouse/ClickHouse/pull/10369) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了在启用 `distributed_group_by_no_merge` 时可能发生的段错误 (该问题在 20.3.7.46 中引入，见 [#10131](https://github.com/ClickHouse/ClickHouse/issues/10131)) 。[#10399](https://github.com/ClickHouse/ClickHouse/pull/10399) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 `Array(Tuple(...))` 数据类型被错误展平的问题。此修复对应于 [#10259](https://github.com/ClickHouse/ClickHouse/issues/10259) [#10390](https://github.com/ClickHouse/ClickHouse/pull/10390) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除 Aggregator 中的磁盘预留。这修复了磁盘空间预留中的一个问题；此前即使本可成功完成，大型外部聚合也可能因此失败 [#10375](https://github.com/ClickHouse/ClickHouse/pull/10375) ([Azat Khuzhin](https://github.com/azat))
* 修复了 `ReplicatedMergeTree` 中 `DROP` 与 `OPTIMIZE` 的竞争条件问题。如果同时存在 `OPTIMIZE` 查询，`DROP` 可能会在 ZooKeeper 的副本路径中残留一些垃圾数据。[#10312](https://github.com/ClickHouse/ClickHouse/pull/10312) ([tavplubix](https://github.com/tavplubix))
* 修复了修改列默认值后服务器无法附加表的问题。[#10441](https://github.com/ClickHouse/ClickHouse/pull/10441) ([alesapin](https://github.com/alesapin))
* 如果在加载表之前 attach 数据库失败，请不要删除元数据目录。  [#10442](https://github.com/ClickHouse/ClickHouse/pull/10442) ([Winter Zhang](https://github.com/zhang2014))
* 修复了若干问题：某些数据以 quorum 方式写入后，若又因某种原因被删除 (`DROP PARTITION`、生存时间 (TTL)) ，会导致 INSERT 卡住，或在 SELECT 中出现误报异常。此修复对应于 [#9946](https://github.com/ClickHouse/ClickHouse/issues/9946) [#10188](https://github.com/ClickHouse/ClickHouse/pull/10188) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 修复了 `ConcatProcessor` 中可能出现的 `Pipeline stuck` 错误，该错误可能发生在远程查询中。[#10381](https://github.com/ClickHouse/ClickHouse/pull/10381) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了 HashTable 中的不正确行为；该问题会导致在尝试从缓冲区读取 HashMap 时发生编译错误。[#10386](https://github.com/ClickHouse/ClickHouse/pull/10386) ([palasonic1](https://github.com/palasonic1))
* 允许在包含多个 JOIN 的查询中使用 `count(*)`。修复了 [#9853](https://github.com/ClickHouse/ClickHouse/issues/9853) [#10291](https://github.com/ClickHouse/ClickHouse/pull/10291) ([Artem Zuikov](https://github.com/4ertus2))
* 优先使用 `fallback_to_stale_replicas` 而非 `skip_unavailable_shards`，否则如果同时指定了这两个设置，且没有最新的副本，查询将会失败 (补丁由 @alex-zaitsev 提供) 。修复：[#2564](https://github.com/ClickHouse/ClickHouse/issues/2564)。[#10422](https://github.com/ClickHouse/ClickHouse/pull/10422) ([Azat Khuzhin](https://github.com/azat))
* 修复了这样一个问题：包含 ARRAY JOIN、ORDER BY 和 LIMIT 的查询可能返回不完整的结果。此修复对应 [#10226](https://github.com/ClickHouse/ClickHouse/issues/10226)。作者：[Vadim Plakhtinskiy](https://github.com/VadimPlh)。[#10427](https://github.com/ClickHouse/ClickHouse/pull/10427) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 创建 BloomFilter 索引时校验参数数量及类型 [#9623](https://github.com/ClickHouse/ClickHouse/issues/9623) [#10431](https://github.com/ClickHouse/ClickHouse/pull/10431) ([Winter Zhang](https://github.com/zhang2014))

<div id="performance-improvement">
  #### 性能改进
</div>

* 提升了 `IN` 运算符右侧显式定义 Set、左侧使用元组时的查询性能。此修复解决了 20.3 版本中的性能回退问题。[#9740](https://github.com/ClickHouse/ClickHouse/pull/9740), [#10385](https://github.com/ClickHouse/ClickHouse/pull/10385) ([Anton Popov](https://github.com/CurtizJ))

<div id="clickhouse-release-v203746-2020-04-17">
  ### ClickHouse 发行版 v20.3.7.46，2020-04-17
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在查询中混用逗号 JOIN 和具名 JOIN 时出现的 `Logical error: CROSS JOIN has expressions` 错误。[#10311](https://github.com/ClickHouse/ClickHouse/pull/10311) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了使用 `max_bytes_before_external_group_by` 的查询问题。[#10302](https://github.com/ClickHouse/ClickHouse/pull/10302) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复了在存在 arrayJoin 函数时 (某些情况下) move-to-prewhere 优化失效的问题。此修复解决了 [#10092](https://github.com/ClickHouse/ClickHouse/issues/10092)。[#10195](https://github.com/ClickHouse/ClickHouse/pull/10195) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了可通过 `allow_nondeterministic_mutations` 设置放宽在变更中使用非确定性函数限制的能力。[#10186](https://github.com/ClickHouse/ClickHouse/pull/10186) ([filimonov](https://github.com/filimonov)).

<div id="clickhouse-release-v203640-2020-04-16">
  ### ClickHouse 发行版 v20.3.6.40，2020-04-16
</div>

<div id="new-feature">
  #### 新功能
</div>

* 新增函数 `isConstant`。该函数用于检查其参数是否为常量表达式，并返回 1 或 0。它主要用于开发、调试和演示。[#10198](https://github.com/ClickHouse/ClickHouse/pull/10198) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在使用 `max_rows_to_group_by` 和 `group_by_overflow_mode = 'break'` 时出现 `Pipeline stuck` 错误的问题。[#10279](https://github.com/ClickHouse/ClickHouse/pull/10279) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复一种罕见情况下可能出现的异常：`Cannot drain connections: cancel first`。[#10239](https://github.com/ClickHouse/ClickHouse/pull/10239) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个 bug：当用户尝试对使用 `ENGINE = Replicated*` 的表执行 ALTER UPDATE/DELETE 时，ClickHouse 会抛出 "Unknown function lambda." 错误。现在，对非确定性函数的检查已能正确处理 lambda 表达式。[#10237](https://github.com/ClickHouse/ClickHouse/pull/10237) ([Alexander Kazakov](https://github.com/Akazz)) 。
* 修复了适用于 Date 类型的 "generateRandom" 函数。此修复对应 [#9973](https://github.com/ClickHouse/ClickHouse/issues/9973)。修复了一个边界情况：当年份为 2106 的日期被插入采用旧式分区方案的 MergeTree 表时，分区名称却被记为了 1970 年。[#10218](https://github.com/ClickHouse/ClickHouse/pull/10218) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 如果 View 的表定义与 `SELECT` 查询不一致，则进行类型转换。此修复解决了 [#10180](https://github.com/ClickHouse/ClickHouse/issues/10180) 和 [#10022](https://github.com/ClickHouse/ClickHouse/issues/10022)。[#10217](https://github.com/ClickHouse/ClickHouse/pull/10217) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `parseDateTimeBestEffort` 在处理 RFC-2822 字符串且星期为星期二或星期四时的问题。此修复解决了 [#10082](https://github.com/ClickHouse/ClickHouse/issues/10082)。[#10214](https://github.com/ClickHouse/ClickHouse/pull/10214) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 JOIN 内部常量的列名与 JOIN 外部常量名称可能发生冲突的问题。[#10207](https://github.com/ClickHouse/ClickHouse/pull/10207) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了在从 `system.numbers` 或 `system.zeros` 这类无限数据源读取时，查询本应在 LIMIT 处停止却可能无限执行的问题。[#10206](https://github.com/ClickHouse/ClickHouse/pull/10206) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在未指定数据库时，访问检查会使用当前数据库的问题。[#10192](https://github.com/ClickHouse/ClickHouse/pull/10192) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 如果在向 Distributed() 执行 INSERT 时结构不匹配，则会转换块。[#10135](https://github.com/ClickHouse/ClickHouse/pull/10135) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复处理器管道中 extremes 结果可能不正确的问题。[#10131](https://github.com/ClickHouse/ClickHouse/pull/10131) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 compact parts 相关的某些 ALTER 问题。[#10130](https://github.com/ClickHouse/ClickHouse/pull/10130) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复创建新副本时对 `index_granularity_bytes` 的错误校验。修复了 [#10098](https://github.com/ClickHouse/ClickHouse/issues/10098)。[#10121](https://github.com/ClickHouse/ClickHouse/pull/10121) ([alesapin](https://github.com/alesapin)) 。
* 修复当 Distributed 表结构与底层表不一致时，对其执行 INSERT 发生的 SIGSEGV。[#10105](https://github.com/ClickHouse/ClickHouse/pull/10105) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复带有 `JOIN` 和 `UNION ALL` 的查询中可能出现的行丢失问题。修复了 [#9826](https://github.com/ClickHouse/ClickHouse/issues/9826)、[#10113](https://github.com/ClickHouse/ClickHouse/issues/10113)。[#10099](https://github.com/ClickHouse/ClickHouse/pull/10099) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从旧版 ClickHouse 升级时复制表的启动问题；在该版本中，`/table/replicas/replica_name/metadata` 节点不存在。修复了 [#10037](https://github.com/ClickHouse/ClickHouse/issues/10037)。[#10095](https://github.com/ClickHouse/ClickHouse/pull/10095) ([alesapin](https://github.com/alesapin))。
* 为 MySQL 数据库引擎增加了一些参数检查，并支持标识符参数。[#10077](https://github.com/ClickHouse/ClickHouse/pull/10077) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了从 localhost 上的 ClickHouse server 获取数据的 ClickHouse 字典源中的一个缺陷。如果字典和源中的类型不兼容，该缺陷可能会导致内存损坏。[#10071](https://github.com/ClickHouse/ClickHouse/pull/10071) ([alesapin](https://github.com/alesapin)).
* 修复了表包含跳过索引时 `CHECK TABLE` 查询中的一个错误。[#10068](https://github.com/ClickHouse/ClickHouse/pull/10068) ([alesapin](https://github.com/alesapin)).
* 修复错误 `Cannot clone block with columns because block has 0 columns ... While executing GroupingAggregatedTransform`。该错误发生在启用设置 `distributed_aggregation_memory_efficient` 时，分布式查询从不同分片读取不同级别的聚合数据 (即混合了单级和双级聚合) 的情况下。[#10063](https://github.com/ClickHouse/ClickHouse/pull/10063) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了一个可能出现的段错误：对包含尾随零字节的字符串键执行 GROUP BY 时可能会触发该问题 ([#8636](https://github.com/ClickHouse/ClickHouse/issues/8636), [#8925](https://github.com/ClickHouse/ClickHouse/issues/8925)) 。[#10025](https://github.com/ClickHouse/ClickHouse/pull/10025) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了远程查询执行使用的线程数问题 (自 20.3 起出现的性能回退) 。当针对 `Distributed` 表的查询同时在本地和远程分片上执行时，会出现此问题。修复了 [#9965](https://github.com/ClickHouse/ClickHouse/issues/9965)。[#9971](https://github.com/ClickHouse/ClickHouse/pull/9971) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个 bug：在针对某些数据库的查询处理的某个阶段，未能获取所需的表。修复了 [#9699](https://github.com/ClickHouse/ClickHouse/issues/9699)。[#9949](https://github.com/ClickHouse/ClickHouse/pull/9949) ([achulkov2](https://github.com/achulkov2)).
* 修复 `JOIN` 与 `TOTALS` 同时出现时触发的 '在块中未找到列' 错误。修复 [#9839](https://github.com/ClickHouse/ClickHouse/issues/9839)。[#9939](https://github.com/ClickHouse/ClickHouse/pull/9939) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了一个 bug：`ON CLUSTER` DDL 查询在服务器启动时会卡死。[#9927](https://github.com/ClickHouse/ClickHouse/pull/9927) ([Gagan Arneja](https://github.com/garneja)) 。
* 修复了 `CREATE USER` 命令中设置多个主机时的解析问题，例如 `CREATE USER user6 HOST NAME REGEXP 'lo.?*host', NAME REGEXP 'lo*host'`。[#9924](https://github.com/ClickHouse/ClickHouse/pull/9924) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 Join 表引擎中 `TRUNCATE` 的问题 ([#9917](https://github.com/ClickHouse/ClickHouse/issues/9917)) 。[#9920](https://github.com/ClickHouse/ClickHouse/pull/9920) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 ALTER 操作中的“scalar does not exist”错误 ([#9878](https://github.com/ClickHouse/ClickHouse/issues/9878)) 。[#9904](https://github.com/ClickHouse/ClickHouse/pull/9904) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 `ReplicatedMergeTree` 中 `drop` 与 `optimize` 之间的竞态条件。[#9901](https://github.com/ClickHouse/ClickHouse/pull/9901) ([alesapin](https://github.com/alesapin)) 。
* 修复了 `distributed_product_mode='local'` 中限定名称相关的错误。修复 [#4756](https://github.com/ClickHouse/ClickHouse/issues/4756)。[#9891](https://github.com/ClickHouse/ClickHouse/pull/9891) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复根据设置 'allow\_introspection\_functions' 计算内部信息函数授权时的问题。 [#9840](https://github.com/ClickHouse/ClickHouse/pull/9840) ([Vitaly Baranov](https://github.com/vitlibar)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了集成测试 `test_settings_constraints`。 [#9962](https://github.com/ClickHouse/ClickHouse/pull/9962) ([Vitaly Baranov](https://github.com/vitlibar)).
* 移除了对 `clock_getres` 的依赖。 [#9833](https://github.com/ClickHouse/ClickHouse/pull/9833) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="clickhouse-release-v203521-2020-03-27">
  ### ClickHouse 发行版 v20.3.5.21，2020-03-27
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复当查询在分布式表上同时包含 PREWHERE 和 WHERE，且 `SET distributed_product_mode = 'local'` 时出现的 “Different expressions with the same alias” 错误。[#9871](https://github.com/ClickHouse/ClickHouse/pull/9871) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复具有复合主键的表在执行变更时内存占用过高的问题。此修复解决了 [#9850](https://github.com/ClickHouse/ClickHouse/issues/9850)。[#9860](https://github.com/ClickHouse/ClickHouse/pull/9860) ([alesapin](https://github.com/alesapin)).
* 对于 INSERT 查询，分片现在会将从发起节点获取的设置限制在该分片的约束范围内，而不是抛出异常。此修复允许将 INSERT 查询发送到具有另一组约束的分片。此更改进一步完善了对 [#9447](https://github.com/ClickHouse/ClickHouse/issues/9447) 的修复。[#9852](https://github.com/ClickHouse/ClickHouse/pull/9852) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复在表列表之外 (即在 WHERE 中) 使用 COMMA JOIN 的子查询场景下出现的 “COMMA to CROSS JOIN rewriter is not enabled or cannot rewrite query” 错误。修复了 [#9782](https://github.com/ClickHouse/ClickHouse/issues/9782)。[#9830](https://github.com/ClickHouse/ClickHouse/pull/9830) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复客户端可能出现的异常 `Got 0 in totals chunk, expected 1`。该问题会出现在包含 `JOIN` 的查询中，当右侧连接表没有任何行时就会触发。例如：`select * from system.one t1 join system.one t2 on t1.dummy = t2.dummy limit 0 FORMAT TabSeparated;`。修复了 [#9777](https://github.com/ClickHouse/ClickHouse/issues/9777)。[#9823](https://github.com/ClickHouse/ClickHouse/pull/9823) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复在类型无法转换时，optimize\_skip\_unused\_shards 触发 SIGSEGV 的问题。[#9804](https://github.com/ClickHouse/ClickHouse/pull/9804) ([Azat Khuzhin](https://github.com/azat)).
* 修复 compact parts 的 `ALTER TABLE DELETE COLUMN` 查询失效的问题。[#9779](https://github.com/ClickHouse/ClickHouse/pull/9779) ([alesapin](https://github.com/alesapin)).
* 修复 max\_distributed\_connections 在启用和未启用 Processors 时存在的问题。[#9673](https://github.com/ClickHouse/ClickHouse/pull/9673) ([Azat Khuzhin](https://github.com/azat)).
* 修复了若干函数参数的时区未被正确使用的情况。[#9574](https://github.com/ClickHouse/ClickHouse/pull/9574) ([Vasily Nemkov](https://github.com/Enmk)).

<div id="improvement">
  #### 改进
</div>

* 由于我们在单个线程中从单个有序分片读取数据，因此移除了变更中的 ORDER BY 阶段。并新增了检查，确保变更中的行按排序键顺序排列，且这一顺序不会被破坏。[#9886](https://github.com/ClickHouse/ClickHouse/pull/9886) ([alesapin](https://github.com/alesapin)).

<div id="clickhouse-release-v203410-2020-03-20">
  ### ClickHouse 发行版 v20.3.4.10，2020-03-20
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 此版本还包含 20.1.8.41 中的所有缺陷修复。
* 修复了通过 http 执行查询时缺少 `rows_before_limit_at_least` 的问题 (在处理器管道中) 。该修复解决了 [#9730](https://github.com/ClickHouse/ClickHouse/issues/9730)。[#9757](https://github.com/ClickHouse/ClickHouse/pull/9757) ([Nikolai Kochetov](https://github.com/KochetovNicolai))

<div id="clickhouse-release-v20336-2020-03-17">
  ### ClickHouse 发行版 v20.3.3.6，2020-03-17
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 此版本还包含 20.1.7.38 中的所有缺陷修复。
* 修复了复制中的一个问题：如果用户在上一版本中执行过变更操作，复制将无法正常工作。此修复解决了 [#9645](https://github.com/ClickHouse/ClickHouse/issues/9645)。[#9652](https://github.com/ClickHouse/ClickHouse/pull/9652) ([alesapin](https://github.com/alesapin))。这使 20.3 版本重新具备向后兼容性。
* 新增设置 `use_compact_format_in_distributed_parts_names`，允许对写入 `Distributed` 表的 `INSERT` 查询文件使用更紧凑的格式。此修复解决了 [#9647](https://github.com/ClickHouse/ClickHouse/issues/9647)。[#9653](https://github.com/ClickHouse/ClickHouse/pull/9653) ([alesapin](https://github.com/alesapin))。这使 20.3 版本重新具备向后兼容性。

<div id="clickhouse-release-v20321-2020-03-12">
  ### ClickHouse 发行版 v20.3.2.1，2020-03-12
</div>

<div id="backward-incompatible-change-2">
  #### 向后不兼容的变更
</div>

* 修复了向具有大量副本的 `Distributed` 表发送数据时出现的 `file name too long` 问题。修复了副本凭据会暴露在服务器日志中的问题。磁盘上的目录名格式已更改为 `[shard{shard_index}[_replica{replica_index}]]`。[#8911](https://github.com/ClickHouse/ClickHouse/pull/8911) ([Mikhail Korotov](https://github.com/millb)) 升级到新版本后，如果不手动处理，将无法再降级，因为旧版服务器无法识别新的目录格式。如果你想降级，必须手动将相应目录重命名为旧格式。仅当你曾对 `Distributed` 表使用异步 `INSERT` 时，此更改才会影响你。在 20.3.3 版本中，我们将引入一项设置，让你能够逐步启用新格式。
* 更改了变更命令的复制日志记录格式。安装新版本之前，必须等待旧变更处理完毕。
* 实现一个简单的内存分析器：超过软分配限制后，每分配 N 个字节就将调用栈信息转储到 `system.trace_log` 中 [#8765](https://github.com/ClickHouse/ClickHouse/pull/8765) ([Ivan](https://github.com/abyss7)) [#9472](https://github.com/ClickHouse/ClickHouse/pull/9472) ([alexey-milovidov](https://github.com/alexey-milovidov)) `system.trace_log` 中的列已从 `timer_type` 重命名为 `trace_type`。这将需要对第三方性能分析和火焰图处理工具进行相应修改。
* 在所有地方都使用 OS 线程 ID，而不是内部线程编号。这修复了 [#7477](https://github.com/ClickHouse/ClickHouse/issues/7477)：旧版 `clickhouse-client` 在启用 `send_logs_level` 设置时，无法接收由服务器发送的日志，因为结构化日志消息的名称和类型已经发生变化。另一方面，不同版本的服务器之间也可能相互发送类型不同的日志。如果你不使用 `send_logs_level` 设置，就无需关注这一点。[#8954](https://github.com/ClickHouse/ClickHouse/pull/8954) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除 `indexHint` 函数 [#9542](https://github.com/ClickHouse/ClickHouse/pull/9542) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除 `findClusterIndex`、`findClusterValue` 函数。此更改修复了 [#8641](https://github.com/ClickHouse/ClickHouse/issues/8641)。如果你曾使用这些函数，请发送电子邮件至 `clickhouse-feedback@yandex-team.com` [#9543](https://github.com/ClickHouse/ClickHouse/pull/9543) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在不再允许使用 `SELECT` 子查询作为默认表达式来创建列或新增列。[#9481](https://github.com/ClickHouse/ClickHouse/pull/9481) ([alesapin](https://github.com/alesapin))
* 要求 JOIN 中的子查询必须具有别名。[#9274](https://github.com/ClickHouse/ClickHouse/pull/9274) ([Artem Zuikov](https://github.com/4ertus2))
* 改进了 `ALTER MODIFY/ADD` 查询逻辑。现在，不能在未指定类型的情况下 `ADD` 列；`MODIFY` 默认表达式不会更改列类型，而 `MODIFY` 类型也不会丢失默认表达式的值。修复了 [#8669](https://github.com/ClickHouse/ClickHouse/issues/8669)。[#9227](https://github.com/ClickHouse/ClickHouse/pull/9227) ([alesapin](https://github.com/alesapin))
* 需要重启服务器才能使日志配置中的更改生效。这是一种临时规避方案，用于避免服务器将日志写入已删除的日志文件这一 bug (参见 [#8696](https://github.com/ClickHouse/ClickHouse/issues/8696)) 。[#8707](https://github.com/ClickHouse/ClickHouse/pull/8707) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 设置 `experimental_use_processors` 默认已启用。此设置会启用新的查询管道。这是一次内部重构，预计不会带来任何可见变化。如果您遇到任何问题，请将其重新设为 0。[#8768](https://github.com/ClickHouse/ClickHouse/pull/8768) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="new-feature">
  #### 新功能
</div>

* 新增 `Avro` 和 `AvroConfluent` 输入/输出格式 [#8571](https://github.com/ClickHouse/ClickHouse/pull/8571) ([Andrew Onyshchuk](https://github.com/oandrew)) [#8957](https://github.com/ClickHouse/ClickHouse/pull/8957) ([Andrew Onyshchuk](https://github.com/oandrew)) [#8717](https://github.com/ClickHouse/ClickHouse/pull/8717) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 支持以多线程、非阻塞方式更新 `cache` 字典中已过期的键 (可选择允许读取旧值) 。[#8303](https://github.com/ClickHouse/ClickHouse/pull/8303) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 新增查询 `ALTER ... MATERIALIZE TTL`。它会执行变更，强制删除因生存时间 (TTL) 过期的数据，并重新计算所有 parts 中与 TTL 相关的元信息。[#8775](https://github.com/ClickHouse/ClickHouse/pull/8775) ([Anton Popov](https://github.com/CurtizJ))
* 如有需要，可从 HashJoin 切换为 MergeJoin (在磁盘上) [#9082](https://github.com/ClickHouse/ClickHouse/pull/9082) ([Artem Zuikov](https://github.com/4ertus2))
* 在 `ALTER TABLE` 中新增了 `MOVE PARTITION` 命令 [#4729](https://github.com/ClickHouse/ClickHouse/issues/4729) [#6168](https://github.com/ClickHouse/ClickHouse/pull/6168) ([Guillaume Tassery](https://github.com/YiuRULE))
* 支持在运行时从配置文件重新加载存储配置。[#8594](https://github.com/ClickHouse/ClickHouse/pull/8594) ([Vladimir Chebotarev](https://github.com/excitoon))
* 允许将 `storage_policy` 更改为不低于原有级别的策略。[#8107](https://github.com/ClickHouse/ClickHouse/pull/8107) ([Vladimir Chebotarev](https://github.com/excitoon))
* 支持在 S3 存储和表函数中使用 globs/通配符。[#8851](https://github.com/ClickHouse/ClickHouse/pull/8851) ([Vladimir Chebotarev](https://github.com/excitoon))
* 为 `FixedString(N)` 数据类型新增 `bitAnd`、`bitOr`、`bitXor` 和 `bitNot`。[#9091](https://github.com/ClickHouse/ClickHouse/pull/9091) ([Guillaume Tassery](https://github.com/YiuRULE))
* 新增函数 `bitCount`。修复了 [#8702](https://github.com/ClickHouse/ClickHouse/issues/8702)。[#8708](https://github.com/ClickHouse/ClickHouse/pull/8708) ([alexey-milovidov](https://github.com/alexey-milovidov)) [#8749](https://github.com/ClickHouse/ClickHouse/pull/8749) ([ikopylov](https://github.com/ikopylov))
* 添加 `generateRandom` 表函数，用于按给定的 schema 生成随机行。可用于向任意测试表填充数据。[#8994](https://github.com/ClickHouse/ClickHouse/pull/8994) ([Ilya Yatsishin](https://github.com/qoega))
* `JSONEachRowFormat`：支持对象封装在顶层数组中的特殊情况。[#8860](https://github.com/ClickHouse/ClickHouse/pull/8860) ([Kruglov Pavel](https://github.com/Avogar))
* 现在可以创建带有 `DEFAULT` 表达式的列，并让该表达式依赖于带有默认 `ALIAS` 表达式的列。[#9489](https://github.com/ClickHouse/ClickHouse/pull/9489) ([alesapin](https://github.com/alesapin))
* 允许在 `clickhouse-obfuscator` 中将 `--limit` 指定为超过源数据大小的值。数据会以不同的随机种子重复生成。[#9155](https://github.com/ClickHouse/ClickHouse/pull/9155) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增 `groupArraySample` 函数 (类似于 `groupArray`) ，采用蓄水池抽样算法。[#8286](https://github.com/ClickHouse/ClickHouse/pull/8286) ([Amos Bird](https://github.com/amosbird))
* 现在，你可以通过系统指标监控 `cache`/`complex_key_cache` 字典中的更新队列大小。[#9413](https://github.com/ClickHouse/ClickHouse/pull/9413) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 将设置 `output_format_csv_crlf_end_of_line` 设为 1 时，允许在 CSV 输出 format 中使用 CRLF 作为行分隔符 [#8934](https://github.com/ClickHouse/ClickHouse/pull/8934) [#8935](https://github.com/ClickHouse/ClickHouse/pull/8935) [#8963](https://github.com/ClickHouse/ClickHouse/pull/8963) ([Mikhail Korotov](https://github.com/millb))
* 为 [H3](https://github.com/uber/h3) API 实现了更多函数：`h3GetBaseCell`、`h3HexAreaM2`、`h3IndexesAreNeighbors`、`h3ToChildren`、`h3ToString` 和 `stringToH3` [#8938](https://github.com/ClickHouse/ClickHouse/pull/8938) ([Nico Mandery](https://github.com/nmandery))
* 引入了新设置：`max_parser_depth`，用于控制最大栈深度，并支持大型复杂查询。这修复了 [#6681](https://github.com/ClickHouse/ClickHouse/issues/6681) 和 [#7668](https://github.com/ClickHouse/ClickHouse/issues/7668)。[#8647](https://github.com/ClickHouse/ClickHouse/pull/8647) ([Maxim Smirnov](https://github.com/qMBQx8GH))
* 新增设置 `force_optimize_skip_unused_shards`：如果无法跳过未使用的分片，则报错 [#8805](https://github.com/ClickHouse/ClickHouse/pull/8805) ([Azat Khuzhin](https://github.com/azat))
* 允许为 `Distributed` 引擎中待发送的数据配置多个存储磁盘/卷 [#8756](https://github.com/ClickHouse/ClickHouse/pull/8756) ([Azat Khuzhin](https://github.com/azat))
* 支持使用存储策略 (`<tmp_policy>`) 来存储临时数据。[#8750](https://github.com/ClickHouse/ClickHouse/pull/8750) ([Azat Khuzhin](https://github.com/azat))
* 新增了 `X-ClickHouse-Exception-Code` HTTP 请求头；如果在发送数据前抛出异常，则会设置该请求头。此功能实现了 [#4971](https://github.com/ClickHouse/ClickHouse/issues/4971)。[#8786](https://github.com/ClickHouse/ClickHouse/pull/8786) ([Mikhail Korotov](https://github.com/millb))
* 新增了函数 `ifNotFinite`。它只是一个语法糖：`ifNotFinite(x, y) = isFinite(x) ? x : y`。[#8710](https://github.com/ClickHouse/ClickHouse/pull/8710) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 `system.dictionaries` 表中新增了 `last_successful_update_time` 列 [#9394](https://github.com/ClickHouse/ClickHouse/pull/9394) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 新增 `blockSerializedSize` 函数 (磁盘上的大小，不进行压缩) [#8952](https://github.com/ClickHouse/ClickHouse/pull/8952) ([Azat Khuzhin](https://github.com/azat))
* 新增函数 `moduloOrZero` [#9358](https://github.com/ClickHouse/ClickHouse/pull/9358) ([hcz](https://github.com/hczhcz))
* 新增了系统表 `system.zeros` 和 `system.zeros_mt`，以及表函数 `zeros()` 和 `zeros_mt()`。这些表 (以及表函数) 都只包含一列，列名为 `zero`，类型为 `UInt8`。该列中的值均为 0。出于测试目的，需要用它以最快的方式生成大量行。此项修复解决了 [#6604](https://github.com/ClickHouse/ClickHouse/issues/6604) [#9593](https://github.com/ClickHouse/ClickHouse/pull/9593) ([Nikolai Kochetov](https://github.com/KochetovNicolai))

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 在 `MergeTree` 家族表中新增了 parts 的紧凑格式，所有列都存储在同一个文件中。这有助于提升小批量高频插入的性能。旧格式 (每列一个文件) 现称为 wide。数据存储格式由设置 `min_bytes_for_wide_part` 和 `min_rows_for_wide_part` 控制。 [#8290](https://github.com/ClickHouse/ClickHouse/pull/8290) ([Anton Popov](https://github.com/CurtizJ))
* `Log`、`TinyLog` 和 `StripeLog` 表现已支持 S3 存储。 [#8862](https://github.com/ClickHouse/ClickHouse/pull/8862) ([Pavel Kovalenko](https://github.com/Jokser))

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了日志消息中空白字符不一致的问题。[#9322](https://github.com/ClickHouse/ClickHouse/pull/9322) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了一个问题：在创建表时，未命名元组数组会被展平为 Nested 结构。[#8866](https://github.com/ClickHouse/ClickHouse/pull/8866) ([achulkov2](https://github.com/achulkov2))
* 修复了一个问题：当与 glob 模式匹配的文件过多时，在 `File` 表引擎或 `file` 表函数中可能会出现“打开的文件过多”错误。现在，文件只会在实际需要时才打开。此修复对应 [#8857](https://github.com/ClickHouse/ClickHouse/issues/8857) [#8861](https://github.com/ClickHouse/ClickHouse/pull/8861) ([alexey-milovidov](https://github.com/alexey-milovidov))
* DROP TEMPORARY TABLE 现在仅删除临时表。[#8907](https://github.com/ClickHouse/ClickHouse/pull/8907) ([Vitaly Baranov](https://github.com/vitlibar))
* 在关闭服务器或对表执行 DETACH/ATTACH 操作时，会移除过期分区。[#8602](https://github.com/ClickHouse/ClickHouse/pull/8602) ([Guillaume Tassery](https://github.com/YiuRULE))
* 关于默认磁盘如何根据 `data` 子目录计算剩余空间。修复了这样一个问题：如果 `data` 目录挂载到单独的设备上 (较少见的情况) ，剩余空间可能无法被正确计算。此修复解决了 [#7441](https://github.com/ClickHouse/ClickHouse/issues/7441) [#9257](https://github.com/ClickHouse/ClickHouse/pull/9257) ([Mikhail Korotov](https://github.com/millb))
* 允许在逗号 (cross) join 内部使用 IN ()。[#9251](https://github.com/ClickHouse/ClickHouse/pull/9251) ([Artem Zuikov](https://github.com/4ertus2))
* 如果 WHERE 子句中有 \[NOT] LIKE 运算符，则允许将 CROSS 改写为 INNER JOIN。[#9229](https://github.com/ClickHouse/ClickHouse/pull/9229) ([Artem Zuikov](https://github.com/4ertus2))
* 修复启用设置 `distributed_aggregation_memory_efficient` 时，`GROUP BY` 后可能导致结果不正确的问题。修复了 [#9134](https://github.com/ClickHouse/ClickHouse/issues/9134)。[#9289](https://github.com/ClickHouse/ClickHouse/pull/9289) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 在缓存字典的指标统计中，命中的键被计为了未命中。[#9411](https://github.com/ClickHouse/ClickHouse/pull/9411) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 修复了 [#8598](https://github.com/ClickHouse/ClickHouse/issues/8598) 中引入的复制协议不兼容问题。[#9412](https://github.com/ClickHouse/ClickHouse/pull/9412) ([alesapin](https://github.com/alesapin))
* 修复了 `ReplicatedMergeTree` 表启动时 `queue_task_handle` 中的竞态条件。[#9552](https://github.com/ClickHouse/ClickHouse/pull/9552) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 关键字 `NOT` 在 `SHOW TABLES NOT LIKE` 查询中无法使用 [#8727](https://github.com/ClickHouse/ClickHouse/issues/8727) [#8940](https://github.com/ClickHouse/ClickHouse/pull/8940) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为函数 `h3EdgeLengthM` 增加了范围检查。若无此检查，可能会发生缓冲区溢出。[#8945](https://github.com/ClickHouse/ClickHouse/pull/8945) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了一个 bug：对多个参数 (超过 10 个) 进行三元逻辑运算的分批计算时会出错。[#8718](https://github.com/ClickHouse/ClickHouse/pull/8718) ([Alexander Kazakov](https://github.com/Akazz))
* 修复了 PREWHERE 优化中的一个错误，该错误可能导致段错误，或抛出 `Inconsistent number of columns got from MergeTreeRangeReader` 异常。[#9024](https://github.com/ClickHouse/ClickHouse/pull/9024) ([Anton Popov](https://github.com/CurtizJ))
* 修复了意外的 `Timeout exceeded while reading from socket` 异常：该异常会在安全连接上随机发生，即使实际上尚未超时，并且只会在启用查询分析器时出现。同时新增了 `connect_timeout_with_failover_secure_ms` 设置 (默认 100ms) ，其作用类似于 `connect_timeout_with_failover_ms`，但用于安全连接 (因为 SSL 握手比普通 TCP connection 更慢) [#9026](https://github.com/ClickHouse/ClickHouse/pull/9026) ([tavplubix](https://github.com/tavplubix))
* 修复了变更完成过程中的一个错误，该错误可能导致变更卡在 `parts_to_do=0` 且 `is_done=0` 的状态。 [#9022](https://github.com/ClickHouse/ClickHouse/pull/9022) ([alesapin](https://github.com/alesapin))
* 使用支持 `partial_merge_join` 设置的新 ANY JOIN 逻辑。现在可通过 `partial_merge_join=1` 执行 `ANY|ALL|SEMI LEFT` 和 `ALL INNER` JOIN。[#8932](https://github.com/ClickHouse/ClickHouse/pull/8932) ([Artem Zuikov](https://github.com/4ertus2))
* 分片现在会将从发起节点获取的设置限定在该分片的约束范围内，而不是抛出异常。此修复允许将查询发送到具有不同约束的分片。[#9447](https://github.com/ClickHouse/ClickHouse/pull/9447) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复了 `MergeTreeReadPool` 的内存管理问题。[#8791](https://github.com/ClickHouse/ClickHouse/pull/8791) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复 `toDecimal*OrNull()` 函数家族在传入字符串 `e` 时的问题。修复 [#8312](https://github.com/ClickHouse/ClickHouse/issues/8312) [#8764](https://github.com/ClickHouse/ClickHouse/pull/8764) ([Artem Zuikov](https://github.com/4ertus2))
* 确保 `FORMAT Null` 不向客户端发送任何数据。[#8767](https://github.com/ClickHouse/ClickHouse/pull/8767) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 修复了 `LiveViewBlockInputStream` 中 timestamp 未更新的问题。`LIVE VIEW` 是一项 Experimental 功能。[#8644](https://github.com/ClickHouse/ClickHouse/pull/8644) ([vxider](https://github.com/Vxider)) [#8625](https://github.com/ClickHouse/ClickHouse/pull/8625) ([vxider](https://github.com/Vxider))
* 修复了 `ALTER MODIFY TTL` 的错误行为，此前该行为不允许删除旧的生存时间 (TTL) 表达式。[#8422](https://github.com/ClickHouse/ClickHouse/pull/8422) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了 MergeTreeIndexSet 中 UBSan 报告的问题。此修复解决了 [#9250](https://github.com/ClickHouse/ClickHouse/issues/9250) [#9365](https://github.com/ClickHouse/ClickHouse/pull/9365) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了当 haystack 包含零字节时，`match` 和 `extract` 函数的行为问题。此前在 haystack 为常量时，该行为是错误的。此修复涉及 [#9160](https://github.com/ClickHouse/ClickHouse/issues/9160) [#9163](https://github.com/ClickHouse/ClickHouse/pull/9163) ([alexey-milovidov](https://github.com/alexey-milovidov)) [#9345](https://github.com/ClickHouse/ClickHouse/pull/9345) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 避免在 Apache Avro 第三方库的析构函数中抛出异常。[#9066](https://github.com/ClickHouse/ClickHouse/pull/9066) ([Andrew Onyshchuk](https://github.com/oandrew))
* 不要只提交从 `Kafka` 轮询到的部分批次，否则可能会导致数据出现空洞。[#8876](https://github.com/ClickHouse/ClickHouse/pull/8876) ([filimonov](https://github.com/filimonov))
* 修复了 `joinGet` 在 Nullable 返回类型上的问题。[#8919](https://github.com/ClickHouse/ClickHouse/issues/8919) [#9014](https://github.com/ClickHouse/ClickHouse/pull/9014) ([Amos Bird](https://github.com/amosbird))
* 修复使用 `T64` 编解码器压缩时的数据不兼容问题。[#9016](https://github.com/ClickHouse/ClickHouse/pull/9016) ([Artem Zuikov](https://github.com/4ertus2)) 修复 `T64` 压缩编解码器中的数据类型 ID 问题，该问题会在受影响版本中导致错误的压缩/解压缩。[#9033](https://github.com/ClickHouse/ClickHouse/pull/9033) ([Artem Zuikov](https://github.com/4ertus2))
* 新增设置 `enable_early_constant_folding`，并在某些会导致错误的情况下禁用该设置。[#9010](https://github.com/ClickHouse/ClickHouse/pull/9010) ([Artem Zuikov](https://github.com/4ertus2))
* 修复 VIEW 下推谓词优化器的问题，并启用相关测试 [#9011](https://github.com/ClickHouse/ClickHouse/pull/9011) ([Winter Zhang](https://github.com/zhang2014))
* 修复从 `File` 存储读取时 `Merge` 表可能发生的段错误 [#9387](https://github.com/ClickHouse/ClickHouse/pull/9387) ([tavplubix](https://github.com/tavplubix))
* 在 `ATTACH PARTITION FROM`、`REPLACE PARTITION` 和 `MOVE TO TABLE` 中新增了对存储策略的检查。否则，重启后可能会导致分片中的数据无法访问，并使 ClickHouse 无法启动。[#9383](https://github.com/ClickHouse/ClickHouse/pull/9383) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复为表设置生存时间 (TTL) 时 ALTER 操作的问题。[#8800](https://github.com/ClickHouse/ClickHouse/pull/8800) ([Anton Popov](https://github.com/CurtizJ))
* 修复了一个竞态条件：当某个字典正在被修改、添加或删除时执行 `SYSTEM RELOAD ALL DICTIONARIES`，可能会触发该问题。[#8801](https://github.com/ClickHouse/ClickHouse/pull/8801) ([Vitaly Baranov](https://github.com/vitlibar))
* 在较早版本中，`Memory` database engine 使用空的数据路径，因此表会创建在 `path` 目录 (例如 `/var/lib/clickhouse/`) 下，而不是数据库的数据目录 (例如 `/var/lib/clickhouse/db_name`) 下。[#8753](https://github.com/ClickHouse/ClickHouse/pull/8753) ([tavplubix](https://github.com/tavplubix))
* 修复了关于默认磁盘或策略缺失的不正确日志消息。[#9530](https://github.com/ClickHouse/ClickHouse/pull/9530) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复数组类型 bloom\_filter 索引中 not(has()) 的问题。 [#9407](https://github.com/ClickHouse/ClickHouse/pull/9407) ([achimbab](https://github.com/achimbab))
* 允许 `Log` 引擎表中的前几列为别名 [#9231](https://github.com/ClickHouse/ClickHouse/pull/9231) ([Ivan](https://github.com/abyss7))
* 修复了单线程从 `MergeTree` 表读取时范围顺序错乱的问题。这可能导致 `MergeTreeRangeReader` 抛出异常或查询结果错误。[#9050](https://github.com/ClickHouse/ClickHouse/pull/9050) ([Anton Popov](https://github.com/CurtizJ))
* 让 `reinterpretAsFixedString` 返回 `FixedString`，而不是 `String`。[#9052](https://github.com/ClickHouse/ClickHouse/pull/9052) ([Andrew Onyshchuk](https://github.com/oandrew))
* 避免极少数情况下用户收到错误的错误消息 (显示为 `Success`，而不是详细的错误描述) 。[#9457](https://github.com/ClickHouse/ClickHouse/pull/9457) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 使用空的行模板时，`Template` 格式不再崩溃。[#8785](https://github.com/ClickHouse/ClickHouse/pull/8785) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 系统表的元数据文件可能会被创建到错误的位置 [#8653](https://github.com/ClickHouse/ClickHouse/pull/8653) ([tavplubix](https://github.com/tavplubix))。修复了 [#8581](https://github.com/ClickHouse/ClickHouse/issues/8581)。
* 修复 cache 字典中 exception\_ptr 的数据竞争问题 [#8303](https://github.com/ClickHouse/ClickHouse/issues/8303)。[#9379](https://github.com/ClickHouse/ClickHouse/pull/9379) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 对于查询 `ATTACH TABLE IF NOT EXISTS`，不再抛出异常。此前即使已存在 `IF NOT EXISTS` 子句，如果表已存在，仍然会抛出异常。[#8967](https://github.com/ClickHouse/ClickHouse/pull/8967) ([Anton Popov](https://github.com/CurtizJ))
* 修复了异常消息中缺失的闭括号。 [#8811](https://github.com/ClickHouse/ClickHouse/pull/8811) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 避免在交互模式下启动 clickhouse-client 时出现 `Possible deadlock avoided` 提示。[#9455](https://github.com/ClickHouse/ClickHouse/pull/9455) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 base64 编码值末尾填充可能出现格式错误的问题。更新了 base64 库。此修复解决了 [#9491](https://github.com/ClickHouse/ClickHouse/issues/9491)，关闭了 [#9492](https://github.com/ClickHouse/ClickHouse/issues/9492) [#9500](https://github.com/ClickHouse/ClickHouse/pull/9500) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 防止在极少数情况下，读取 `Kafka` 中的后缀后、提交前发生异常而导致数据丢失。修复了 [#9378](https://github.com/ClickHouse/ClickHouse/issues/9378) [#9507](https://github.com/ClickHouse/ClickHouse/pull/9507) ([filimonov](https://github.com/filimonov))
* 修复 `DROP TABLE IF EXISTS` 中的异常 [#8663](https://github.com/ClickHouse/ClickHouse/pull/8663) ([Nikita Vasilev](https://github.com/nikvas0))
* 修复了用户对旧格式的 `MergeTree` 表引擎家族执行 `ALTER MODIFY SETTING` 时的崩溃问题。[#9435](https://github.com/ClickHouse/ClickHouse/pull/9435) ([alesapin](https://github.com/alesapin))
* 在与 JSON 相关的函数中支持超出 Int64 范围的 UInt64 数值。将 SIMDJSON 更新到 master。这修复了 [#9209](https://github.com/ClickHouse/ClickHouse/issues/9209) [#9344](https://github.com/ClickHouse/ClickHouse/pull/9344) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了在使用非严格单调函数索引时反向谓词执行不正确的问题。[#9223](https://github.com/ClickHouse/ClickHouse/pull/9223) ([Alexander Kazakov](https://github.com/Akazz))
* 不要在 `GROUP BY` 中尝试折叠 `IN` 常量 [#8868](https://github.com/ClickHouse/ClickHouse/pull/8868) ([Amos Bird](https://github.com/amosbird))
* 修复了 `ALTER DELETE` 变更中的一个问题，该问题会导致索引损坏。此修复解决了 [#9019](https://github.com/ClickHouse/ClickHouse/issues/9019) 和 [#8982](https://github.com/ClickHouse/ClickHouse/issues/8982)。此外，还修复了 `ReplicatedMergeTree` `ALTER` 查询中极为罕见的竞态条件。[#9048](https://github.com/ClickHouse/ClickHouse/pull/9048) ([alesapin](https://github.com/alesapin))
* 启用 `compile_expressions` 设置后，使用 `Nullable` 类型时，`LLVMExecutableFunction` 中可能出现 `unexpected column` [#8910](https://github.com/ClickHouse/ClickHouse/pull/8910) ([Guillaume Tassery](https://github.com/YiuRULE))
* 针对 `Kafka` 引擎的多项修复：1) 修复了消费者组再平衡期间出现重复数据的问题。2) 修复了罕见的 '孔' 问题：当一次 poll 从多个分区拉取数据且只部分提交时会出现该问题 (现在我们始终处理 / 提交整个已拉取的消息块) 。3) 修复了按块大小 flush 的问题 (此前只有按超时 flush 能够正常工作) 。4) 改进了订阅流程 (带有分配反馈) 。5) 让测试在默认时间间隔和超时设置下运行得更快。由于此前数据不会按块大小 flush (根据文档说明本应如此) ，该 PR 可能会导致默认设置下出现一定的性能下降 (因为 flush 会更频繁 & 块更小，因而效率较低) 。如果你在此次更改后遇到性能问题，请将表中的 `kafka_max_block_size` 调大 (例如 `CREATE TABLE ...Engine=Kafka ... SETTINGS ... kafka_max_block_size=524288`) 。修复 [#7259](https://github.com/ClickHouse/ClickHouse/issues/7259) [#8917](https://github.com/ClickHouse/ClickHouse/pull/8917) ([filimonov](https://github.com/filimonov))
* 修复在 PREWHERE 优化后，某些查询中出现的 `Parameter out of bound` 异常。[#8914](https://github.com/ClickHouse/ClickHouse/pull/8914) ([Baudouin Giard](https://github.com/bgiard))
* 修复了函数 `arrayZip` 的参数同时包含常量和非常量时的问题。[#8705](https://github.com/ClickHouse/ClickHouse/pull/8705) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 执行 `CREATE` 查询时，会对存储引擎参数中的常量表达式进行常量折叠。将空的数据库名替换为当前数据库。修复了 [#6508](https://github.com/ClickHouse/ClickHouse/issues/6508)、[#3492](https://github.com/ClickHouse/ClickHouse/issues/3492) [#9262](https://github.com/ClickHouse/ClickHouse/pull/9262) ([tavplubix](https://github.com/tavplubix))
* 现在不再支持创建或添加带有简单循环别名的列，例如 `a DEFAULT b, b DEFAULT a`。[#9603](https://github.com/ClickHouse/ClickHouse/pull/9603) ([alesapin](https://github.com/alesapin))
* 修复了一个与重复移动操作有关的 bug，该 bug 可能会损坏原始数据分片。如果您使用 `ALTER TABLE MOVE`，则此问题与您相关 [#8680](https://github.com/ClickHouse/ClickHouse/pull/8680) ([Vladimir Chebotarev](https://github.com/excitoon))
* 允许 `interval` 标识符在不使用反引号的情况下也能被正确解析。修复了一个问题：即使将 `interval` 标识符用反引号或双引号括起来，查询仍无法执行。此修复解决了 [#9124](https://github.com/ClickHouse/ClickHouse/issues/9124)。[#9142](https://github.com/ClickHouse/ClickHouse/pull/9142) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了模糊测试问题以及 `bitTestAll`/`bitTestAny` 函数行为不正确的问题。[#9143](https://github.com/ClickHouse/ClickHouse/pull/9143) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复在与第 n 行相等的行过多时，`LIMIT n WITH TIES` 可能导致崩溃或返回错误行数的问题。[#9464](https://github.com/ClickHouse/ClickHouse/pull/9464) ([tavplubix](https://github.com/tavplubix))
* 修复了对在启用 `insert_quorum` 时写入的 parts 执行变更时出现的问题。[#9463](https://github.com/ClickHouse/ClickHouse/pull/9463) ([alesapin](https://github.com/alesapin))
* 修复了销毁 `Poco::HTTPServer` 时发生的数据竞争问题。该问题可能出现在服务器启动后立即关闭的情况下。[#9468](https://github.com/ClickHouse/ClickHouse/pull/9468) ([Anton Popov](https://github.com/CurtizJ))
* 修复了一个 bug：运行 `SHOW CREATE TABLE a_table_that_does_not_exist` 时会显示误导性的错误消息。[#8899](https://github.com/ClickHouse/ClickHouse/pull/8899) ([achulkov2](https://github.com/achulkov2))
* 修复了一个少见场景下的 `Parameters are out of bound` 异常：当 `SELECT` 子句中包含常量，且同时带有 `ORDER BY` 和 `LIMIT` 子句时会出现该异常。[#8892](https://github.com/ClickHouse/ClickHouse/pull/8892) ([Guillaume Tassery](https://github.com/YiuRULE))
* 修复变更完成状态的处理问题：变更已完成时，其状态仍可能显示为 `is_done=0`。[#9217](https://github.com/ClickHouse/ClickHouse/pull/9217) ([alesapin](https://github.com/alesapin))
* 禁止对使用旧语法的 MergeTree 表执行 `ALTER ADD INDEX`，因为该语法不起作用。[#8822](https://github.com/ClickHouse/ClickHouse/pull/8822) ([Mikhail Korotov](https://github.com/millb))
* 在服务器启动期间，不访问 `LIVE VIEW` 所依赖的表，以便服务器能够顺利启动。同时，在分离 `LIVE VIEW` 时，也会移除 `LIVE VIEW` 的依赖关系。`LIVE VIEW` 是一项 Experimental 功能。[#8824](https://github.com/ClickHouse/ClickHouse/pull/8824) ([tavplubix](https://github.com/tavplubix))
* 修复执行 `PREWHERE` 时 `MergeTreeRangeReader` 中可能发生的段错误。[#9106](https://github.com/ClickHouse/ClickHouse/pull/9106) ([Anton Popov](https://github.com/CurtizJ))
* 修复了列生存时间 (TTL) 可能导致的校验和不匹配问题。[#9451](https://github.com/ClickHouse/ClickHouse/pull/9451) ([Anton Popov](https://github.com/CurtizJ))
* 修复了一个 bug：当只有一个卷时，parts 不会在后台根据生存时间 (TTL) 规则移动。[#8672](https://github.com/ClickHouse/ClickHouse/pull/8672) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了 `Method createColumn() is not implemented for data type Set` 问题。此修复解决了 [#7799](https://github.com/ClickHouse/ClickHouse/issues/7799)。[#8674](https://github.com/ClickHouse/ClickHouse/pull/8674) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在我们将尝试更频繁地完成变更操作。[#9427](https://github.com/ClickHouse/ClickHouse/pull/9427) ([alesapin](https://github.com/alesapin))
* 修复 `intDiv` 在除数为常量 -1 时的问题 [#9351](https://github.com/ClickHouse/ClickHouse/pull/9351) ([hcz](https://github.com/hczhcz))
* 修复了 `BlockIO` 中可能发生的竞态条件。[#9356](https://github.com/ClickHouse/ClickHouse/pull/9356) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了在尝试使用/删除因参数错误而创建的 `Kafka` 表时导致服务器崩溃的问题。 [#9513](https://github.com/ClickHouse/ClickHouse/pull/9513) ([filimonov](https://github.com/filimonov))
* 如果操作系统对 `timer_create` 函数返回错误结果，则增加了相应的变通处理方案。[#8837](https://github.com/ClickHouse/ClickHouse/pull/8837) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 `min_marks_for_seek` 参数使用中的错误。修复了在 Distributed 表中没有分片键时，尝试跳过未使用分片所显示的错误消息。[#8908](https://github.com/ClickHouse/ClickHouse/pull/8908) ([Azat Khuzhin](https://github.com/azat))

<div id="improvement">
  #### 改进
</div>

* 在 `ReplicatedMergeTree*` 引擎家族中，基于变更机制实现了 `ALTER MODIFY/DROP` 查询。现在，`ALTER` 操作仅会在元数据更新阶段发生阻塞，之后不再阻塞。[#8701](https://github.com/ClickHouse/ClickHouse/pull/8701) ([alesapin](https://github.com/alesapin))
* 新增了将 `WHERE` 子句中包含未限定名称的 CROSS 重写为 INNER JOIN 的功能。[#9512](https://github.com/ClickHouse/ClickHouse/pull/9512) ([Artem Zuikov](https://github.com/4ertus2))
* 让 `SHOW TABLES` 和 `SHOW DATABASES` 查询支持 `WHERE` 表达式以及 `FROM`/`IN` [#9076](https://github.com/ClickHouse/ClickHouse/pull/9076) ([sundyli](https://github.com/sundy-li))
* 新增设置 `deduplicate_blocks_in_dependent_materialized_views`。[#9070](https://github.com/ClickHouse/ClickHouse/pull/9070) ([urykhy](https://github.com/urykhy))
* 在最近的更改后，MySQL 客户端开始以十六进制形式打印二进制字符串，因而变得不可读 ([#9032](https://github.com/ClickHouse/ClickHouse/issues/9032)) 。ClickHouse 中的变通方法是将字符串列标记为 UTF-8；虽然并非总是如此，但通常情况下确实如此。[#9079](https://github.com/ClickHouse/ClickHouse/pull/9079) ([Yuriy Baranov](https://github.com/yurriy))
* 为 `sumMap` 增加对 String 和 FixedString 类型键的支持 [#8903](https://github.com/ClickHouse/ClickHouse/pull/8903) ([Baudouin Giard](https://github.com/bgiard))
* 支持 SummingMergeTree Map 类型中的字符串键 [#8933](https://github.com/ClickHouse/ClickHouse/pull/8933) ([Baudouin Giard](https://github.com/bgiard))
* 即使线程抛出了异常，也会向线程池发出线程终止信号 [#8736](https://github.com/ClickHouse/ClickHouse/pull/8736) ([Ding Xiang Fei](https://github.com/dingxiangfei2009))
* 支持在 `clickhouse-benchmark` 中设置 `query_id` [#9416](https://github.com/ClickHouse/ClickHouse/pull/9416) ([Anton Popov](https://github.com/CurtizJ))
* 禁止在 `ALTER TABLE ... PARTITION partition` 查询中使用异常表达式。此项修复解决了 [#7192](https://github.com/ClickHouse/ClickHouse/issues/7192) [#8835](https://github.com/ClickHouse/ClickHouse/pull/8835) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在，表 `system.table_engines` 会提供有关特性支持的信息 (例如 `supports_ttl` 或 `supports_sort_order`) 。[#8830](https://github.com/ClickHouse/ClickHouse/pull/8830) ([Max Akhmedov](https://github.com/zlobober))
* 默认启用 `system.metric_log`。该表将包含按 "collect\_interval\_milliseconds" 间隔 (默认为 1 秒) 采集的 ProfileEvents 和 CurrentMetrics 值所在的行。该表非常小 (通常只有数 MB) ，因此默认收集这些数据是合理的。[#9225](https://github.com/ClickHouse/ClickHouse/pull/9225) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为组中的所有线程初始化查询分析器，从而能够对 insert 查询进行完整分析。修复了 [#6964](https://github.com/ClickHouse/ClickHouse/issues/6964) [#8874](https://github.com/ClickHouse/ClickHouse/pull/8874) ([Ivan](https://github.com/abyss7))
* 现在，临时 `LIVE VIEW` 改为通过 `CREATE LIVE VIEW name WITH TIMEOUT [42] ...` 创建，而不是 `CREATE TEMPORARY LIVE VIEW ...`，因为之前的语法与 `CREATE TEMPORARY TABLE ...` 不一致 [#9131](https://github.com/ClickHouse/ClickHouse/pull/9131) ([tavplubix](https://github.com/tavplubix))
* 添加 `text&#95;log.level` 配置参数，用于限制写入 `system.text_log` 表的条目 [#8809](https://github.com/ClickHouse/ClickHouse/pull/8809) ([Azat Khuzhin](https://github.com/azat))
* 允许根据生存时间 (TTL) 规则将下载的分片放到磁盘/卷上 [#8598](https://github.com/ClickHouse/ClickHouse/pull/8598) ([Vladimir Chebotarev](https://github.com/excitoon))
* 对于外部 MySQL 字典，允许将 MySQL 连接池设为共享，以便在多个字典之间共用。此选项可显著减少与 MySQL 服务器建立的连接数量。[#9409](https://github.com/ClickHouse/ClickHouse/pull/9409) ([Clément Rodriguez](https://github.com/clemrodriguez))
* 在 `clickhouse-benchmark` 的输出中，对分位数显示最接近的查询执行时间，而不是插值结果。最好显示与某些查询执行时间对应的值。[#8712](https://github.com/ClickHouse/ClickHouse/pull/8712) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 支持在向 Kafka 插入数据时，为消息添加 key 和 timestamp。修复了 [#7198](https://github.com/ClickHouse/ClickHouse/issues/7198) [#8969](https://github.com/ClickHouse/ClickHouse/pull/8969) ([filimonov](https://github.com/filimonov))
* 如果服务器在终端中运行，则用颜色高亮显示线程编号、查询 ID 和日志级别。这有助于提高开发者阅读关联日志消息时的可读性。[#8961](https://github.com/ClickHouse/ClickHouse/pull/8961) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在为 `Ordinary` 数据库加载表时，异常消息更加清晰。[#9527](https://github.com/ClickHouse/ClickHouse/pull/9527) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为包含聚合函数状态的数组实现 `arraySlice`。此项修复解决了 [#9388](https://github.com/ClickHouse/ClickHouse/issues/9388) [#9391](https://github.com/ClickHouse/ClickHouse/pull/9391) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 允许在 IN 运算符右侧使用常量函数和常量数组。[#8813](https://github.com/ClickHouse/ClickHouse/pull/8813) ([Anton Popov](https://github.com/CurtizJ))
* 如果在为 system.replicas 拉取数据时发生 ZooKeeper 异常，则在单独的一列中显示该异常。此实现见 [#9137](https://github.com/ClickHouse/ClickHouse/issues/9137) [#9138](https://github.com/ClickHouse/ClickHouse/pull/9138) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在销毁时以原子方式删除 MergeTree 数据分区片段。[#8402](https://github.com/ClickHouse/ClickHouse/pull/8402) ([Vladimir Chebotarev](https://github.com/excitoon))
* 支持分布式表的行级安全性。 [#8926](https://github.com/ClickHouse/ClickHouse/pull/8926) ([Ivan](https://github.com/abyss7))
* 现在可以在设置值中识别后缀 (如 KB、KiB 等) 。[#8072](https://github.com/ClickHouse/ClickHouse/pull/8072) ([Mikhail Korotov](https://github.com/millb))
* 防止在构建大型 JOIN 结果时发生内存不足。[#8637](https://github.com/ClickHouse/ClickHouse/pull/8637) ([Artem Zuikov](https://github.com/4ertus2))
* 在 `clickhouse-client` 的交互模式下，补全建议中新增了集群名称。[#8709](https://github.com/ClickHouse/ClickHouse/pull/8709) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为组中的所有线程初始化 query profiler，例如可对插入查询进行完整分析 [#8820](https://github.com/ClickHouse/ClickHouse/pull/8820) ([Ivan](https://github.com/abyss7))
* 在 `system.query_log` 表中新增了列 `exception_code`。[#8770](https://github.com/ClickHouse/ClickHouse/pull/8770) ([Mikhail Korotov](https://github.com/millb))
* 在默认服务器配置文件中启用了端口 `9004` 上的 MySQL 兼容服务器。修复了配置中示例里的密码生成命令。[#8771](https://github.com/ClickHouse/ClickHouse/pull/8771) ([Yuriy Baranov](https://github.com/yurriy))
* 防止在关闭时因文件系统处于只读状态而中止。这修复了 [#9094](https://github.com/ClickHouse/ClickHouse/issues/9094) [#9100](https://github.com/ClickHouse/ClickHouse/pull/9100) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 当 HTTP POST 查询需要指定长度时，异常消息会更加清晰。 [#9453](https://github.com/ClickHouse/ClickHouse/pull/9453) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 `HDFS` 和 `File` 引擎，以及 `hdfs` 和 `file` 表函数新增 `_path` 和 `_file` 虚拟列 [#8489](https://github.com/ClickHouse/ClickHouse/pull/8489) ([Olga Khvostikova](https://github.com/stavrolia))
* 修复了向 `MATERIALIZED VIEW` 插入时出现的 `Cannot find column` 错误；该错误会在向视图的内部表新增列时发生。[#8766](https://github.com/ClickHouse/ClickHouse/pull/8766) [#8788](https://github.com/ClickHouse/ClickHouse/pull/8788) ([vzakaznikov](https://github.com/vzakaznikov)) [#8788](https://github.com/ClickHouse/ClickHouse/issues/8788) [#8806](https://github.com/ClickHouse/ClickHouse/pull/8806) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) [#8803](https://github.com/ClickHouse/ClickHouse/pull/8803) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了原生客户端-服务器协议中的进度问题：在最终更新后发送进度信息 (类似日志) 。这可能只会影响某些使用原生协议的第三方工具。[#9495](https://github.com/ClickHouse/ClickHouse/pull/9495) ([Azat Khuzhin](https://github.com/azat))
* 新增一个系统指标，用于跟踪通过 MySQL 协议连接的客户端数量 ([#9013](https://github.com/ClickHouse/ClickHouse/issues/9013)) 。[#9015](https://github.com/ClickHouse/ClickHouse/pull/9015) ([Eugene Klimov](https://github.com/Slach))
* 从现在起，HTTP 响应中的 `X-ClickHouse-Timezone` 请求头将被设置为与 `SELECT timezone()` 返回的时区值相同。[#9493](https://github.com/ClickHouse/ClickHouse/pull/9493) ([Denis Glazachev](https://github.com/traceon))

<div id="performance-improvement">
  #### 性能改进
</div>

* 提升了使用 IN 分析索引的性能 [#9261](https://github.com/ClickHouse/ClickHouse/pull/9261) ([Anton Popov](https://github.com/CurtizJ))
* 简化了 Logical Functions 中的代码并提高了效率，同时完成了一些代码清理。这是 [#8718](https://github.com/ClickHouse/ClickHouse/issues/8718) 的后续工作 [#8728](https://github.com/ClickHouse/ClickHouse/pull/8728) ([Alexander Kazakov](https://github.com/Akazz))
* 通过借助 C++20 特性进一步强化严格别名规则，整体性能得到提升 (受影响查询的提升幅度为 5%..200%) 。 [#9304](https://github.com/ClickHouse/ClickHouse/pull/9304) ([Amos Bird](https://github.com/amosbird))
* 对比较函数内部循环进一步强化了严格别名规则。 [#9327](https://github.com/ClickHouse/ClickHouse/pull/9327) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 对算术函数内部循环进一步强化了严格别名规则。 [#9325](https://github.com/ClickHouse/ClickHouse/pull/9325) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 ColumnVector::replicate() 提供了一个快约 3 倍的实现，ColumnConst::convertToFullColumn() 就是通过它实现的。此外，在测试中对常量进行 materialize 时也会很有帮助。 [#9293](https://github.com/ClickHouse/ClickHouse/pull/9293) ([Alexander Kazakov](https://github.com/Akazz))
* 对 `ColumnVector::replicate()` 做了另一项小幅性能优化 (可加速 `materialize` 函数和高阶函数) ，这是对 [#9293](https://github.com/ClickHouse/ClickHouse/issues/9293) 的进一步改进 [#9442](https://github.com/ClickHouse/ClickHouse/pull/9442) ([Alexander Kazakov](https://github.com/Akazz))
* 提升了 `stochasticLinearRegression` aggregate function 的性能。该补丁由 Intel 贡献。 [#8652](https://github.com/ClickHouse/ClickHouse/pull/8652) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 提升了 `reinterpretAsFixedString` 函数的性能。 [#9342](https://github.com/ClickHouse/ClickHouse/pull/9342) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在处理器管道中，对于 `Null` format 不再向客户端发送块。 [#8797](https://github.com/ClickHouse/ClickHouse/pull/8797) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) [#8767](https://github.com/ClickHouse/ClickHouse/pull/8767) ([Alexander Kuzmenkov](https://github.com/akuzm))

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 现在，Windows Subsystem for Linux 上的异常处理已可正常工作。参见 [https://github.com/ClickHouse-Extras/libunwind/pull/3。这修复了](https://github.com/ClickHouse-Extras/libunwind/pull/3。这修复了) [#6480](https://github.com/ClickHouse/ClickHouse/issues/6480) [#9564](https://github.com/ClickHouse/ClickHouse/pull/9564) ([sobolevsv](https://github.com/sobolevsv))
* 在 `clickhouse-client` 中，将用于交互式行编辑的 `readline` 替换为 `replxx` [#8416](https://github.com/ClickHouse/ClickHouse/pull/8416) ([Ivan](https://github.com/abyss7))
* 改进了 FunctionsComparison 的构建时间，并减少了模板实例化的次数。[#9324](https://github.com/ClickHouse/ClickHouse/pull/9324) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 CI 中集成了 `clang-tidy`。另请参见 [#6044](https://github.com/ClickHouse/ClickHouse/issues/6044) [#9566](https://github.com/ClickHouse/ClickHouse/pull/9566) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在在 CI 中，即使使用 `gcc`，我们也会用 `lld` 来链接 ClickHouse。[#9049](https://github.com/ClickHouse/ClickHouse/pull/9049) ([alesapin](https://github.com/alesapin))
* 设置 `THREAD_FUZZER_*` 环境变量时，可将线程调度随机化并注入故障，以便于测试。[#9459](https://github.com/ClickHouse/ClickHouse/pull/9459) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在无状态测试中启用安全套接字 [#9288](https://github.com/ClickHouse/ClickHouse/pull/9288) ([tavplubix](https://github.com/tavplubix))
* 提高 SPLIT\_SHARED\_LIBRARIES=OFF 的稳健性 [#9156](https://github.com/ClickHouse/ClickHouse/pull/9156) ([Azat Khuzhin](https://github.com/azat))
* 提高 "performance\_introspection\_and\_logging" 测试在服务器随机卡住情况下的可靠性。这种情况可能发生在 CI 环境中。另见 [#9515](https://github.com/ClickHouse/ClickHouse/issues/9515) [#9528](https://github.com/ClickHouse/ClickHouse/pull/9528) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在样式检查中校验 XML。[#9550](https://github.com/ClickHouse/ClickHouse/pull/9550) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了测试 `00738_lock_for_inner_table` 中的竞态条件。该测试依赖于 sleep。[#9555](https://github.com/ClickHouse/ClickHouse/pull/9555) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 删除 `once` 类型的性能测试。这样就能以统计比较模式运行所有性能测试 (结果更可靠) 。[#9557](https://github.com/ClickHouse/ClickHouse/pull/9557) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了算术函数的性能测试。[#9326](https://github.com/ClickHouse/ClickHouse/pull/9326) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 `sumMap` 和 `sumMapWithOverflow` 聚合函数新增了性能测试。相关后续见 [#8933](https://github.com/ClickHouse/ClickHouse/issues/8933) [#8947](https://github.com/ClickHouse/ClickHouse/pull/8947) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 通过样式检查确保 ErrorCodes 的风格统一。[#9370](https://github.com/ClickHouse/ClickHouse/pull/9370) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 添加测试历史记录脚本。[#8796](https://github.com/ClickHouse/ClickHouse/pull/8796) ([alesapin](https://github.com/alesapin))
* 添加 GCC 警告 `-Wsuggest-override`，用于定位并修复所有必须使用 `override` 关键字的地方。[#8760](https://github.com/ClickHouse/ClickHouse/pull/8760) ([kreuzerkrieg](https://github.com/kreuzerkrieg))
* 在 Mac OS X 下忽略弱符号，因为它必须定义 [#9538](https://github.com/ClickHouse/ClickHouse/pull/9538) ([Deleted user](https://github.com/ghost))
* 对性能测试中某些查询的运行时间进行标准化。这是为在比较模式下运行所有性能测试做准备。[#9565](https://github.com/ClickHouse/ClickHouse/pull/9565) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了一些测试，以支持在查询测试中使用 pytest [#9062](https://github.com/ClickHouse/ClickHouse/pull/9062) ([Ivan](https://github.com/abyss7))
* 在启用 MSan 的构建中启用 SSL，这样服务器在运行无状态测试时启动就不会失败 [#9531](https://github.com/ClickHouse/ClickHouse/pull/9531) ([tavplubix](https://github.com/tavplubix))
* 修复测试结果中的数据库替换问题 [#9384](https://github.com/ClickHouse/ClickHouse/pull/9384) ([Ilya Yatsishin](https://github.com/qoega))
* 修复了多个其他平台上的构建问题 [#9381](https://github.com/ClickHouse/ClickHouse/pull/9381) ([proller](https://github.com/proller)) [#8755](https://github.com/ClickHouse/ClickHouse/pull/8755) ([proller](https://github.com/proller)) [#8631](https://github.com/ClickHouse/ClickHouse/pull/8631) ([proller](https://github.com/proller))
* 在 stateless-with-coverage 测试 Docker 镜像中添加了磁盘部分 [#9213](https://github.com/ClickHouse/ClickHouse/pull/9213) ([Pavel Kovalenko](https://github.com/Jokser))
* 在使用 GRPC 构建时移除源代码树中的文件 [#9588](https://github.com/ClickHouse/ClickHouse/pull/9588) ([Amos Bird](https://github.com/amosbird))
* 通过将 SessionCleaner 从 Context 中移除，构建时间略有缩短。简化了 SessionCleaner 的代码。[#9232](https://github.com/ClickHouse/ClickHouse/pull/9232) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 更新了 `clickhouse-test` 脚本中对卡住查询的检查 [#8858](https://github.com/ClickHouse/ClickHouse/pull/8858) ([Alexander Kazakov](https://github.com/Akazz))
* 从 repository 中移除了一些无用文件。[#8843](https://github.com/ClickHouse/ClickHouse/pull/8843) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 math 性能测试类型从 `once` 改为 `loop`。[#8783](https://github.com/ClickHouse/ClickHouse/pull/8783) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 新增了一个 Docker image，可用于为我们的代码库生成交互式代码浏览器 HTML 报告。[#8781](https://github.com/ClickHouse/ClickHouse/pull/8781) ([alesapin](https://github.com/alesapin)) 请参见 [Woboq Code Browser](https://clickhouse-test-reports.s3.yandex.net/codebrowser/ClickHouse/dbms/index.html)
* 在 MSan 环境下抑制一些测试失败。[#8780](https://github.com/ClickHouse/ClickHouse/pull/8780) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 加快“insert 时异常”测试。该测试在 debug-with-coverage 构建中经常超时。[#8711](https://github.com/ClickHouse/ClickHouse/pull/8711) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 `libcxx` 和 `libcxxabi` 更新到 master，以便为 [#9304](https://github.com/ClickHouse/ClickHouse/issues/9304) [#9308](https://github.com/ClickHouse/ClickHouse/pull/9308) 做准备 ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复不稳定的测试 `00910_zookeeper_test_alter_compression_codecs`。[#9525](https://github.com/ClickHouse/ClickHouse/pull/9525) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 清理重复的链接器标志。确保链接器不会查找非预期的符号。[#9433](https://github.com/ClickHouse/ClickHouse/pull/9433) ([Amos Bird](https://github.com/amosbird))
* 将 `clickhouse-odbc` driver 添加到测试镜像中。这样就可以通过 ClickHouse 自身的 ODBC driver 测试 ClickHouse 与 ClickHouse 之间的交互。[#9348](https://github.com/ClickHouse/ClickHouse/pull/9348) ([filimonov](https://github.com/filimonov))
* 修复了单元测试中的若干问题。[#9047](https://github.com/ClickHouse/ClickHouse/pull/9047) ([alesapin](https://github.com/alesapin))
* 启用 GCC 警告 `-Wmissing-include-dirs`，以消除所有不存在的 include 目录——这主要是由 CMake 脚本错误导致的 [#8704](https://github.com/ClickHouse/ClickHouse/pull/8704) ([kreuzerkrieg](https://github.com/kreuzerkrieg))
* 说明查询分析器无法工作的原因。此项用于 [#9049](https://github.com/ClickHouse/ClickHouse/issues/9049) [#9144](https://github.com/ClickHouse/ClickHouse/pull/9144) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 OpenSSL 更新到上游 master。修复了 TLS 连接可能失败并报出消息 `OpenSSL SSL_read: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error` 和 `SSL Exception: error:2400006E:random number generator::error retrieving entropy` 的问题。该问题存在于 20.1 版本中。[#8956](https://github.com/ClickHouse/ClickHouse/pull/8956) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 更新 server 的 Dockerfile [#8893](https://github.com/ClickHouse/ClickHouse/pull/8893) ([Ilya Mazaev](https://github.com/ne-ray))
* 对 build-gcc-from-sources 脚本的小修复 [#8774](https://github.com/ClickHouse/ClickHouse/pull/8774) ([Michael Nacharov](https://github.com/mnach))
* 在未使用 `number` 列的 perftests 中，将 `numbers` 替换为 `zeros`。这样可使测试结果更干净。[#9600](https://github.com/ClickHouse/ClickHouse/pull/9600) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了在 Column 构造函数中使用 initializer\_list 时出现的栈溢出问题。[#9367](https://github.com/ClickHouse/ClickHouse/pull/9367) ([已删除用户](https://github.com/ghost))
* 将 librdkafka 升级到 v1.3.0。在 Mac OS X 上启用内置的 `rdkafka` 和 `gsasl` 库。[#9000](https://github.com/ClickHouse/ClickHouse/pull/9000) ([Andrew Onyshchuk](https://github.com/oandrew))
* 修复在 GCC 9.2.0 上的构建问题 [#9306](https://github.com/ClickHouse/ClickHouse/pull/9306) ([vxider](https://github.com/Vxider))

<div id="clickhouse-release-v201">
  ## ClickHouse 发行版 v20.1
</div>

<div id="clickhouse-release-v20116120-stable-2020-60-26">
  ### ClickHouse 发行版 v20.1.16.120-稳定版本 2020-60-26
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在 prewhere 条件中使用 `Nullable` 列时偶发崩溃的问题。这是 [#11608](https://github.com/ClickHouse/ClickHouse/issues/11608) 的后续修复。[#11869](https://github.com/ClickHouse/ClickHouse/pull/11869) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 不再允许在高阶函数中使用 arrayJoin。此前这会导致协议同步异常。此修复关闭了 [#3933](https://github.com/ClickHouse/ClickHouse/issues/3933)。[#11846](https://github.com/ClickHouse/ClickHouse/pull/11846) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了类似 `SELECT *, xyz.*` 的查询本应报错却成功执行的异常行为。[#11753](https://github.com/ClickHouse/ClickHouse/pull/11753) ([hexiaoting](https://github.com/hexiaoting)).
* 修复了 Values input format 中复杂字面量类型推断错误导致的 LOGICAL\_ERROR。[#11732](https://github.com/ClickHouse/ClickHouse/pull/11732) ([tavplubix](https://github.com/tavplubix)).
* 修复了 `ORDER BY ... WITH FILL` 处理 const 列时的问题。[#11697](https://github.com/ClickHouse/ClickHouse/pull/11697) ([Anton Popov](https://github.com/CurtizJ)).
* 与 XDBC bridge 通信时会传递正确的 timeout。此前在检查 bridge 存活状态和接收元信息时，timeout 最近未被正确遵守。[#11690](https://github.com/ClickHouse/ClickHouse/pull/11690) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了对带有不区分大小写标志的正则表达式的支持。此修复解决了 [#11101](https://github.com/ClickHouse/ClickHouse/issues/11101) 和 [#11506](https://github.com/ClickHouse/ClickHouse/issues/11506)。[#11649](https://github.com/ClickHouse/ClickHouse/pull/11649) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 String 的布隆过滤器 (数据跳过索引) 问题。[#11638](https://github.com/ClickHouse/ClickHouse/pull/11638) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 prewhere 条件中使用 `Nullable` 列时偶发崩溃的问题。 (可能与 [#11572](https://github.com/ClickHouse/ClickHouse/issues/11572) 有一定关联。) [#11608](https://github.com/ClickHouse/ClickHouse/pull/11608) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 clickhouse-client 在 exception.code() % 256 = 0 时退出码错误的问题。[#11601](https://github.com/ClickHouse/ClickHouse/pull/11601) ([filimonov](https://github.com/filimonov)).
* 修复了 server 启动时关于“Mark cache size was lowered”的日志消息中的一个小错误。此修复关闭了 [#11399](https://github.com/ClickHouse/ClickHouse/issues/11399)。[#11589](https://github.com/ClickHouse/ClickHouse/pull/11589) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 现在 clickhouse-server docker 容器在检查 server 存活状态时会优先使用 IPv6。[#11550](https://github.com/ClickHouse/ClickHouse/pull/11550) ([Ivan Starkov](https://github.com/istarkov)).
* 修复了使用 -State 函数进行聚合时，中途抛出异常导致的内存泄漏问题。此修复解决了 [#8995](https://github.com/ClickHouse/ClickHouse/issues/8995)。[#11496](https://github.com/ClickHouse/ClickHouse/pull/11496) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了主键被函数包裹时与 'FINAL' 修饰符及 'ORDER BY' 优化配合使用的问题。[#10715](https://github.com/ClickHouse/ClickHouse/pull/10715) ([Anton Popov](https://github.com/CurtizJ)).

<div id="clickhouse-release-v20115109-stable-2020-06-19">
  ### ClickHouse 发行版 v20.1.15.109-稳定版本 2020-06-19
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在执行 alter 时对结构加锁过多的问题。[#11790](https://github.com/ClickHouse/ClickHouse/pull/11790) ([alesapin](https://github.com/alesapin)).

<div id="clickhouse-release-v20114107-stable-2020-06-11">
  ### ClickHouse 发行版 v20.1.14.107-稳定版本 2020-06-11
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了在包含 `PREWHERE column in (subquery)` 和 `ARRAY JOIN` 的查询中出现的错误 `Size of offsets does not match size of column`。[#11580](https://github.com/ClickHouse/ClickHouse/pull/11580) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。

<div id="clickhouse-release-v20113105-stable-2020-06-10">
  ### ClickHouse 发行版 v20.1.13.105-稳定版本 2020-06-10
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了这样一个错误：如果启用了 `min_bytes_to_use_direct_io`，且 PREWHERE 生效，同时使用 SAMPLE 或较多线程，就可能出现 `Data compressed with different methods`。此修复对应 [#11539](https://github.com/ClickHouse/ClickHouse/issues/11539)。[#11540](https://github.com/ClickHouse/ClickHouse/pull/11540) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复 `codecs` 返回压缩后大小的问题。[#11448](https://github.com/ClickHouse/ClickHouse/pull/11448) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复当列的压缩编解码器使用非字面量参数时服务器崩溃的问题。修复了 [#11365](https://github.com/ClickHouse/ClickHouse/issues/11365)。[#11431](https://github.com/ClickHouse/ClickHouse/pull/11431) ([alesapin](https://github.com/alesapin)).
* 修复 pointInPolygon 在点为 nan 时的问题。修复了 [#11375](https://github.com/ClickHouse/ClickHouse/issues/11375)。[#11421](https://github.com/ClickHouse/ClickHouse/pull/11421) ([Alexey Ilyukhov](https://github.com/livace)).
* 修复了 `geohashesInBox` 在参数超出纬度/经度范围时出现的问题。[#11403](https://github.com/ClickHouse/ClickHouse/pull/11403) ([Vasily Nemkov](https://github.com/Enmk)).
* 修复带有外部排序和 limit 的查询中可能出现的 `Pipeline stuck` 错误。修复 [#11359](https://github.com/ClickHouse/ClickHouse/issues/11359)。[#11366](https://github.com/ClickHouse/ClickHouse/pull/11366) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复 `quantilesExactWeightedArray` 的崩溃问题。[#11337](https://github.com/ClickHouse/ClickHouse/pull/11337) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 恢复了在设置 `parallel_view_processing = 1` 时对 `MATERIALIZED VIEW` 的并行写入。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#11330](https://github.com/ClickHouse/ClickHouse/pull/11330) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `visitParamExtractRaw` 在提取出的 JSON 包含带有未配对 \{ 或 \[ 的字符串时的问题。 [#11318](https://github.com/ClickHouse/ClickHouse/pull/11318) ([Ewout](https://github.com/devwout)).
* 修复了 ThreadPool 中一种极为罕见的竞态条件。[#11314](https://github.com/ClickHouse/ClickHouse/pull/11314) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了转换过程中可能使用未初始化内存的问题。示例：`SELECT toIntervalSecond(now64())`。[#11311](https://github.com/ClickHouse/ClickHouse/pull/11311) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个问题：如果表的主键中包含 Array 列，且查询使用 `empty` 或 `notEmpty` 函数按该列进行过滤，索引分析就无法生效。此修复对应 [#11286](https://github.com/ClickHouse/ClickHouse/issues/11286)。[#11303](https://github.com/ClickHouse/ClickHouse/pull/11303) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了一个问题：当查询因 `max_network_bandwidth`、`max_execution_speed` 或 `priority` 设置而被限速时，查询速度估算可能不准确，且 `min_execution_speed` 的限制可能不生效或生效不正确。将 `timeout_before_checking_execution_speed` 的默认值改为非零，因为否则 `min_execution_speed` 和 `max_execution_speed` 设置将不起作用。此修复解决了 [#11297](https://github.com/ClickHouse/ClickHouse/issues/11297)。此修复解决了 [#5732](https://github.com/ClickHouse/ClickHouse/issues/5732)。此修复解决了 [#6228](https://github.com/ClickHouse/ClickHouse/issues/6228)。易用性改进：避免在 `clickhouse-client` 中将异常消息与进度条拼接在一起。[#11296](https://github.com/ClickHouse/ClickHouse/pull/11296) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了读取 Protobuf 格式的畸形数据时发生崩溃的问题。此修复解决了 [#5957](https://github.com/ClickHouse/ClickHouse/issues/5957) 和 [#11203](https://github.com/ClickHouse/ClickHouse/issues/11203)。[#11258](https://github.com/ClickHouse/ClickHouse/pull/11258) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了高阶函数在捕获参数为 `Array(Array(LowCardinality))` 时可能出现的错误 `Cannot capture column`。[#11185](https://github.com/ClickHouse/ClickHouse/pull/11185) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 如果数据跳过索引依赖的列会在后台合并过程中被修改 (SummingMergeTree、AggregatingMergeTree 以及 TTL GROUP BY 都属于这种情况) ，其计算结果会不正确。这个问题已通过将索引计算移至合并之后修复，因此索引会基于合并后的数据来计算。[#11162](https://github.com/ClickHouse/ClickHouse/pull/11162) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果未完成任何最终化操作，则移除变更最终化任务中的日志记录。 [#11109](https://github.com/ClickHouse/ClickHouse/pull/11109) ([alesapin](https://github.com/alesapin)).
* 修复了 parseDateTime64BestEffort 参数解析方面的错误。[#10925](https://github.com/ClickHouse/ClickHouse/issues/10925)。[#11038](https://github.com/ClickHouse/ClickHouse/pull/11038) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复 `getRawData()` 方法返回的原始数据大小不正确的问题。 [#10964](https://github.com/ClickHouse/ClickHouse/pull/10964) ([Igr](https://github.com/ObjatieGroba)).
* 修复分布式表中元组的向后兼容性问题。[#10889](https://github.com/ClickHouse/ClickHouse/pull/10889) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 StringHashTable 中当此类键不存在时发生的 SIGSEGV 问题。[#10870](https://github.com/ClickHouse/ClickHouse/pull/10870) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `ReplicatedMergeTree` 中的一个 bug：某些针对 `OPTIMIZE` 查询的 `ALTER` 可能会在某个副本变为非活动状态后，因等待该副本而卡住。 [#10849](https://github.com/ClickHouse/ClickHouse/pull/10849) ([tavplubix](https://github.com/tavplubix)).
* 修复 `Block::sortColumns()` 后的列顺序问题 (并新增了一项测试，用于说明这会影响某些实际用例——Buffer 引擎) 。[#10826](https://github.com/ClickHouse/ClickHouse/pull/10826) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在未要求为标识符加引号时 ODBC bridge 出现的问题。此修复解决了 [#7984](https://github.com/ClickHouse/ClickHouse/issues/7984)。[#10821](https://github.com/ClickHouse/ClickHouse/pull/10821) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复 DateLUT 中 UBSan 和 MSan 的报错。[#10798](https://github.com/ClickHouse/ClickHouse/pull/10798) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* * 在键条件中使用 `src_type` 进行正确的类型转换。修复了 [#6287](https://github.com/ClickHouse/ClickHouse/issues/6287)。[#10791](https://github.com/ClickHouse/ClickHouse/pull/10791) ([Andrew Onyshchuk](https://github.com/oandrew))。
* 修复了 `parallel_view_processing` 的行为。现在，即使发生异常，所有对 `MATERIALIZED VIEW` 的插入操作也都会无一例外地完成。修复了 [#10241](https://github.com/ClickHouse/ClickHouse/issues/10241)。[#10757](https://github.com/ClickHouse/ClickHouse/pull/10757) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复组合器 -OrNull 和 -OrDefault 与 -State 组合使用时的问题。 [#10741](https://github.com/ClickHouse/ClickHouse/pull/10741) ([hcz](https://github.com/hczhcz)).
* 修复 Totals 消失的问题。如果查询包含带有外部 WHERE 条件的 join 或子查询，Totals 可能会被过滤掉。修复了 [#10674](https://github.com/ClickHouse/ClickHouse/issues/10674)。[#10698](https://github.com/ClickHouse/ClickHouse/pull/10698) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在同一查询中多次对同一个集合使用 `IN` 运算符时出现的问题。[#10686](https://github.com/ClickHouse/ClickHouse/pull/10686) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 AggregateTransform 构造函数中参数顺序的问题。[#10667](https://github.com/ClickHouse/ClickHouse/pull/10667) ([palasonic1](https://github.com/palasonic1)).
* 修复了在启用 `distributed_aggregation_memory_efficient` 时远程查询无法并行执行的问题。修复 [#10655](https://github.com/ClickHouse/ClickHouse/issues/10655)。[#10664](https://github.com/ClickHouse/ClickHouse/pull/10664) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了带有 `HAVING` 子句的 distributed queries 的谓词优化问题 (`enable_optimize_predicate_expression=1`)  (即当需要在发起端 server 上进行过滤时) ：通过保留表达式顺序即可修复；此外，还强制聚合器使用列名而不是索引。修复项：[#10613](https://github.com/ClickHouse/ClickHouse/issues/10613)、[#11413](https://github.com/ClickHouse/ClickHouse/issues/11413)。[#10621](https://github.com/ClickHouse/ClickHouse/pull/10621) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复错误 `the BloomFilter false positive must be a double number between 0 and 1` [#10551](https://github.com/ClickHouse/ClickHouse/issues/10551)。[#10569](https://github.com/ClickHouse/ClickHouse/pull/10569) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了在默认表达式类型与列类型不同时，对 ALIAS 列执行 SELECT 的问题。[#10563](https://github.com/ClickHouse/ClickHouse/pull/10563) ([Azat Khuzhin](https://github.com/azat)) 。
* * 已支持 DateTime64 与 String 值进行比较 (与 DateTime 一样) 。[#10560](https://github.com/ClickHouse/ClickHouse/pull/10560) ([Vasily Nemkov](https://github.com/Enmk)).

<div id="clickhouse-release-v2011286-2020-05-26">
  ### ClickHouse 发行版 v20.1.12.86，2020-05-26
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 20.1 与更早版本之间在两级聚合上的兼容性问题。当发起节点和远程节点使用不同版本的 ClickHouse，且 GROUP BY 结果较大，并且聚合是基于单个 String 字段执行时，就会出现这一问题。这会导致结果中同一个键出现多行未合并的行。[#10952](https://github.com/ClickHouse/ClickHouse/pull/10952) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `SummingMergeTree` 中 `LowCardinality(FixedString)` 键列在合并后可能出现的数据损坏问题。修复了 [#10489](https://github.com/ClickHouse/ClickHouse/issues/10489)。[#10721](https://github.com/ClickHouse/ClickHouse/pull/10721) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个 bug：当 `readonly=2` 且 `cancel_http_readonly_queries_on_client_close=1` 时，客户端关闭会导致 HTTP 请求卡住。修复了 [#7939](https://github.com/ClickHouse/ClickHouse/issues/7939)、[#7019](https://github.com/ClickHouse/ClickHouse/issues/7019)、[#7736](https://github.com/ClickHouse/ClickHouse/issues/7736) 和 [#7091](https://github.com/ClickHouse/ClickHouse/issues/7091)。[#10684](https://github.com/ClickHouse/ClickHouse/pull/10684) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了一个 bug：执行 `SYSTEM DROP DNS CACHE` 查询时，也会删除用于检查用户是否允许从某些 IP 地址连接的缓存。 [#10608](https://github.com/ClickHouse/ClickHouse/pull/10608) ([tavplubix](https://github.com/tavplubix)).
* 修复了当 `MATERIALIZED VIEW` 的内部查询包含依赖表时，该查询中的错误 scalar 结果问题。[#10603](https://github.com/ClickHouse/ClickHouse/pull/10603) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一种情况：变更已完成所有 parts，但仍然卡在 `is_done=0`。 [#10526](https://github.com/ClickHouse/ClickHouse/pull/10526) ([alesapin](https://github.com/alesapin)).
* 修复了相对于 UTC 存在小数偏移的时区在 Unix 纪元起始处出现的溢出问题。此修复解决了 [#9335](https://github.com/ClickHouse/ClickHouse/issues/9335)。[#10513](https://github.com/ClickHouse/ClickHouse/pull/10513) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 Distributed 存储的不正确关闭问题。[#10491](https://github.com/ClickHouse/ClickHouse/pull/10491) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `simpleLinearRegression` 在处理大整数时的数值溢出问题。[#10474](https://github.com/ClickHouse/ClickHouse/pull/10474) ([hcz](https://github.com/hczhcz)).
* 修复了 Attach 数据库失败时误删元数据目录的问题。[#10442](https://github.com/ClickHouse/ClickHouse/pull/10442) ([Winter Zhang](https://github.com/zhang2014)) 。
* 在创建 `BloomFilter` 索引时，新增了对参数个数和类型的检查 [#9623](https://github.com/ClickHouse/ClickHouse/issues/9623)。[#10431](https://github.com/ClickHouse/ClickHouse/pull/10431) ([Winter Zhang](https://github.com/zhang2014)) 。
* 修复了一个问题：包含 `ARRAY JOIN`、`ORDER BY` 和 `LIMIT` 的查询可能返回不完整的结果。此修复解决了 [#10226](https://github.com/ClickHouse/ClickHouse/issues/10226)。[#10427](https://github.com/ClickHouse/ClickHouse/pull/10427) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 建议优先使用 `fallback_to_stale_replicas`，而不是 `skip_unavailable_shards`。[#10422](https://github.com/ClickHouse/ClickHouse/pull/10422) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `Array(Tuple(...))` 数据类型被错误扁平化的问题。此修复解决了 [#10259](https://github.com/ClickHouse/ClickHouse/issues/10259)。[#10390](https://github.com/ClickHouse/ClickHouse/pull/10390) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了 `HashTable` 中的错误行为，该问题会在尝试从缓冲区读取 HashMap 时导致编译错误。[#10386](https://github.com/ClickHouse/ClickHouse/pull/10386) ([palasonic1](https://github.com/palasonic1)) 。
* 修复了 `ConcatProcessor` 中一个可能在远程查询时发生的 `Pipeline stuck` 错误。[#10381](https://github.com/ClickHouse/ClickHouse/pull/10381) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在使用 `max_rows_to_group_by` 和 `group_by_overflow_mode = 'break'` 时出现的 `Pipeline stuck` 报错。[#10279](https://github.com/ClickHouse/ClickHouse/pull/10279) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了若干问题：某些数据以 quorum 方式插入后，又因某种原因被删除 (DROP PARTITION、TTL) ，从而导致 INSERTs 卡住，或在 SELECTs 中误报异常。此修复对应 [#9946](https://github.com/ClickHouse/ClickHouse/issues/9946)。[#10188](https://github.com/ClickHouse/ClickHouse/pull/10188) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了以下情况下的兼容性问题：远程服务器使用早于 18.12.17 的版本，而发起端服务器使用较新版本，且 `GROUP BY` 同时包含 Fixed 键和非 Fixed 键，并启用了两级 group by 方法。[#3254](https://github.com/ClickHouse/ClickHouse/pull/3254) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 已将 CA 证书添加到 clickhouse-server Docker 镜像中。[#10476](https://github.com/ClickHouse/ClickHouse/pull/10476) ([filimonov](https://github.com/filimonov)).

<div id="clickhouse-release-v2011070-2020-04-17">
  ### ClickHouse 发行版 v20.1.10.70，2020-04-17
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复少见情况下可能出现的异常：`Cannot drain connections: cancel first`。[#10239](https://github.com/ClickHouse/ClickHouse/pull/10239) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个问题：当用户尝试对 `ENGINE = Replicated*` 的表执行 `ALTER UPDATE/DELETE` 时，ClickHouse 会报出 `'Unknown function lambda.'` 错误。现在，对非确定性函数的检查也能正确处理 lambda 表达式。[#10237](https://github.com/ClickHouse/ClickHouse/pull/10237) ([Alexander Kazakov](https://github.com/Akazz)).
* 修复了 `parseDateTimeBestEffort` 在 RFC-2822 字符串中星期为星期二或星期四时的解析问题。此修复对应 [#10082](https://github.com/ClickHouse/ClickHouse/issues/10082)。[#10214](https://github.com/ClickHouse/ClickHouse/pull/10214) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `JOIN` 内部常量的列名可能与 `JOIN` 外部常量的名称冲突的问题。[#10207](https://github.com/ClickHouse/ClickHouse/pull/10207) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了从 `system.numbers` 或 `system.zeros` 这类无限数据源读取时，查询本应在 LIMIT 处停止却可能无限执行的问题。[#10206](https://github.com/ClickHouse/ClickHouse/pull/10206) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在存在 `arrayJoin` 函数时 (特定情况下) move-to-prewhere 优化失效的问题。此修复解决了 [#10092](https://github.com/ClickHouse/ClickHouse/issues/10092)。[#10195](https://github.com/ClickHouse/ClickHouse/pull/10195) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增了通过 `allow_nondeterministic_mutations` 设置放宽在变更中使用非确定性函数限制的功能。[#10186](https://github.com/ClickHouse/ClickHouse/pull/10186) ([filimonov](https://github.com/filimonov)) 。
* 向使用 `Distributed` 引擎的表执行 `INSERT` 时，如果结构不匹配，则会转换块。[#10135](https://github.com/ClickHouse/ClickHouse/pull/10135) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在向 `Distributed` 表执行 `INSERT` 时，若其结构与底层表不一致而导致的 `SIGSEGV`。 [#10105](https://github.com/ClickHouse/ClickHouse/pull/10105) ([Azat Khuzhin](https://github.com/azat)).
* 修复带有 `JOIN` 和 `UNION ALL` 的查询中可能出现的行丢失问题。修复了 [#9826](https://github.com/ClickHouse/ClickHouse/issues/9826) 和 [#10113](https://github.com/ClickHouse/ClickHouse/issues/10113)。[#10099](https://github.com/ClickHouse/ClickHouse/pull/10099) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 为 MySQL 数据库引擎添加参数检查，并支持标识符类型的参数。[#10077](https://github.com/ClickHouse/ClickHouse/pull/10077) ([Winter Zhang](https://github.com/zhang2014)).
* 修复了从 localhost 上的 ClickHouse 服务器读取数据的 ClickHouse 字典源中的一个缺陷。如果字典和字典源中的类型不兼容，该缺陷可能会导致内存损坏。[#10071](https://github.com/ClickHouse/ClickHouse/pull/10071) ([alesapin](https://github.com/alesapin)) 。
* 修复错误 `Cannot clone block with columns because block has 0 columns ... While executing GroupingAggregatedTransform`。当启用设置 `distributed_aggregation_memory_efficient`，且分布式查询从不同分片读取不同级别的聚合数据时 (即混合了单级和两级聚合) ，就会发生该错误。[#10063](https://github.com/ClickHouse/ClickHouse/pull/10063) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了对包含尾随零字节的字符串键执行 `GROUP BY` 时可能出现的段错误 ([#8636](https://github.com/ClickHouse/ClickHouse/issues/8636), [#8925](https://github.com/ClickHouse/ClickHouse/issues/8925)) 。[#10025](https://github.com/ClickHouse/ClickHouse/pull/10025) ([Alexander Kuzmenkov](https://github.com/akuzm)) 。
* 修复了一个 bug：在针对某些数据库的查询处理某个阶段，未能获取到所需的表。修复了 [#9699](https://github.com/ClickHouse/ClickHouse/issues/9699)。[#9949](https://github.com/ClickHouse/ClickHouse/pull/9949) ([achulkov2](https://github.com/achulkov2)).
* 修复 `JOIN` 与 `TOTALS` 同时出现时的 `'Not found column in block'` 错误。修复了 [#9839](https://github.com/ClickHouse/ClickHouse/issues/9839)。[#9939](https://github.com/ClickHouse/ClickHouse/pull/9939) ([Artem Zuikov](https://github.com/4ertus2)) 。
* 修复了 `ON CLUSTER` DDL 查询在服务器启动时卡住的问题。[#9927](https://github.com/ClickHouse/ClickHouse/pull/9927) ([Gagan Arneja](https://github.com/garneja)) 。
* 修复 Join 表引擎中 `TRUNCATE` 的问题 ([#9917](https://github.com/ClickHouse/ClickHouse/issues/9917)) 。[#9920](https://github.com/ClickHouse/ClickHouse/pull/9920) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 ALTER 查询中出现的 `'scalar does not exist'` 错误 ([#9878](https://github.com/ClickHouse/ClickHouse/issues/9878)) 。[#9904](https://github.com/ClickHouse/ClickHouse/pull/9904) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 `ReplicatedMergeTree` 中 drop 与 optimize 操作之间的竞态条件。[#9901](https://github.com/ClickHouse/ClickHouse/pull/9901) ([alesapin](https://github.com/alesapin)).
* 修复了 `ATTACH PART` 中的 `DeleteOnDestroy` 逻辑问题，该问题可能导致已附加的分片被自动删除，并新增了几项测试。[#9410](https://github.com/ClickHouse/ClickHouse/pull/9410) ([Vladimir Chebotarev](https://github.com/excitoon)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了单元测试 `collapsing_sorted_stream`。[#9367](https://github.com/ClickHouse/ClickHouse/pull/9367) ([Deleted user](https://github.com/ghost)) 。

<div id="clickhouse-release-v201954-2020-03-28">
  ### ClickHouse 发行版 v20.1.9.54，2020-03-28
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复当查询针对分布式表同时使用 `PREWHERE` 和 `WHERE`，并设置 `SET distributed_product_mode = 'local'` 时出现的 `'Different expressions with the same alias'` 错误。[#9871](https://github.com/ClickHouse/ClickHouse/pull/9871) ([Artem Zuikov](https://github.com/4ertus2)).
* 修复具有复合主键的表在执行变更时内存占用过高的问题。此修复解决了 [#9850](https://github.com/ClickHouse/ClickHouse/issues/9850)。[#9860](https://github.com/ClickHouse/ClickHouse/pull/9860) ([alesapin](https://github.com/alesapin)).
* 对于 INSERT 查询，分片现在会将从发起节点接收到的设置限制在该分片的约束范围内，而不是直接抛出异常。此修复使得可以将 `INSERT` 查询发送到具有不同约束的分片。此更改进一步完善了对 [#9447](https://github.com/ClickHouse/ClickHouse/issues/9447) 的修复。[#9852](https://github.com/ClickHouse/ClickHouse/pull/9852) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复客户端上可能出现的异常 `Got 0 in totals chunk, expected 1`。该问题会在带有 `JOIN` 的查询中出现：当右侧连接表没有任何行时，就可能触发该异常。示例：`select * from system.one t1 join system.one t2 on t1.dummy = t2.dummy limit 0 FORMAT TabSeparated;`。修复了 [#9777](https://github.com/ClickHouse/ClickHouse/issues/9777)。[#9823](https://github.com/ClickHouse/ClickHouse/pull/9823) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复在类型无法转换时启用 `optimize_skip_unused_shards` 可能导致的 `SIGSEGV` 问题。[#9804](https://github.com/ClickHouse/ClickHouse/pull/9804) ([Azat Khuzhin](https://github.com/azat)).
* 修复了若干函数参数的时区未被正确使用的情况。[#9574](https://github.com/ClickHouse/ClickHouse/pull/9574) ([Vasily Nemkov](https://github.com/Enmk)).

<div id="improvement">
  #### 改进
</div>

* 从变更中移除了 `ORDER BY` 阶段，因为我们是在单线程中从单个有序 分片 读取数据。同时还增加了检查，以确保变更中的行顺序遵循排序键顺序，且不会破坏这一顺序。[#9886](https://github.com/ClickHouse/ClickHouse/pull/9886) ([alesapin](https://github.com/alesapin)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 清理重复的链接器标志，确保链接器不会查找非预期的符号。[#9433](https://github.com/ClickHouse/ClickHouse/pull/9433) ([Amos Bird](https://github.com/amosbird)).

<div id="clickhouse-release-v201841-2020-03-20">
  ### ClickHouse 发布 v20.1.8.41，2020-03-20
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复可能持续出现的 `Cannot schedule a task` 错误 (由 `ParallelAggregatingBlockInputStream::Handler::onFinish/onFinishThread` 中未处理的异常导致) 。此修复解决了 [#6833](https://github.com/ClickHouse/ClickHouse/issues/6833)。[#9154](https://github.com/ClickHouse/ClickHouse/pull/9154) ([Azat Khuzhin](https://github.com/azat))
* 修复 `ALTER` 查询 (变更) 中的内存占用过高问题。此修复解决了 [#9533](https://github.com/ClickHouse/ClickHouse/issues/9533) 和 [#9670](https://github.com/ClickHouse/ClickHouse/issues/9670)。[#9754](https://github.com/ClickHouse/ClickHouse/pull/9754) ([alesapin](https://github.com/alesapin))
* 修复外部字典 DDL 中反引号处理的缺陷。此修复解决了 [#9619](https://github.com/ClickHouse/ClickHouse/issues/9619)。[#9734](https://github.com/ClickHouse/ClickHouse/pull/9734) ([alesapin](https://github.com/alesapin))

<div id="clickhouse-release-v201738-2020-03-18">
  ### ClickHouse 发行版 v20.1.7.38，2020-03-18
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复了 `sumKahan` 和 `sumWithOverflow` 的内部函数名错误。在远程查询中使用这些函数时，会导致异常。 [#9636](https://github.com/ClickHouse/ClickHouse/pull/9636) ([Azat Khuzhin](https://github.com/azat))。此问题存在于所有 ClickHouse 发行版中。
* 允许对启用内部复制的 `Distributed` 表执行 `ALTER ON CLUSTER`。这修复了 [#3268](https://github.com/ClickHouse/ClickHouse/issues/3268) 中的问题。[#9617](https://github.com/ClickHouse/ClickHouse/pull/9617) ([shinoi2](https://github.com/shinoi2)) 。该问题存在于所有 ClickHouse 发行版中。
* 修复 `MergeTreeRangeReader` 中可能出现的异常：`Size of filter does not match size of column` 和 `Invalid number of rows in Chunk`。在某些情况下执行 `PREWHERE` 时，可能会出现这些异常。修复 [#9132](https://github.com/ClickHouse/ClickHouse/issues/9132)。[#9612](https://github.com/ClickHouse/ClickHouse/pull/9612) ([Anton Popov](https://github.com/CurtizJ))
* 修复了以下问题：如果编写 `time + 1` 这样的简单算术表达式 (而不是 `time + INTERVAL 1 SECOND` 这样的表达式) ，时区信息不会被保留。此修复对应 [#5743](https://github.com/ClickHouse/ClickHouse/issues/5743)。[#9323](https://github.com/ClickHouse/ClickHouse/pull/9323) ([alexey-milovidov](https://github.com/alexey-milovidov))。该问题存在于所有 ClickHouse 发行版中。
* 现在已无法创建或添加带有简单循环别名的列，例如 `a DEFAULT b, b DEFAULT a`。[#9603](https://github.com/ClickHouse/ClickHouse/pull/9603) ([alesapin](https://github.com/alesapin))
* 修复了 base64 编码值末尾填充可能格式不正确的问题。更新了 base64 库。此修复解决了 [#9491](https://github.com/ClickHouse/ClickHouse/issues/9491)，关闭了 [#9492](https://github.com/ClickHouse/ClickHouse/issues/9492) [#9500](https://github.com/ClickHouse/ClickHouse/pull/9500) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了在销毁 `Poco::HTTPServer` 时发生的数据竞争问题。该问题可能出现在服务器启动后立即关闭的情况下。[#9468](https://github.com/ClickHouse/ClickHouse/pull/9468) ([Anton Popov](https://github.com/CurtizJ))
* 修复在与第 n' 行相等的行过多时，`LIMIT n WITH TIES` 可能导致崩溃或返回错误行数的问题。 [#9464](https://github.com/ClickHouse/ClickHouse/pull/9464) ([tavplubix](https://github.com/tavplubix))
* 修复列 TTL 可能引起的校验和不匹配问题。 [#9451](https://github.com/ClickHouse/ClickHouse/pull/9451) ([Anton Popov](https://github.com/CurtizJ))
* 修复了用户尝试对旧版格式的 `MergeTree` 表引擎家族执行 `ALTER MODIFY SETTING` 时发生的崩溃。[#9435](https://github.com/ClickHouse/ClickHouse/pull/9435) ([alesapin](https://github.com/alesapin))
* 现在我们将尝试更频繁地完成变更操作。 [#9427](https://github.com/ClickHouse/ClickHouse/pull/9427) ([alesapin](https://github.com/alesapin))
* 修复了在 [#8598](https://github.com/ClickHouse/ClickHouse/issues/8598) 中引入的复制协议兼容性问题。[#9412](https://github.com/ClickHouse/ClickHouse/pull/9412) ([alesapin](https://github.com/alesapin))
* 修复了 Array 类型的 bloom\_filter 索引中 not(has()) 的问题。[#9407](https://github.com/ClickHouse/ClickHouse/pull/9407) ([achimbab](https://github.com/achimbab))
* 修复了 `match` 和 `extract` 函数在 haystack 包含零字节时的行为问题。此前在 haystack 为常量时，该行为是错误的。此修复包括 [#9160](https://github.com/ClickHouse/ClickHouse/issues/9160) [#9163](https://github.com/ClickHouse/ClickHouse/pull/9163) ([alexey-milovidov](https://github.com/alexey-milovidov)) [#9345](https://github.com/ClickHouse/ClickHouse/pull/9345) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 异常处理现在已可在 Windows Subsystem for Linux 上正常运行。参见 [https://github.com/ClickHouse-Extras/libunwind/pull/3。此修复解决了](https://github.com/ClickHouse-Extras/libunwind/pull/3。此修复解决了) [#6480](https://github.com/ClickHouse/ClickHouse/issues/6480) [#9564](https://github.com/ClickHouse/ClickHouse/pull/9564) ([sobolevsv](https://github.com/sobolevsv))

<div id="clickhouse-release-v201630-2020-03-05">
  ### ClickHouse 发行版 v20.1.6.30，2020-03-05
</div>

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复使用 `T64` 编解码器压缩时的数据不兼容问题。
  [#9039](https://github.com/ClickHouse/ClickHouse/pull/9039) [(abyss7)](https://github.com/abyss7)
* 修复在单线程中从 MergeTree 表读取时的范围顺序问题。修复了 [#8964](https://github.com/ClickHouse/ClickHouse/issues/8964)。
  [#9050](https://github.com/ClickHouse/ClickHouse/pull/9050) [(CurtizJ)](https://github.com/CurtizJ)
* 修复了执行 `PREWHERE` 时 `MergeTreeRangeReader` 中可能出现的段错误。修复 [#9064](https://github.com/ClickHouse/ClickHouse/issues/9064)。
  [#9106](https://github.com/ClickHouse/ClickHouse/pull/9106) [(CurtizJ)](https://github.com/CurtizJ)
* 修复 `reinterpretAsFixedString` 应返回 `FixedString` 而非 `String` 的问题。
  [#9052](https://github.com/ClickHouse/ClickHouse/pull/9052) [(oandrew)](https://github.com/oandrew)
* 修复 `joinGet` 在返回 Nullable 类型时的问题。修复 [#8919](https://github.com/ClickHouse/ClickHouse/issues/8919)
  [#9014](https://github.com/ClickHouse/ClickHouse/pull/9014) [(amosbird)](https://github.com/amosbird)
* 修复 fuzz 测试以及 bitTestAll/bitTestAny 函数的错误行为。
  [#9143](https://github.com/ClickHouse/ClickHouse/pull/9143) [(alexey-milovidov)](https://github.com/alexey-milovidov)
* 修复 haystack 包含零字节时 `match` 和 `extract` 函数的行为问题。此前在 haystack 为常量时，行为不正确。修复 [#9160](https://github.com/ClickHouse/ClickHouse/issues/9160)
  [#9163](https://github.com/ClickHouse/ClickHouse/pull/9163) [(alexey-milovidov)](https://github.com/alexey-milovidov)
* 修复了使用非严格单调函数索引时反向谓词执行不正确的问题。修复了 [#9034](https://github.com/ClickHouse/ClickHouse/issues/9034)
  [#9223](https://github.com/ClickHouse/ClickHouse/pull/9223) [(Akazz)](https://github.com/Akazz)
* 允许在 `WHERE` 子句中包含 `[NOT] LIKE` 运算符时，将 `CROSS` 重写为 `INNER JOIN`。修复了 [#9191](https://github.com/ClickHouse/ClickHouse/issues/9191)
  [#9229](https://github.com/ClickHouse/ClickHouse/pull/9229) [(4ertus2)](https://github.com/4ertus2)
* 允许 Log 引擎表中的第一列 (或前几列) 为别名列。
  [#9231](https://github.com/ClickHouse/ClickHouse/pull/9231) [(abyss7)](https://github.com/abyss7)
* 允许在逗号 JOIN 中使用 `IN()`。修复了 [#7314](https://github.com/ClickHouse/ClickHouse/issues/7314)。
  [#9251](https://github.com/ClickHouse/ClickHouse/pull/9251) [(4ertus2)](https://github.com/4ertus2)
* 改进了 `ALTER MODIFY/ADD` 查询逻辑。现在，不能在不指定类型的情况下 `ADD` 列；`MODIFY` 默认表达式时不会更改列类型，而 `MODIFY` 类型时也不会丢失默认表达式的值。修复了 [#8669](https://github.com/ClickHouse/ClickHouse/issues/8669)。
  [#9227](https://github.com/ClickHouse/ClickHouse/pull/9227)  [(alesapin)](https://github.com/alesapin)
* 修复变更最终完成状态的问题：已完成的变更状态仍可能显示为 is\_done=0。
  [#9217](https://github.com/ClickHouse/ClickHouse/pull/9217) [(alesapin)](https://github.com/alesapin)
* 支持用于 system.numbers 和 system.numbers\_mt 的 "Processors" 管道。同时还修复了 `max_execution_time` 不生效的问题。
  [#7796](https://github.com/ClickHouse/ClickHouse/pull/7796)  [(KochetovNicolai)](https://github.com/KochetovNicolai)
* 修复 `DictCacheKeysRequestedFound` 指标计数错误。
  [#9411](https://github.com/ClickHouse/ClickHouse/pull/9411) [(nikitamikhaylov)](https://github.com/nikitamikhaylov)
* 在 `ATTACH PARTITION FROM`、`REPLACE PARTITION` 和 `MOVE TO TABLE` 中增加了对存储策略的检查，否则可能导致某个 part 中的数据在重启后无法访问，并使 ClickHouse 无法启动。
  [#9383](https://github.com/ClickHouse/ClickHouse/pull/9383) [(excitoon)](https://github.com/excitoon)
* 修复了 `MergeTreeIndexSet` 中的 UBSan 报告问题。此修复对应于 [#9250](https://github.com/ClickHouse/ClickHouse/issues/9250)
  [#9365](https://github.com/ClickHouse/ClickHouse/pull/9365) [(alexey-milovidov)](https://github.com/alexey-milovidov)
* 修复 BlockIO 中可能存在的数据竞争。
  [#9356](https://github.com/ClickHouse/ClickHouse/pull/9356) [(KochetovNicolai)](https://github.com/KochetovNicolai)
* 支持在 JSON 相关函数中处理无法放入 Int64 的 `UInt64` 数值。将 `SIMDJSON` 更新到 master。此修复解决了 [#9209](https://github.com/ClickHouse/ClickHouse/issues/9209)
  [#9344](https://github.com/ClickHouse/ClickHouse/pull/9344) [(alexey-milovidov)](https://github.com/alexey-milovidov)
* 修复了在数据目录挂载到独立设备时，可用空间计算不正确的问题。对于默认磁盘，可用空间改为从数据子目录中计算。此修复对应 [#7441](https://github.com/ClickHouse/ClickHouse/issues/7441)
  [#9257](https://github.com/ClickHouse/ClickHouse/pull/9257) [(millb)](https://github.com/millb)
* 修复了 TLS 连接可能因以下消息而失败的问题：`OpenSSL SSL_read: error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error and SSL Exception: error:2400006E:random number generator::error retrieving entropy.`。将 OpenSSL 更新到上游 master。
  [#8956](https://github.com/ClickHouse/ClickHouse/pull/8956) [(alexey-milovidov)](https://github.com/alexey-milovidov)
* 执行 `CREATE` 查询时，在存储引擎参数中对常量表达式进行折叠。将空的数据库名称替换为当前数据库。修复了 [#6508](https://github.com/ClickHouse/ClickHouse/issues/6508) 和 [#3492](https://github.com/ClickHouse/ClickHouse/issues/3492)。同时修复了 ClickHouseDictionarySource 中对本地地址的检查。
  [#9262](https://github.com/ClickHouse/ClickHouse/pull/9262) [(tabplubix)](https://github.com/tavplubix)
* 修复了 `StorageMerge` 中的段错误，该错误可能在从 StorageFile 读取时发生。
  [#9387](https://github.com/ClickHouse/ClickHouse/pull/9387) [(tabplubix)](https://github.com/tavplubix)
* 防止在极少数情况下，在读取 `suffix` 之后、提交之前发生异常时导致 `Kafka` 中的数据丢失。修复了 [#9378](https://github.com/ClickHouse/ClickHouse/issues/9378)。相关：[#7175](https://github.com/ClickHouse/ClickHouse/issues/7175)
  [#9507](https://github.com/ClickHouse/ClickHouse/pull/9507) [(filimonov)](https://github.com/filimonov)
* 修复了一个缺陷：对于因参数错误而创建的 `Kafka` 表，在尝试使用或删除时会导致服务器终止。修复了 [#9494](https://github.com/ClickHouse/ClickHouse/issues/9494)。合并了 [#9507](https://github.com/ClickHouse/ClickHouse/issues/9507)。
  [#9513](https://github.com/ClickHouse/ClickHouse/pull/9513) [(filimonov)](https://github.com/filimonov)

<div id="new-feature">
  #### 新功能
</div>

* 添加 `deduplicate_blocks_in_dependent_materialized_views` 选项，用于控制对带有 materialized view 的表执行幂等插入时的行为。应 Altinity 的特别请求，这项新功能已加入该 bugfix 版本。
  [#9070](https://github.com/ClickHouse/ClickHouse/pull/9070) [(urykhy)](https://github.com/urykhy)

<div id="clickhouse-release-v20124-2020-01-22">
  ### ClickHouse 发布 v20.1.2.4，2020-01-22
</div>

<div id="backward-incompatible-change-2">
  #### 向后不兼容的变更
</div>

* 设置 `merge_tree_uniform_read_distribution` 已废弃。服务器仍可识别该设置，但它已不再生效。[#8308](https://github.com/ClickHouse/ClickHouse/pull/8308) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将函数 `greatCircleDistance` 的返回类型更改为 `Float32`，因为现在计算结果就是 `Float32`。[#7993](https://github.com/ClickHouse/ClickHouse/pull/7993) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在要求查询参数使用“转义”格式表示。例如，要传递字符串 `a<tab>b`，必须写成 `a\tb` 或 `a\<tab>b`，相应地，在 URL 中则写成 `a%5Ctb` 或 `a%5C%09b`。这样做是为了支持将 NULL 作为 `\N` 传递。此更改修复了 [#7488](https://github.com/ClickHouse/ClickHouse/issues/7488)。[#8517](https://github.com/ClickHouse/ClickHouse/pull/8517) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 默认对 `ReplicatedMergeTree` 启用 `use_minimalistic_part_header_in_zookeeper` 设置。这将显著减少存储在 ZooKeeper 中的数据量。该设置自 19.1 版本起即受支持，并且我们已在多个服务的生产环境中使用半年多，未发现任何问题。如果你有可能降级到早于 19.1 的版本，请禁用此设置。[#6850](https://github.com/ClickHouse/ClickHouse/pull/6850) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 数据跳过索引现已可用于生产环境，并默认启用。设置 `allow_experimental_data_skipping_indices`、`allow_experimental_cross_to_join_conversion` 和 `allow_experimental_multiple_joins_emulation` 现已废弃且不再起作用。[#7974](https://github.com/ClickHouse/ClickHouse/pull/7974) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 `StorageJoin` 新增了与 `JOIN` 操作一致的 `ANY JOIN` 逻辑。若想在升级后保持行为不变，需要在 Join 表引擎表的元数据中添加 `SETTINGS any_join_distinct_right_table_keys = 1`，或者在升级后重新创建这些表。[#8400](https://github.com/ClickHouse/ClickHouse/pull/8400) ([Artem Zuikov](https://github.com/4ertus2))
* 现在需要重启服务器才能使日志配置中的更改生效。这是一个临时变通方案，用于避免服务器向已删除的日志文件写入日志的问题 (见 [#8696](https://github.com/ClickHouse/ClickHouse/issues/8696)) 。[#8707](https://github.com/ClickHouse/ClickHouse/pull/8707) ([Alexander Kuzmenkov](https://github.com/akuzm))

<div id="new-feature">
  #### 新功能
</div>

* 在 `system.merges` 中新增了有关分片路径的信息。[#8043](https://github.com/ClickHouse/ClickHouse/pull/8043) ([Vladimir Chebotarev](https://github.com/excitoon))
* 支持在 `ON CLUSTER` 模式下执行 `SYSTEM RELOAD DICTIONARY` 查询。[#8288](https://github.com/ClickHouse/ClickHouse/pull/8288) ([Guillaume Tassery](https://github.com/YiuRULE))
* 新增支持在 `ON CLUSTER` 模式下执行 `CREATE DICTIONARY` 查询。[#8163](https://github.com/ClickHouse/ClickHouse/pull/8163) ([alesapin](https://github.com/alesapin))
* 现在，`users.xml` 中的用户 profile 可以继承多个 profile。[#8343](https://github.com/ClickHouse/ClickHouse/pull/8343) ([Mikhail f. Shiryaev](https://github.com/Felixoid))
* 新增了 `system.stack_trace` 表，可用于查看所有服务器线程的堆栈跟踪。这对开发者了解服务器状态很有帮助。此更改修复了 [#7576](https://github.com/ClickHouse/ClickHouse/issues/7576)。[#8344](https://github.com/ClickHouse/ClickHouse/pull/8344) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增支持可配置子秒级精度的 `DateTime64` 数据类型。[#7170](https://github.com/ClickHouse/ClickHouse/pull/7170) ([Vasily Nemkov](https://github.com/Enmk))
* 新增表函数 `clusterAllReplicas`，可查询集群中的所有节点。[#8493](https://github.com/ClickHouse/ClickHouse/pull/8493) ([kiran sunkari](https://github.com/kiransunkari))
* 新增聚合函数 `categoricalInformationValue`，用于计算离散特征的信息值。[#8117](https://github.com/ClickHouse/ClickHouse/pull/8117) ([hcz](https://github.com/hczhcz))
* 通过并行解析，加快 `CSV`、`TSV` 和 `JSONEachRow` 格式数据文件的解析速度。[#7780](https://github.com/ClickHouse/ClickHouse/pull/7780) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 新增函数 `bankerRound`，用于执行银行家舍入。[#8112](https://github.com/ClickHouse/ClickHouse/pull/8112) ([hcz](https://github.com/hczhcz))
* 为区域名称的内置字典增加了对更多语言的支持：'ru'、'en'、'ua'、'uk'、'by'、'kz'、'tr'、'de'、'uz'、'lv'、'lt'、'et'、'pt'、'he'、'vi'。[#8189](https://github.com/ClickHouse/ClickHouse/pull/8189) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 改进了 `ANY JOIN` 逻辑的一致性。现在，`t1 ANY LEFT JOIN t2` 与 `t2 ANY RIGHT JOIN t1` 等价。[#7665](https://github.com/ClickHouse/ClickHouse/pull/7665) ([Artem Zuikov](https://github.com/4ertus2))
* 新增设置 `any_join_distinct_right_table_keys`，用于为 `ANY INNER JOIN` 启用旧版行为。[#7665](https://github.com/ClickHouse/ClickHouse/pull/7665) ([Artem Zuikov](https://github.com/4ertus2))
* 新增 `SEMI` 和 `ANTI JOIN`。原有的 `ANY INNER JOIN` 行为现可通过 `SEMI LEFT JOIN` 实现。[#7665](https://github.com/ClickHouse/ClickHouse/pull/7665) ([Artem Zuikov](https://github.com/4ertus2))
* 为 `File` 表引擎和 `file` 表函数新增了 `Distributed` 格式，可从异步插入到 `Distributed` 表时生成的 `.bin` 文件中读取数据。[#8535](https://github.com/ClickHouse/ClickHouse/pull/8535) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 为 `runningAccumulate` 添加可选的 reset 列参数，可在每个新的键值处重置聚合结果。[#8326](https://github.com/ClickHouse/ClickHouse/pull/8326) ([Sergey Kononenko](https://github.com/kononencheg))
* 新增支持将 ClickHouse 用作 Prometheus 端点。[#7900](https://github.com/ClickHouse/ClickHouse/pull/7900) ([vdimir](https://github.com/Vdimir))
* 在 `config.xml` 中新增 `<remote_url_allow_hosts>` 配置段，用于限制远程表引擎以及 `URL`、`S3`、`HDFS` 表函数可访问的主机。 [#7154](https://github.com/ClickHouse/ClickHouse/pull/7154) ([Mikhail Korotov](https://github.com/millb))
* 新增函数 `greatCircleAngle`，用于计算球面上的距离，单位为度。[#8105](https://github.com/ClickHouse/ClickHouse/pull/8105) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将地球半径修改为与 H3 库一致。[#8105](https://github.com/ClickHouse/ClickHouse/pull/8105) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了可用于输入和输出的 `JSONCompactEachRow` 和 `JSONCompactEachRowWithNamesAndTypes` 格式。[#7841](https://github.com/ClickHouse/ClickHouse/pull/7841) ([Mikhail Korotov](https://github.com/millb))
* 为文件相关的表引擎和表函数 (`File`、`S3`、`URL`、`HDFS`) 新增了一项功能：可根据额外的引擎参数或文件扩展名读取和写入 `gzip` 文件。[#7840](https://github.com/ClickHouse/ClickHouse/pull/7840) ([Andrey Bodrov](https://github.com/apbodrov))
* 新增了 `randomASCII(length)` 函数，用于生成由随机 [ASCII](https://en.wikipedia.org/wiki/ASCII#Printable_characters) 可打印字符组成的字符串。[#8401](https://github.com/ClickHouse/ClickHouse/pull/8401) ([BayoNet](https://github.com/BayoNet))
* 新增函数 `JSONExtractArrayRaw`，该函数可从 `JSON` 字符串中提取未解析的 JSON array 元素，并将其作为数组返回。[#8081](https://github.com/ClickHouse/ClickHouse/pull/8081) ([Oleg Matrokhin](https://github.com/errx))
* 新增 `arrayZip` 函数，支持将多个长度相同的数组组合成一个元组数组。[#8149](https://github.com/ClickHouse/ClickHouse/pull/8149) ([Winter Zhang](https://github.com/zhang2014))
* 新增了可根据已配置的 `TTL` 表达式在磁盘之间移动数据的功能，适用于 `*MergeTree` 表引擎家族。[#8140](https://github.com/ClickHouse/ClickHouse/pull/8140) ([Vladimir Chebotarev](https://github.com/excitoon))
* 新增聚合函数 `avgWeighted`，可用于计算加权平均值。[#7898](https://github.com/ClickHouse/ClickHouse/pull/7898) ([Andrey Bodrov](https://github.com/apbodrov))
* 现在，`TSV`、`TSKV`、`CSV` 和 `JSONEachRow` 格式默认启用并行解析。[#7894](https://github.com/ClickHouse/ClickHouse/pull/7894) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 新增多个来自 `H3` 库的地理空间函数：`h3GetResolution`、`h3EdgeAngle`、`h3EdgeLength`、`h3IsValid` 和 `h3kRing`。[#8034](https://github.com/ClickHouse/ClickHouse/pull/8034) ([Konstantin Malanchev](https://github.com/hombit))
* 在与文件相关的存储和表函数中新增了对 brotli (`br`) 压缩的支持，修复了 [#8156](https://github.com/ClickHouse/ClickHouse/issues/8156)。[#8526](https://github.com/ClickHouse/ClickHouse/pull/8526) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为 `SimpleAggregationFunction` 类型新增 `groupBit*` 函数。[#8485](https://github.com/ClickHouse/ClickHouse/pull/8485) ([Guillaume Tassery](https://github.com/YiuRULE))

<div id="bug-fix">
  #### 缺陷修复
</div>

* 修复 `Distributed` 引擎表的重命名问题。修复了问题 [#7868](https://github.com/ClickHouse/ClickHouse/issues/7868)。[#8306](https://github.com/ClickHouse/ClickHouse/pull/8306) ([tavplubix](https://github.com/tavplubix))
* 现在，字典已支持在非 ClickHouse SQL 方言中为属性使用任意字符串形式的 `EXPRESSION`。[#8098](https://github.com/ClickHouse/ClickHouse/pull/8098) ([alesapin](https://github.com/alesapin))
* 修复损坏的 `INSERT SELECT FROM mysql(...)` 查询。这修复了 [#8070](https://github.com/ClickHouse/ClickHouse/issues/8070) 和 [#7960](https://github.com/ClickHouse/ClickHouse/issues/7960)。[#8234](https://github.com/ClickHouse/ClickHouse/pull/8234) ([tavplubix](https://github.com/tavplubix))
* 修复从 `JSONEachRow` 插入默认 `Tuple` 时出现的错误 "Mismatch column sizes"。此修复解决了 [#5653](https://github.com/ClickHouse/ClickHouse/issues/5653)。[#8606](https://github.com/ClickHouse/ClickHouse/pull/8606) ([tavplubix](https://github.com/tavplubix))
* 现在，如果同时使用 `WITH TIES` 和 `LIMIT BY`，将会抛出异常。还新增了 `TOP` 与 `LIMIT BY` 结合使用的功能。此修复对应 [#7472](https://github.com/ClickHouse/ClickHouse/issues/7472)。[#7637](https://github.com/ClickHouse/ClickHouse/pull/7637) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 修复 `clickhouse-odbc-bridge` 可执行文件对较新版本 glibc 的意外依赖。[#8046](https://github.com/ClickHouse/ClickHouse/pull/8046) ([Amos Bird](https://github.com/amosbird))
* 修复了 `*MergeTree` 引擎家族中 `check` 函数的缺陷。现在，在最后一个粒度和最后一个标记中的行数相同 (非 FINAL) 时，不会再报错。 [#8047](https://github.com/ClickHouse/ClickHouse/pull/8047) ([alesapin](https://github.com/alesapin))
* 修复在执行 `ALTER` 查询后向 `Enum*` 列插入数据时的问题：当底层数值类型与表中指定的类型一致时，会出现该问题。此修复解决了 [#7836](https://github.com/ClickHouse/ClickHouse/issues/7836)。[#7908](https://github.com/ClickHouse/ClickHouse/pull/7908) ([Anton Popov](https://github.com/CurtizJ))
* 允许函数 `substring` 的 "size" 参数使用非常量负值。此前这是误判为不允许的。此修复解决了 [#4832](https://github.com/ClickHouse/ClickHouse/issues/4832)。[#7703](https://github.com/ClickHouse/ClickHouse/pull/7703) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复向 `(O|J)DBC` 表引擎传入错误数量的参数时出现的解析问题。[#7709](https://github.com/ClickHouse/ClickHouse/pull/7709) ([alesapin](https://github.com/alesapin))
* 向 syslog 发送日志时，现会使用正在运行的 ClickHouse 进程的命令名。此前版本使用的是空字符串，而不是命令名。[#8460](https://github.com/ClickHouse/ClickHouse/pull/8460) ([Michael Nacharov](https://github.com/mnach))
* 修复对 `localhost` 允许主机的检查问题。此 PR 修复了 [#8241](https://github.com/ClickHouse/ClickHouse/pull/8241) 中提供的方案。[#8342](https://github.com/ClickHouse/ClickHouse/pull/8342) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复了一个罕见崩溃问题：在 `argMin` 和 `argMax` 函数处理长字符串参数时，如果其结果用于 `runningAccumulate` 函数，就可能发生崩溃。此修复解决了 [#8325](https://github.com/ClickHouse/ClickHouse/issues/8325) [#8341](https://github.com/ClickHouse/ClickHouse/pull/8341) ([dinosaur](https://github.com/769344359))
* 修复了 `Buffer` 引擎表中的内存 overcommit 问题。[#8345](https://github.com/ClickHouse/ClickHouse/pull/8345) ([Azat Khuzhin](https://github.com/azat))
* 修复了一个潜在缺陷：某些函数可将 `NULL` 作为参数之一，且返回值为非 `NULL`。[#8196](https://github.com/ClickHouse/ClickHouse/pull/8196) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 改进了 `MergeTree` 表引擎后台进程线程池的指标计算。[#8194](https://github.com/ClickHouse/ClickHouse/pull/8194) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复在存在行级表过滤器时 `WHERE` 语句中 `IN` 函数的问题。修复了 [#6687](https://github.com/ClickHouse/ClickHouse/issues/6687) [#8357](https://github.com/ClickHouse/ClickHouse/pull/8357) ([Ivan](https://github.com/abyss7))
* 现在，如果设置值中的整数值未能被完全解析，就会抛出异常。[#7678](https://github.com/ClickHouse/ClickHouse/pull/7678) ([Mikhail Korotov](https://github.com/millb))
* 修复了在对包含两个以上本地分片的分布式表进行查询时使用聚合函数会触发异常的问题。[#8164](https://github.com/ClickHouse/ClickHouse/pull/8164) ([小路](https://github.com/nicelulu))
* 现在 bloom filter 可以处理长度为零的数组，且不会进行冗余计算。[#8242](https://github.com/ClickHouse/ClickHouse/pull/8242) ([achimbab](https://github.com/achimbab))
* 修复了通过将客户端主机与 `users.xml` 中指定的 `host_regexp` 进行匹配来检查其是否被允许的逻辑。[#8241](https://github.com/ClickHouse/ClickHouse/pull/8241) ([Vitaly Baranov](https://github.com/vitlibar))
* 放宽了在多个 `JOIN ON` 子句中会导致误报的歧义列检查。[#8385](https://github.com/ClickHouse/ClickHouse/pull/8385) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了一个可能导致服务器崩溃 (`std::terminate`) 的问题：当服务器无法以 `JSON` 或 `XML` 格式发送或写入包含 `String` 数据类型值 (需要进行 `UTF-8` 验证) 的数据时，或在使用 Brotli 算法压缩结果数据时，以及在其他一些罕见情况下，可能会触发该问题。此修复解决了 [#7603](https://github.com/ClickHouse/ClickHouse/issues/7603) [#8384](https://github.com/ClickHouse/ClickHouse/pull/8384) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 CI 发现的 `StorageDistributedDirectoryMonitor` 中的竞态条件问题。此修复解决了 [#8364](https://github.com/ClickHouse/ClickHouse/issues/8364)。[#8383](https://github.com/ClickHouse/ClickHouse/pull/8383) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 现在，`*MergeTree` 表引擎家族中的后台合并会更准确地保留存储策略中卷的顺序。[#8549](https://github.com/ClickHouse/ClickHouse/pull/8549) ([Vladimir Chebotarev](https://github.com/excitoon))
* 现在，`Kafka` 表引擎已可正确支持 `Native` 格式。这修复了 [#6731](https://github.com/ClickHouse/ClickHouse/issues/6731) [#7337](https://github.com/ClickHouse/ClickHouse/issues/7337) [#8003](https://github.com/ClickHouse/ClickHouse/issues/8003)。[#8016](https://github.com/ClickHouse/ClickHouse/pull/8016) ([filimonov](https://github.com/filimonov))
* 修复了带表头的格式 (如 `CSVWithNames`) 在用于表引擎 `Kafka` 时因 EOF 抛出异常的问题。[#8016](https://github.com/ClickHouse/ClickHouse/pull/8016) ([filimonov](https://github.com/filimonov))
* 修复了在 `IN` 子句右侧从子查询构建 Set 时的一个 bug。此修复解决了 [#5767](https://github.com/ClickHouse/ClickHouse/issues/5767) 和 [#2542](https://github.com/ClickHouse/ClickHouse/issues/2542)。[#7755](https://github.com/ClickHouse/ClickHouse/pull/7755) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 修复从 `File` 存储读取时可能发生的崩溃。[#7756](https://github.com/ClickHouse/ClickHouse/pull/7756) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了读取包含 `list` 类型列的 `Parquet` 格式文件时的问题。[#8334](https://github.com/ClickHouse/ClickHouse/pull/8334) ([maxulan](https://github.com/maxulan))
* 修复了以下错误：当 `max_parallel_replicas > 1` 时，对于带有依赖于采样键的 `PREWHERE` 条件的分布式查询，会报 `Not found column`。 [#7913](https://github.com/ClickHouse/ClickHouse/pull/7913) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了以下错误：当查询使用依赖于表别名的 `PREWHERE`，且由于主键条件导致结果集为空时，会报 `Not found column` 错误。[#7911](https://github.com/ClickHouse/ClickHouse/pull/7911) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了函数 `rand` 和 `randConstant` 在参数为 `Nullable` 时的返回类型。现在这些函数始终返回 `UInt32`，不会再返回 `Nullable(UInt32)`。[#8204](https://github.com/ClickHouse/ClickHouse/pull/8204) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 已禁用 `WITH FILL` 表达式的谓词下推。此修复解决了 [#7784](https://github.com/ClickHouse/ClickHouse/issues/7784)。[#7789](https://github.com/ClickHouse/ClickHouse/pull/7789) ([Winter Zhang](https://github.com/zhang2014))
* 修复了在使用 `FINAL` 子句时，`SummingMergeTree` 的 `count()` 结果不正确的问题。[#3280](https://github.com/ClickHouse/ClickHouse/issues/3280) [#7786](https://github.com/ClickHouse/ClickHouse/pull/7786) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 修复了远程服务器上的常量函数可能返回错误结果的问题。该问题会出现在包含 `version()`、`uptime()` 等函数的查询中，因为这些函数在不同服务器上会返回不同的常量值。此修复解决了 [#7666](https://github.com/ClickHouse/ClickHouse/issues/7666)。[#7689](https://github.com/ClickHouse/ClickHouse/pull/7689) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了谓词下推优化中的一个复杂 bug，该问题会导致结果错误。这一修复解决了谓词下推优化中的许多问题。[#8503](https://github.com/ClickHouse/ClickHouse/pull/8503) ([Winter Zhang](https://github.com/zhang2014))
* 修复 `CREATE TABLE .. AS dictionary` 查询导致的崩溃问题。[#8508](https://github.com/ClickHouse/ClickHouse/pull/8508) ([Azat Khuzhin](https://github.com/azat))
* 改进了 `.g4` 文件中的 ClickHouse 语法。[#8294](https://github.com/ClickHouse/ClickHouse/pull/8294) ([taiyang-li](https://github.com/taiyang-li))
* 修复了一个会导致使用 `Join` 引擎的表在 `JOIN` 操作中崩溃的 bug。此修复解决了 [#7556](https://github.com/ClickHouse/ClickHouse/issues/7556) [#8254](https://github.com/ClickHouse/ClickHouse/issues/8254) [#7915](https://github.com/ClickHouse/ClickHouse/issues/7915) [#8100](https://github.com/ClickHouse/ClickHouse/issues/8100)。 [#8298](https://github.com/ClickHouse/ClickHouse/pull/8298) ([Artem Zuikov](https://github.com/4ertus2))
* 修复 `CREATE DATABASE` 时重复触发的字典重新加载问题。[#7916](https://github.com/ClickHouse/ClickHouse/pull/7916) ([Azat Khuzhin](https://github.com/azat))
* 限制从 `StorageFile` 和 `StorageHDFS` 读取时的最大流数。修复了 [#7650](https://github.com/ClickHouse/ClickHouse/issues/7650)。[#7981](https://github.com/ClickHouse/ClickHouse/pull/7981) ([alesapin](https://github.com/alesapin))
* 修复了 `ALTER ... MODIFY ... CODEC` 查询中的一个问题：当用户同时指定默认表达式和 codec 时，会出错。修复了 [8593](https://github.com/ClickHouse/ClickHouse/issues/8593)。[#8614](https://github.com/ClickHouse/ClickHouse/pull/8614) ([alesapin](https://github.com/alesapin))
* 修复后台合并 `SimpleAggregateFunction(LowCardinality)` 类型列时出现的错误。[#8613](https://github.com/ClickHouse/ClickHouse/pull/8613) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了函数 `toDateTime64` 的类型检查问题。[#8375](https://github.com/ClickHouse/ClickHouse/pull/8375) ([Vasily Nemkov](https://github.com/Enmk))
* 现在，服务器在使用 Join 引擎且 `join_use_nulls` 设置不受支持时，不会因 `LEFT` 或 `FULL JOIN` 而崩溃。[#8479](https://github.com/ClickHouse/ClickHouse/pull/8479) ([Artem Zuikov](https://github.com/4ertus2))
* 现在，即使 `db` 不存在，`DROP DICTIONARY IF EXISTS db.dict` 查询也不会抛出异常。[#8185](https://github.com/ClickHouse/ClickHouse/pull/8185) ([Vitaly Baranov](https://github.com/vitlibar))
* 修复了表函数 (`file`、`mysql`、`remote`) 中因引用已删除的 `IStorage` 对象而可能导致的崩溃问题。修复了向表函数插入数据时所指定列的解析错误。[#7762](https://github.com/ClickHouse/ClickHouse/pull/7762) ([tavplubix](https://github.com/tavplubix))
* 确保在启动 `clickhouse-server` 之前网络已就绪。这修复了 [#7507](https://github.com/ClickHouse/ClickHouse/issues/7507)。[#8570](https://github.com/ClickHouse/ClickHouse/pull/8570) ([Zhichang Yu](https://github.com/yuzhichang))
* 修复了安全连接的超时处理问题，避免查询无限期挂起。此修复对应于 [#8126](https://github.com/ClickHouse/ClickHouse/issues/8126)。[#8128](https://github.com/ClickHouse/ClickHouse/pull/8128) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 `clickhouse-copier` 中并发工作线程之间不必要的争用。[#7816](https://github.com/ClickHouse/ClickHouse/pull/7816) ([Ding Xiang Fei](https://github.com/dingxiangfei2009))
* 现在，变更不会跳过已附加的 parts，即使它们的变更版本大于当前变更版本也是如此。 [#7812](https://github.com/ClickHouse/ClickHouse/pull/7812) ([Zhichang Yu](https://github.com/yuzhichang)) [#8250](https://github.com/ClickHouse/ClickHouse/pull/8250) ([alesapin](https://github.com/alesapin))
* 在将 `*MergeTree` 数据分区片段移动到另一块磁盘并重启服务器后，忽略其冗余副本。[#7810](https://github.com/ClickHouse/ClickHouse/pull/7810) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了在 `JOIN` 键中使用 `LowCardinality` 时 `FULL JOIN` 发生崩溃的问题。[#8252](https://github.com/ClickHouse/ClickHouse/pull/8252) ([Artem Zuikov](https://github.com/4ertus2))
* 禁止在插入查询中重复使用同一列名，例如 `INSERT INTO tbl (x, y, x)`。此修复解决了 [#5465](https://github.com/ClickHouse/ClickHouse/issues/5465) 和 [#7681](https://github.com/ClickHouse/ClickHouse/issues/7681)。[#7685](https://github.com/ClickHouse/ClickHouse/pull/7685) ([alesapin](https://github.com/alesapin))
* 为未知 CPU 增加了检测物理 CPU 核心数量的 fallback 机制 (使用逻辑 CPU 核心数) 。这修复了 [#5239](https://github.com/ClickHouse/ClickHouse/issues/5239)。[#7726](https://github.com/ClickHouse/ClickHouse/pull/7726) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了物化列和别名列报 `There's no column` 错误的问题。[#8210](https://github.com/ClickHouse/ClickHouse/pull/8210) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在未使用 `TABLE` 或 `DICTIONARY` 限定符时使用 `EXISTS` 查询导致的严重崩溃问题，例如 `EXISTS t`。此修复解决了 [#8172](https://github.com/ClickHouse/ClickHouse/issues/8172)。该问题是在 19.17 版本中引入的。[#8213](https://github.com/ClickHouse/ClickHouse/pull/8213) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了一个罕见问题：使用 `SimpleAggregateFunction` 列时，可能会出现 `"Sizes of columns does not match"` 报错。[#7790](https://github.com/ClickHouse/ClickHouse/pull/7790) ([Boris Granveaud](https://github.com/bgranvea))
* 修复了一个问题：当用户的 `allow_databases` 为空时，会被授予对所有数据库的访问权限 (`allow_dictionaries` 也存在同样的问题) 。[#7793](https://github.com/ClickHouse/ClickHouse/pull/7793) ([DeifyTheGod](https://github.com/DeifyTheGod))
* 修复了服务器已断开与客户端连接时客户端崩溃的问题。[#8071](https://github.com/ClickHouse/ClickHouse/pull/8071) ([Azat Khuzhin](https://github.com/azat))
* 修复按主键前缀和非主键后缀排序时 `ORDER BY` 的行为异常。[#7759](https://github.com/ClickHouse/ClickHouse/pull/7759) ([Anton Popov](https://github.com/CurtizJ))
* 检查表中是否存在带限定符的列。此项修复了 [#6836](https://github.com/ClickHouse/ClickHouse/issues/6836)。[#7758](https://github.com/ClickHouse/ClickHouse/pull/7758) ([Artem Zuikov](https://github.com/4ertus2))
* 修复了在合并完成后立即执行 `ALTER MOVE` 时会移动指定 superpart 的问题。修复了 [#8103](https://github.com/ClickHouse/ClickHouse/issues/8103)。[#8104](https://github.com/ClickHouse/ClickHouse/pull/8104) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了在使用 `UNION` 且列数不一致时，服务器可能崩溃的问题。修复 [#7279](https://github.com/ClickHouse/ClickHouse/issues/7279)。[#7929](https://github.com/ClickHouse/ClickHouse/pull/7929) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复 `substr` 函数在 size 为负数时返回子串长度不正确的问题。[#8589](https://github.com/ClickHouse/ClickHouse/pull/8589) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 现在，如果后台线程池中没有足够的空闲线程，服务器将不会在 `MergeTree` 中执行 part mutation。 [#8588](https://github.com/ClickHouse/ClickHouse/pull/8588) ([tavplubix](https://github.com/tavplubix))
* 修复了格式化 `UNION ALL` AST 时的一个小笔误。[#7999](https://github.com/ClickHouse/ClickHouse/pull/7999) ([litao91](https://github.com/litao91))
* 修复了负数的 bloom filter 结果不正确的问题。该修复解决了 [#8317](https://github.com/ClickHouse/ClickHouse/issues/8317)。[#8566](https://github.com/ClickHouse/ClickHouse/pull/8566) ([Winter Zhang](https://github.com/zhang2014))
* 修复了 `decompress` 中一个潜在的缓冲区溢出问题。恶意用户可传入伪造的压缩数据，从而导致缓冲区越界读取。该问题由 Yandex 信息安全团队的 Eldar Zaitov 发现。[#8404](https://github.com/ClickHouse/ClickHouse/pull/8404) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了因 `arrayIntersect` 中整数溢出而导致结果错误的问题。[#7777](https://github.com/ClickHouse/ClickHouse/pull/7777) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 现在，`OPTIMIZE TABLE` 查询不再等待离线副本执行该操作。[#8314](https://github.com/ClickHouse/ClickHouse/pull/8314) ([javi santana](https://github.com/javisantana))
* 修复了 `Replicated*MergeTree` 表中 `ALTER TTL` 的解析器问题。[#8318](https://github.com/ClickHouse/ClickHouse/pull/8318) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复服务器与客户端之间的通信问题，使服务器能够在查询失败后读取临时表信息。[#8084](https://github.com/ClickHouse/ClickHouse/pull/8084) ([Azat Khuzhin](https://github.com/azat))
* 修复 `bitmapAnd` 函数在对聚合 bitmap 和标量 bitmap 求交时出现的错误。[#8082](https://github.com/ClickHouse/ClickHouse/pull/8082) ([Yue Huang](https://github.com/moon03432))
* 根据 ZooKeeper Programmer's Guide 细化 `ZXid` 的定义，修复了 `clickhouse-cluster-copier` 中的一个 bug。[#8088](https://github.com/ClickHouse/ClickHouse/pull/8088) ([Ding Xiang Fei](https://github.com/dingxiangfei2009))
* `odbc` 表函数现已遵循 `external_table_functions_use_nulls` 设置。[#7506](https://github.com/ClickHouse/ClickHouse/pull/7506) ([Vasily Nemkov](https://github.com/Enmk))
* 修复了一个会导致罕见数据竞争问题的错误。[#8143](https://github.com/ClickHouse/ClickHouse/pull/8143) ([Alexander Kazakov](https://github.com/Akazz))
* 现在，`SYSTEM RELOAD DICTIONARY` 会完整重载字典，忽略 `update_field`。此修复解决了 [#7440](https://github.com/ClickHouse/ClickHouse/issues/7440)。[#8037](https://github.com/ClickHouse/ClickHouse/pull/8037) ([Vitaly Baranov](https://github.com/vitlibar))
* 为 CREATE 查询添加了检查字典是否存在的功能。[#8032](https://github.com/ClickHouse/ClickHouse/pull/8032) ([alesapin](https://github.com/alesapin))
* 修复 `Values` 格式中 `Float*` 的解析问题。此项修复解决了 [#7817](https://github.com/ClickHouse/ClickHouse/issues/7817)。[#7870](https://github.com/ClickHouse/ClickHouse/pull/7870) ([tavplubix](https://github.com/tavplubix))
* 修复了 `*MergeTree` 表引擎家族某些后台操作在无法预留空间时发生崩溃的问题。[#7873](https://github.com/ClickHouse/ClickHouse/pull/7873) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复表包含 `SimpleAggregateFunction(LowCardinality)` 列时合并操作崩溃的问题。此修复解决了 [#8515](https://github.com/ClickHouse/ClickHouse/issues/8515)。[#8522](https://github.com/ClickHouse/ClickHouse/pull/8522) ([Azat Khuzhin](https://github.com/azat))
* 恢复对所有 ICU 区域设置的支持，并增加了将排序规则应用于常量表达式的能力。同时，在 `system.collations` 表中添加了语言名称。[#8051](https://github.com/ClickHouse/ClickHouse/pull/8051) ([alesapin](https://github.com/alesapin))
* 修复了外部字典在最小生命周期为零 (`LIFETIME(MIN 0 MAX N)`, `LIFETIME(N)`) 时无法在后台更新的问题。 [#7983](https://github.com/ClickHouse/ClickHouse/pull/7983) ([alesapin](https://github.com/alesapin))
* 修复了使用 ClickHouse 作为源的外部字典在其查询中包含子查询时发生崩溃的问题。[#8351](https://github.com/ClickHouse/ClickHouse/pull/8351) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 修复了使用 `URL` 引擎的表中文件扩展名解析错误的问题。此修复对应 [#8157](https://github.com/ClickHouse/ClickHouse/issues/8157)。[#8419](https://github.com/ClickHouse/ClickHouse/pull/8419) ([Andrey Bodrov](https://github.com/apbodrov))
* 修复了无 key 的 `*MergeTree` 表上的 `CHECK TABLE` 查询问题。修复 [#7543](https://github.com/ClickHouse/ClickHouse/issues/7543)。[#7979](https://github.com/ClickHouse/ClickHouse/pull/7979) ([alesapin](https://github.com/alesapin))
* 修复了 `Float64` 到 MySQL 类型的转换问题。[#8079](https://github.com/ClickHouse/ClickHouse/pull/8079) ([Yuriy Baranov](https://github.com/yurriy))
* 现在，如果某个表因服务器崩溃而未被完全删除，服务器会尝试将其恢复并加载。[#8176](https://github.com/ClickHouse/ClickHouse/pull/8176) ([tavplubix](https://github.com/tavplubix))
* 修复了表函数 `file` 在向不存在的文件插入数据时发生崩溃的问题。现在遇到这种情况时，会先创建文件，再执行插入。 [#8177](https://github.com/ClickHouse/ClickHouse/pull/8177) ([Olga Khvostikova](https://github.com/stavrolia))
* 修复了在启用 `trace_log` 时可能发生的罕见死锁问题。[#7838](https://github.com/ClickHouse/ClickHouse/pull/7838) ([filimonov](https://github.com/filimonov))
* 为通过 DDL 查询创建的 `RangeHashed` 外部字典新增了对 `Date` 之外其他类型的支持。修复了 [7899](https://github.com/ClickHouse/ClickHouse/issues/7899)。[#8275](https://github.com/ClickHouse/ClickHouse/pull/8275) ([alesapin](https://github.com/alesapin))
* 修复了将另一个函数的结果传给 `now64()` 时发生崩溃的问题。[#8270](https://github.com/ClickHouse/ClickHouse/pull/8270) ([Vasily Nemkov](https://github.com/Enmk))
* 修复了通过 MySQL wire 协议连接时无法正确检测客户端 IP 的问题。[#7743](https://github.com/ClickHouse/ClickHouse/pull/7743) ([Dmitry Muzyka](https://github.com/dmitriy-myz))
* 修复 `arraySplit` 函数对空数组的处理问题。此修复解决了 [#7708](https://github.com/ClickHouse/ClickHouse/issues/7708)。[#7747](https://github.com/ClickHouse/ClickHouse/pull/7747) ([hcz](https://github.com/hczhcz))
* 修复了可能误删另一个正在运行的 `clickhouse-server` 的 `pid-file` 的问题。[#8487](https://github.com/ClickHouse/ClickHouse/pull/8487) ([Weiqing Xu](https://github.com/weiqxu))
* 修复了带有 `invalidate_query` 的字典重新加载问题：此前该问题会导致更新停止，并在之前尝试更新时抛出某些异常。[#8029](https://github.com/ClickHouse/ClickHouse/pull/8029) ([alesapin](https://github.com/alesapin))
* 修复了函数 `arrayReduce` 中可能导致 "double free" 的错误，以及聚合函数组合器 `Resample` 中可能导致内存泄漏的问题。新增了聚合函数 `aggThrow`，可用于测试。[#8446](https://github.com/ClickHouse/ClickHouse/pull/8446) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="improvement">
  #### 改进
</div>

* 改进了使用 `S3` 表引擎时的日志记录。[#8251](https://github.com/ClickHouse/ClickHouse/pull/8251) ([Grigory Pervakov](https://github.com/GrigoryPervakov))
* 调用 `clickhouse-local` 时如果未传入任何参数，则会输出帮助信息。此修复解决了 [#5335](https://github.com/ClickHouse/ClickHouse/issues/5335)。[#8230](https://github.com/ClickHouse/ClickHouse/pull/8230) ([Andrey Nagorny](https://github.com/Melancholic))
* 添加设置 `mutations_sync`，支持同步等待 `ALTER UPDATE/DELETE` 查询完成。[#8237](https://github.com/ClickHouse/ClickHouse/pull/8237) ([alesapin](https://github.com/alesapin))
* 允许在 `config.xml` 中将 `user_files_path` 设置为相对路径 (方式类似于 `format_schema_path`) 。 [#7632](https://github.com/ClickHouse/ClickHouse/pull/7632) ([hcz](https://github.com/hczhcz))
* 为带有 `-OrZero` 后缀的转换函数新增了针对非法类型抛出异常的处理。[#7880](https://github.com/ClickHouse/ClickHouse/pull/7880) ([Andrey Konyaev](https://github.com/akonyaev90))
* 简化分布式查询中将数据发送到分片时的请求头格式。[#8044](https://github.com/ClickHouse/ClickHouse/pull/8044) ([Vitaly Baranov](https://github.com/vitlibar))
* `Live View` 表引擎重构。[#8519](https://github.com/ClickHouse/ClickHouse/pull/8519) ([vzakaznikov](https://github.com/vzakaznikov))
* 为通过 DDL 查询语句创建的外部字典新增额外检查。[#8127](https://github.com/ClickHouse/ClickHouse/pull/8127) ([alesapin](https://github.com/alesapin))
* 修复同时使用 `FINAL` 和 `SAMPLE` 时出现 `Column ... already exists` 错误的问题，例如 `select count() from table final sample 1/2`。修复了 [#5186](https://github.com/ClickHouse/ClickHouse/issues/5186)。[#7907](https://github.com/ClickHouse/ClickHouse/pull/7907) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 现在，`joinGet` 函数的第一个参数可以使用表标识符。[#7707](https://github.com/ClickHouse/ClickHouse/pull/7707) ([Amos Bird](https://github.com/amosbird))
* 允许在 `Kafka` 表上方使用带子查询的 `MaterializedView`。[#8197](https://github.com/ClickHouse/ClickHouse/pull/8197) ([filimonov](https://github.com/filimonov))
* 现在，磁盘间的后台移动操作会在独立的线程池中运行。[#7670](https://github.com/ClickHouse/ClickHouse/pull/7670) ([Vladimir Chebotarev](https://github.com/excitoon))
* `SYSTEM RELOAD DICTIONARY` 现在会同步执行。[#8240](https://github.com/ClickHouse/ClickHouse/pull/8240) ([Vitaly Baranov](https://github.com/vitlibar))
* 现在，堆栈跟踪显示的是物理地址 (对象文件中的偏移量) ，而不是虚拟内存地址 (对象文件加载到的位置) 。这样一来，即使二进制文件是位置无关的且启用了 ASLR，也可以使用 `addr2line`。这修复了 [#8360](https://github.com/ClickHouse/ClickHouse/issues/8360)。[#8387](https://github.com/ClickHouse/ClickHouse/pull/8387) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 支持行级安全过滤器的新语法：`<table name='table_name'>...</table>`。修复了 [#5779](https://github.com/ClickHouse/ClickHouse/issues/5779)。[#8381](https://github.com/ClickHouse/ClickHouse/pull/8381) ([Ivan](https://github.com/abyss7))
* 现在，`cityHash` 函数已支持 `Decimal` 和 `UUID` 类型。修复了 [#5184](https://github.com/ClickHouse/ClickHouse/issues/5184)。[#7693](https://github.com/ClickHouse/ClickHouse/pull/7693) ([Mikhail Korotov](https://github.com/millb))
* 由于已实现自适应粒度，固定索引粒度 (原为 1024) 在系统日志中已过时，因此已被移除。[#7698](https://github.com/ClickHouse/ClickHouse/pull/7698) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在未启用 SSL 编译 ClickHouse 时，启用了 MySQL 兼容服务器。[#7852](https://github.com/ClickHouse/ClickHouse/pull/7852) ([Yuriy Baranov](https://github.com/yurriy))
* 现在，服务器会对分布式批次计算校验和，因此当批次中的数据损坏时，能够提供更详细的错误信息。[#7914](https://github.com/ClickHouse/ClickHouse/pull/7914) ([Azat Khuzhin](https://github.com/azat))
* 为 `MySQL` 数据库引擎支持 `DROP DATABASE`、`DETACH TABLE`、`DROP TABLE` 和 `ATTACH TABLE`。[#8202](https://github.com/ClickHouse/ClickHouse/pull/8202) ([Winter Zhang](https://github.com/zhang2014))
* 为 S3 表函数和表引擎添加身份验证功能。[#7623](https://github.com/ClickHouse/ClickHouse/pull/7623) ([Vladimir Chebotarev](https://github.com/excitoon))
* 增加了对位于不同磁盘上的额外 `MergeTree` parts 的检查，以避免遗漏未定义磁盘上的数据分区片段。[#8118](https://github.com/ClickHouse/ClickHouse/pull/8118) ([Vladimir Chebotarev](https://github.com/excitoon))
* 为 Mac 客户端和服务器启用 SSL 支持。[#8297](https://github.com/ClickHouse/ClickHouse/pull/8297) ([Ivan](https://github.com/abyss7))
* 现在 ClickHouse 可以充当 MySQL federated server (参见 [https://dev.mysql.com/doc/refman/5.7/en/federated-create-server.html](https://dev.mysql.com/doc/refman/5.7/en/federated-create-server.html)) 。[#7717](https://github.com/ClickHouse/ClickHouse/pull/7717) ([Maxim Fedotov](https://github.com/MaxFedotov))
* `clickhouse-client` 现在仅在启用 multiquery 且关闭 multiline 时才会启用 `bracketed-paste`。此更改修复了 [#7757](https://github.com/ClickHouse/ClickHouse/issues/7757)。[#7761](https://github.com/ClickHouse/ClickHouse/pull/7761) ([Amos Bird](https://github.com/amosbird))
* 支持 `if` 函数中的 `Array(Decimal)`。[#7721](https://github.com/ClickHouse/ClickHouse/pull/7721) ([Artem Zuikov](https://github.com/4ertus2))
* `arrayDifference`、`arrayCumSum` 和 `arrayCumSumNegative` 函数支持 Decimal 类型。[#7724](https://github.com/ClickHouse/ClickHouse/pull/7724) ([Artem Zuikov](https://github.com/4ertus2))
* 在 `system.dictionaries` 表中新增了 `lifetime` 列。[#6820](https://github.com/ClickHouse/ClickHouse/issues/6820) [#7727](https://github.com/ClickHouse/ClickHouse/pull/7727) ([kekekekule](https://github.com/kekekekule))
* 改进了对 `*MergeTree` 表引擎在不同磁盘上现有 parts 的检查。修复了 [#7660](https://github.com/ClickHouse/ClickHouse/issues/7660)。[#8440](https://github.com/ClickHouse/ClickHouse/pull/8440) ([Vladimir Chebotarev](https://github.com/excitoon))
* 集成了用于 `S3` 交互的 `AWS SDK`，可开箱即用地使用 S3 的全部功能。[#8011](https://github.com/ClickHouse/ClickHouse/pull/8011) ([Pavel Kovalenko](https://github.com/Jokser))
* 已支持在 `Live View` 表中使用子查询。[#7792](https://github.com/ClickHouse/ClickHouse/pull/7792) ([vzakaznikov](https://github.com/vzakaznikov))
* 已取消对在 `TTL` 表达式中使用 `Date` 或 `DateTime` 列的检查。[#7920](https://github.com/ClickHouse/ClickHouse/pull/7920) ([Vladimir Chebotarev](https://github.com/excitoon))
* 在 `system.detached_parts` 表中添加了磁盘相关信息。[#7833](https://github.com/ClickHouse/ClickHouse/pull/7833) ([Vladimir Chebotarev](https://github.com/excitoon))
* 现在可在无需重启的情况下更改设置 `max_(table|partition)_size_to_drop`。[#7779](https://github.com/ClickHouse/ClickHouse/pull/7779) ([Grigory Pervakov](https://github.com/GrigoryPervakov))
* 错误消息的易用性略有改进。提示用户不要删除 `Stack trace:` 下方的内容。[#7897](https://github.com/ClickHouse/ClickHouse/pull/7897) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 [#7935](https://github.com/ClickHouse/ClickHouse/issues/7935) 之后，改进了 `Kafka` 引擎以各种格式读取消息的能力。[#8035](https://github.com/ClickHouse/ClickHouse/pull/8035) ([Ivan](https://github.com/abyss7))
* 更好地兼容了不支持 `sha2_password` 身份验证插件的 MySQL 客户端。[#8036](https://github.com/ClickHouse/ClickHouse/pull/8036) ([Yuriy Baranov](https://github.com/yurriy))
* 支持 MySQL 兼容服务器中的更多列类型。[#7975](https://github.com/ClickHouse/ClickHouse/pull/7975) ([Yuriy Baranov](https://github.com/yurriy))
* 为底层使用 `MergeTree` 表的 `Merge`、`Buffer` 和 `Materilized View` 存储引擎实现 `ORDER BY` 优化。[#8130](https://github.com/ClickHouse/ClickHouse/pull/8130) ([Anton Popov](https://github.com/CurtizJ))
* 现在我们统一使用 `getrandom` 的 POSIX 实现，以更好地兼容旧版内核 (\< 3.17) 。[#7940](https://github.com/ClickHouse/ClickHouse/pull/7940) ([Amos Bird](https://github.com/amosbird))
* 改进了对 move 生存时间 (TTL) 规则中目标端有效性的检查。[#8410](https://github.com/ClickHouse/ClickHouse/pull/8410) ([Vladimir Chebotarev](https://github.com/excitoon))
* 改进了对 `Distributed` 表引擎中损坏的插入批次的检查。[#7933](https://github.com/ClickHouse/ClickHouse/pull/7933) ([Azat Khuzhin](https://github.com/azat))
* 向 `system.mutations` 表添加一列，用于存储未来需要由变更处理的 parts 名称数组。[#8179](https://github.com/ClickHouse/ClickHouse/pull/8179) ([alesapin](https://github.com/alesapin))
* 处理器的并行归并排序优化。[#8552](https://github.com/ClickHouse/ClickHouse/pull/8552) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 设置 `mark_cache_min_lifetime` 现已废弃，不再起作用。在早期版本中，标记缓存占用的内存可能会增长到超过 `mark_cache_size`，以容纳 `mark_cache_min_lifetime` 秒内的数据。这容易造成混淆，并导致内存占用高于预期，在内存受限的系统上尤其不利。如果你在安装此版本后发现性能下降，应增大 `mark_cache_size`。[#8484](https://github.com/ClickHouse/ClickHouse/pull/8484) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为在各处使用 `tid` 做准备。这是 [#7477](https://github.com/ClickHouse/ClickHouse/issues/7477) 所必需的。[#8276](https://github.com/ClickHouse/ClickHouse/pull/8276) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="performance-improvement">
  #### 性能改进
</div>

* 处理器管道性能优化。[#7988](https://github.com/ClickHouse/ClickHouse/pull/7988) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 对缓存字典中过期键进行非阻塞更新 (同时允许读取旧值) 。[#8303](https://github.com/ClickHouse/ClickHouse/pull/8303) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 全局编译 ClickHouse 时不使用 `-fno-omit-frame-pointer`，以额外腾出一个寄存器。[#8097](https://github.com/ClickHouse/ClickHouse/pull/8097) ([Amos Bird](https://github.com/amosbird))
* 优化 `greatCircleDistance` 函数的速度，并为其添加性能测试。[#7307](https://github.com/ClickHouse/ClickHouse/pull/7307) ([Olga Khvostikova](https://github.com/stavrolia))
* 优化了函数 `roundDown` 的性能。[#8465](https://github.com/ClickHouse/ClickHouse/pull/8465) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 优化了 `DateTime64` 数据类型上 `max`、`min`、`argMin`、`argMax` 的性能。[#8199](https://github.com/ClickHouse/ClickHouse/pull/8199) ([Vasily Nemkov](https://github.com/Enmk))
* 改进了在无 `limit`、`limit` 较大以及使用外部排序时的排序性能。[#8545](https://github.com/ClickHouse/ClickHouse/pull/8545) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 浮点数格式化性能最高提升 6 倍。 [#8542](https://github.com/ClickHouse/ClickHouse/pull/8542) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 优化了 `modulo` 函数的性能。[#7750](https://github.com/ClickHouse/ClickHouse/pull/7750) ([Amos Bird](https://github.com/amosbird))
* 优化了使用单列键时的 `ORDER BY` 和合并。 [#8335](https://github.com/ClickHouse/ClickHouse/pull/8335) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 优化了 `arrayReduce`、`-Array` 和 `-State` 组合器的实现。 [#7710](https://github.com/ClickHouse/ClickHouse/pull/7710) ([Amos Bird](https://github.com/amosbird))
* 现在，`PREWHERE` 已优化到至少与 `WHERE` 一样高效。[#7769](https://github.com/ClickHouse/ClickHouse/pull/7769) ([Amos Bird](https://github.com/amosbird))
* 改进 `round` 和 `roundBankers` 对负数的处理方式。[#8229](https://github.com/ClickHouse/ClickHouse/pull/8229) ([hcz](https://github.com/hczhcz))
* 将 `DoubleDelta` 和 `Gorilla` 编解码器的解码性能提升了约 30%–40%。修复了 [#7082](https://github.com/ClickHouse/ClickHouse/issues/7082)。[#8019](https://github.com/ClickHouse/ClickHouse/pull/8019) ([Vasily Nemkov](https://github.com/Enmk))
* 改进了 `base64` 相关函数的性能。[#8444](https://github.com/ClickHouse/ClickHouse/pull/8444) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 新增了函数 `geoDistance`。它与 `greatCircleDistance` 类似，但采用了对 WGS-84 椭球模型的近似计算。两个函数的性能几乎相同。[#8086](https://github.com/ClickHouse/ClickHouse/pull/8086) ([alexey-milovidov](https://github.com/alexey-milovidov))
* `Decimal` 数据类型的 `min` 和 `max` 聚合函数性能更快。[#8144](https://github.com/ClickHouse/ClickHouse/pull/8144) ([Artem Zuikov](https://github.com/4ertus2))
* 对 `arrayReduce` 的处理进行向量化。[#7608](https://github.com/ClickHouse/ClickHouse/pull/7608) ([Amos Bird](https://github.com/amosbird))
* `if` 链式判断现已优化为 `multiIf`。[#8355](https://github.com/ClickHouse/ClickHouse/pull/8355) ([kamalov-ruslan](https://github.com/kamalov-ruslan))
* 修复了 19.15 中引入的 `Kafka` 表引擎性能回归问题。此项修复解决了 [#7261](https://github.com/ClickHouse/ClickHouse/issues/7261)。[#7935](https://github.com/ClickHouse/ClickHouse/pull/7935) ([filimonov](https://github.com/filimonov))
* 移除了 Debian 软件包中的 `gcc` 有时默认启用的 "pie" 代码生成。 [#8483](https://github.com/ClickHouse/ClickHouse/pull/8483) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 数据格式的并行解析 [#6553](https://github.com/ClickHouse/ClickHouse/pull/6553) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))
* 默认启用支持表达式的 `Values` 优化解析器 (`input_format_values_deduce_templates_of_expressions=1`) 。[#8231](https://github.com/ClickHouse/ClickHouse/pull/8231) ([tavplubix](https://github.com/tavplubix))

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 修复了 `ARM` 环境和最小模式下的构建问题。[#8304](https://github.com/ClickHouse/ClickHouse/pull/8304) ([proller](https://github.com/proller))
* 在未调用 `std::atexit` 时，为 `clickhouse-server` 添加覆盖率文件刷写。还略微改进了启用覆盖率的无状态测试中的日志。 [#8267](https://github.com/ClickHouse/ClickHouse/pull/8267) ([alesapin](https://github.com/alesapin))
* 更新 contrib 中的 LLVM 库。避免使用操作系统软件包中的 LLVM。[#8258](https://github.com/ClickHouse/ClickHouse/pull/8258) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将内置 `curl` 的构建过程设为完全静默。[#8232](https://github.com/ClickHouse/ClickHouse/pull/8232) [#8203](https://github.com/ClickHouse/ClickHouse/pull/8203) ([Pavel Kovalenko](https://github.com/Jokser))
* 修复了一些 `MemorySanitizer` 的警告。[#8235](https://github.com/ClickHouse/ClickHouse/pull/8235) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 在 `CMakeLists.txt` 中使用 `add_warning` 和 `no_warning` 宏。[#8604](https://github.com/ClickHouse/ClickHouse/pull/8604) ([Ivan](https://github.com/abyss7))
* 增加了对 Minio S3 兼容对象存储 ([https://min.io/](https://min.io/)) 的支持，以更好地进行集成测试。[#7863](https://github.com/ClickHouse/ClickHouse/pull/7863) [#7875](https://github.com/ClickHouse/ClickHouse/pull/7875) ([Pavel Kovalenko](https://github.com/Jokser))
* 将 `libc` 请求头导入到 contrib 中。这使各种系统上的构建更加一致 (仅适用于 `x86_64-linux-gnu`) 。[#5773](https://github.com/ClickHouse/ClickHouse/pull/5773) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 从部分库中移除 `-fPIC`。 [#8464](https://github.com/ClickHouse/ClickHouse/pull/8464) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 清理 curl 的 `CMakeLists.txt`。参见 [https://github.com/ClickHouse/ClickHouse/pull/8011#issuecomment-569478910](https://github.com/ClickHouse/ClickHouse/pull/8011#issuecomment-569478910) [#8459](https://github.com/ClickHouse/ClickHouse/pull/8459) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 `CapNProto` 库中的警告静默处理。[#8220](https://github.com/ClickHouse/ClickHouse/pull/8220) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为短字符串优化的哈希表添加性能测试。[#7679](https://github.com/ClickHouse/ClickHouse/pull/7679) ([Amos Bird](https://github.com/amosbird))
* 现在，即使无法使用 `MADV_FREE`，ClickHouse 也能在 `AArch64` 上构建。这修复了 [#8027](https://github.com/ClickHouse/ClickHouse/issues/8027)。[#8243](https://github.com/ClickHouse/ClickHouse/pull/8243) ([Amos Bird](https://github.com/amosbird))
* 更新 `zlib-ng`，以修复 MemorySanitizer 相关问题。[#7182](https://github.com/ClickHouse/ClickHouse/pull/7182) [#8206](https://github.com/ClickHouse/ClickHouse/pull/8206) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 在非 Linux 系统上启用内部 MySQL 库，因为依赖操作系统软件包非常不稳定，而且通常根本无法正常工作。这修复了 [#5765](https://github.com/ClickHouse/ClickHouse/issues/5765)。[#8426](https://github.com/ClickHouse/ClickHouse/pull/8426) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 启用 `libc++` 后，修复了某些系统上的构建问题。此修复替代了 [#8374](https://github.com/ClickHouse/ClickHouse/issues/8374)。[#8380](https://github.com/ClickHouse/ClickHouse/pull/8380) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 增强 `Field` 方法的类型安全性，以便发现更多错误。[#7386](https://github.com/ClickHouse/ClickHouse/pull/7386) [#8209](https://github.com/ClickHouse/ClickHouse/pull/8209) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 向 `libc-headers` 子模块中补充了缺失的文件。[#8507](https://github.com/ClickHouse/ClickHouse/pull/8507) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复性能测试输出中的 `JSON` 引号错误。 [#8497](https://github.com/ClickHouse/ClickHouse/pull/8497) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 现在，`std::exception` 和 `Poco::Exception` 也会显示 stack trace。此前的版本中，只有 `DB::Exception` 才会显示 stack trace。这提升了诊断能力。[#8501](https://github.com/ClickHouse/ClickHouse/pull/8501) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 为较新的 glibc 版本适配 `clock_gettime` 和 `clock_nanosleep`。[#8054](https://github.com/ClickHouse/ClickHouse/pull/8054) ([Amos Bird](https://github.com/amosbird))
* 在供开发者使用的示例配置中启用 `part_log`。[#8609](https://github.com/ClickHouse/ClickHouse/pull/8609) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 `01036_no_superfluous_dict_reload_on_create_database*` 中 reload 的异步执行问题。[#8111](https://github.com/ClickHouse/ClickHouse/pull/8111) ([Azat Khuzhin](https://github.com/azat))
* 修复了编解码器性能测试。[#8615](https://github.com/ClickHouse/ClickHouse/pull/8615) ([Vasily Nemkov](https://github.com/Enmk))
* 为 `.tgz` 构建包添加安装脚本及相关文档。[#8612](https://github.com/ClickHouse/ClickHouse/pull/8612) [#8591](https://github.com/ClickHouse/ClickHouse/pull/8591) ([alesapin](https://github.com/alesapin))
* 移除了旧的 `ZSTD` 测试 (该测试创建于 2016 年，用于复现 1.0 之前版本的 ZSTD 中曾出现的 bug) 。这修复了 [#8618](https://github.com/ClickHouse/ClickHouse/issues/8618)。[#8619](https://github.com/ClickHouse/ClickHouse/pull/8619) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了 Mac OS Catalina 上的构建问题。[#8600](https://github.com/ClickHouse/ClickHouse/pull/8600) ([meo](https://github.com/meob))
* 提高了编解码器性能测试中的行数，使结果更容易观察到。[#8574](https://github.com/ClickHouse/ClickHouse/pull/8574) ([Vasily Nemkov](https://github.com/Enmk))
* 在调试构建中，将 `LOGICAL_ERROR` 异常按断言失败处理，以便更容易发现。[#8475](https://github.com/ClickHouse/ClickHouse/pull/8475) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 使与格式相关的性能测试结果更具确定性。[#8477](https://github.com/ClickHouse/ClickHouse/pull/8477) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 更新 `lz4`，修复 MemorySanitizer 故障。[#8181](https://github.com/ClickHouse/ClickHouse/pull/8181) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 在异常处理过程中抑制一个已知的 MemorySanitizer 误报。[#8182](https://github.com/ClickHouse/ClickHouse/pull/8182) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 将 `build/docker/build.sh` 中的 `gcc` 和 `g++` 更新至版本 9 [#7766](https://github.com/ClickHouse/ClickHouse/pull/7766) ([TLightSky](https://github.com/tlightsky))
* 添加性能测试用例，用于验证 `PREWHERE` 的表现比 `WHERE` 更差。[#7768](https://github.com/ClickHouse/ClickHouse/pull/7768) ([Amos Bird](https://github.com/amosbird))
* 在修复一个不稳定测试方面取得了进展。[#8621](https://github.com/ClickHouse/ClickHouse/pull/8621) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 避免因来自 `libunwind` 的数据而出现 MemorySanitizer 报告。[#8539](https://github.com/ClickHouse/ClickHouse/pull/8539) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 将 `libc++` 更新至最新版本。[#8324](https://github.com/ClickHouse/ClickHouse/pull/8324) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 从源码构建 ICU 库。此修复解决了 [#6460](https://github.com/ClickHouse/ClickHouse/issues/6460)。[#8219](https://github.com/ClickHouse/ClickHouse/pull/8219) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 已从 `libressl` 切换为 `openssl`。此次更改后，ClickHouse 应该支持 TLS 1.3 和 SNI。此更改修复了 [#8171](https://github.com/ClickHouse/ClickHouse/issues/8171)。[#8218](https://github.com/ClickHouse/ClickHouse/pull/8218) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了从 SSL 使用 `chacha20_poly1305` 时触发的 UBSan 报告问题 (连接到 [https://yandex.ru/](https://yandex.ru/) 时会发生) 。[#8214](https://github.com/ClickHouse/ClickHouse/pull/8214) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复 `.deb` Linux 发行版中默认密码文件的模式设置。[#8075](https://github.com/ClickHouse/ClickHouse/pull/8075) ([proller](https://github.com/proller))
* 优化了 `clickhouse-test` 中用于获取 `clickhouse-server` PID 的表达式。[#8063](https://github.com/ClickHouse/ClickHouse/pull/8063) ([Alexander Kazakov](https://github.com/Akazz))
* 将 contrib/googletest 升级到 v1.10.0。[#8587](https://github.com/ClickHouse/ClickHouse/pull/8587) ([Alexander Burmak](https://github.com/Alex-Burmak))
* 修复了 `base64` 库触发的 ThreadSaninitizer 报告。同时还将该库更新到了最新版本，不过这并不重要。此修复解决了 [#8397](https://github.com/ClickHouse/ClickHouse/issues/8397)。[#8403](https://github.com/ClickHouse/ClickHouse/pull/8403) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 修复了处理器中的 `00600_replace_running_query` 问题。 [#8272](https://github.com/ClickHouse/ClickHouse/pull/8272) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 移除 `tcmalloc` 支持，以简化 `CMakeLists.txt`。[#8310](https://github.com/ClickHouse/ClickHouse/pull/8310) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 发布版 gcc 构建现已改用 `libc++`，而不再使用 `libstdc++`。此前，`libc++` 仅与 clang 搭配使用。这将提高构建配置的一致性和可移植性。[#8311](https://github.com/ClickHouse/ClickHouse/pull/8311) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在使用 MemorySanitizer 的构建中启用 ICU 库。[#8222](https://github.com/ClickHouse/ClickHouse/pull/8222) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 抑制 `CapNProto` 库产生的警告。[#8224](https://github.com/ClickHouse/ClickHouse/pull/8224) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 移除了针对 `tcmalloc` 的特殊处理代码，因为它已不再受支持。[#8225](https://github.com/ClickHouse/ClickHouse/pull/8225) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 CI 覆盖率任务中，平滑关闭服务器，以便其保存覆盖率报告。这修复了我们最近一直遇到的覆盖率报告不完整问题。[#8142](https://github.com/ClickHouse/ClickHouse/pull/8142) ([alesapin](https://github.com/alesapin))
* 针对 `Float64` 和 `UInt64` 类型的值，对所有编解码器进行了性能测试。[#8349](https://github.com/ClickHouse/ClickHouse/pull/8349) ([Vasily Nemkov](https://github.com/Enmk))
* `termcap` 已基本弃用，并导致了各种问题 (例如缺少 "up" 功能项，以及回显 `^J` 而不是多行显示) 。请优先使用 `terminfo` 或随附的 `ncurses`。[#7737](https://github.com/ClickHouse/ClickHouse/pull/7737) ([Amos Bird](https://github.com/amosbird))
* 修复 `test_storage_s3` 集成测试问题。[#7734](https://github.com/ClickHouse/ClickHouse/pull/7734) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 支持 `StorageFile(<format>, null) ` 将块插入指定格式的文件中，而无需实际写入磁盘。这是进行性能测试所必需的。[#8455](https://github.com/ClickHouse/ClickHouse/pull/8455) ([Amos Bird](https://github.com/amosbird))
* 在功能测试中新增了参数 `--print-time`，可打印每项测试的执行时间。[#8001](https://github.com/ClickHouse/ClickHouse/pull/8001) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 在评估 RPN 时向 `KeyCondition` 添加了断言。这将修复 gcc-9 产生的警告。[#8279](https://github.com/ClickHouse/ClickHouse/pull/8279) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 在 CI 构建中打印 cmake 选项。[#8273](https://github.com/ClickHouse/ClickHouse/pull/8273) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 不要为某些体积较大的库生成调试信息。[#8271](https://github.com/ClickHouse/ClickHouse/pull/8271) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 使 `log_to_console.xml` 始终将日志输出到 stderr，不受是否为交互模式的影响。 [#8395](https://github.com/ClickHouse/ClickHouse/pull/8395) ([Alexander Kuzmenkov](https://github.com/akuzm))
* 移除了 `clickhouse-performance-test` 工具中一些未使用的功能。[#8555](https://github.com/ClickHouse/ClickHouse/pull/8555) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 现在我们也会查找与对应 `clang-X` 版本匹配的 `lld-X`。[#8092](https://github.com/ClickHouse/ClickHouse/pull/8092) ([alesapin](https://github.com/alesapin))
* 改进 Parquet 构建。[#8421](https://github.com/ClickHouse/ClickHouse/pull/8421) ([maxulan](https://github.com/maxulan))
* 增加了更多 GCC 警告 [#8221](https://github.com/ClickHouse/ClickHouse/pull/8221) ([kreuzerkrieg](https://github.com/kreuzerkrieg))
* Arch Linux 软件包现在已支持运行 ClickHouse server，而不再仅限于客户端。[#8534](https://github.com/ClickHouse/ClickHouse/pull/8534) ([Vladimir Chebotarev](https://github.com/excitoon))
* 修复了处理器相关测试。小幅性能优化。[#7672](https://github.com/ClickHouse/ClickHouse/pull/7672) ([Nikolai Kochetov](https://github.com/KochetovNicolai))
* 更新 contrib/protobuf。 [#8256](https://github.com/ClickHouse/ClickHouse/pull/8256) ([Matwey V. Kornilov](https://github.com/matwey))
* 为迎接新年并准备切换到 C++20。"愿 C++ 原力与 ClickHouse 同在。" [#8447](https://github.com/ClickHouse/ClickHouse/pull/8447) ([Amos Bird](https://github.com/amosbird))

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增实验性设置 `min_bytes_to_use_mmap_io`。它支持在读取大文件时无需将数据从内核复制到用户态。该设置默认禁用。由于 mmap/munmap 较慢，建议阈值设在约 64 MB。[#8520](https://github.com/ClickHouse/ClickHouse/pull/8520) ([alexey-milovidov](https://github.com/alexey-milovidov))
* 作为访问控制系统的一部分，对配额进行了重构。新增表 `system.quotas`、函数 `currentQuota`、`currentQuotaKey`，以及新的 SQL 语法 `CREATE QUOTA`、`ALTER QUOTA`、`DROP QUOTA`、`SHOW QUOTA`。[#7257](https://github.com/ClickHouse/ClickHouse/pull/7257) ([Vitaly Baranov](https://github.com/vitlibar))
* 允许跳过未知设置并给出警告，而不是抛出异常。[#7653](https://github.com/ClickHouse/ClickHouse/pull/7653) ([Vitaly Baranov](https://github.com/vitlibar))
* 作为访问控制系统的一部分，对行策略进行了重构。新增表 `system.row_policies`、函数 `currentRowPolicies()`，以及新的 SQL 语法 `CREATE POLICY`、`ALTER POLICY`、`DROP POLICY`、`SHOW CREATE POLICY`、`SHOW POLICIES`。[#7808](https://github.com/ClickHouse/ClickHouse/pull/7808) ([Vitaly Baranov](https://github.com/vitlibar))

<div id="security-fix">
  #### 安全修复
</div>

* 修复了使用 `File` 表引擎的表可能被读取目录结构的问题。此修复解决了 [#8536](https://github.com/ClickHouse/ClickHouse/issues/8536)。[#8537](https://github.com/ClickHouse/ClickHouse/pull/8537) ([alexey-milovidov](https://github.com/alexey-milovidov))

<div id="changelog-for-2019">
  ## [2019 年更新日志](/zh/resources/changelogs/oss/2019)
</div>
