diff --git a/.arcignore b/.arcignore
deleted file mode 100644
index cd917b06fb7..00000000000
--- a/.arcignore
+++ /dev/null
@@ -1,12 +0,0 @@
-# .arcignore is the same as .gitignore but for Arc VCS.
-# Arc VCS is a proprietary VCS in Yandex that is very similar to Git
-# from the user perspective but with the following differences:
-# 1. Data is stored in distributed object storage.
-# 2. Local copy works via FUSE without downloading all the objects.
-# For this reason, it is better suited for huge monorepositories that can be found in large companies (e.g. Yandex, Google).
-# As ClickHouse developers, we don't use Arc as a VCS (we use Git).
-# But the ClickHouse source code is also mirrored into internal monorepository and our collegues are using Arc.
-# You can read more about Arc here: https://habr.com/en/company/yandex/blog/482926/
-
-# Repository is synchronized without 3rd-party submodules.
-contrib
diff --git a/.clang-tidy b/.clang-tidy
index b0971418e0e..ecb8ac6dcbf 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -203,3 +203,5 @@ CheckOptions:
value: CamelCase
- key: readability-identifier-naming.UsingCase
value: CamelCase
+ - key: modernize-loop-convert.UseCxx20ReverseRanges
+ value: false
diff --git a/.gitignore b/.gitignore
index a469ff7bca1..0bf31508419 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,9 @@
/docs/ja/single.md
/docs/fa/single.md
/docs/en/development/cmake-in-clickhouse.md
+/docs/ja/development/cmake-in-clickhouse.md
+/docs/zh/development/cmake-in-clickhouse.md
+/docs/ru/development/cmake-in-clickhouse.md
# callgrind files
callgrind.out.*
diff --git a/.gitmodules b/.gitmodules
index 37b22527eb4..74d1049ce01 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -246,3 +246,6 @@
[submodule "contrib/bzip2"]
path = contrib/bzip2
url = https://github.com/ClickHouse-Extras/bzip2.git
+[submodule "contrib/magic_enum"]
+ path = contrib/magic_enum
+ url = https://github.com/Neargye/magic_enum
diff --git a/AUTHORS b/AUTHORS
index 12838d7fa14..1d2e5adc523 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,2 @@
-To see the list of authors who created the source code of ClickHouse, published and distributed by YANDEX LLC as the owner,
+To see the list of authors who created the source code of ClickHouse, published and distributed by ClickHouse, Inc. as the owner,
run "SELECT * FROM system.contributors;" query on any ClickHouse server.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 71cdac17825..6e209293e67 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,213 @@
+### ClickHouse release v21.9, 2021-09-09
+
+#### Backward Incompatible Change
+
+* Do not output trailing zeros in text representation of `Decimal` types. Example: `1.23` will be printed instead of `1.230000` for decimal with scale 6. This closes [#15794](https://github.com/ClickHouse/ClickHouse/issues/15794). It may introduce slight incompatibility if your applications somehow relied on the trailing zeros. Serialization in output formats can be controlled with the setting `output_format_decimal_trailing_zeros`. Implementation of `toString` and casting to String is changed unconditionally. [#27680](https://github.com/ClickHouse/ClickHouse/pull/27680) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Do not allow to apply parametric aggregate function with `-Merge` combinator to aggregate function state if state was produced by aggregate function with different parameters. For example, state of `fooState(42)(x)` cannot be finalized with `fooMerge(s)` or `fooMerge(123)(s)`, parameters must be specified explicitly like `fooMerge(42)(s)` and must be equal. It does not affect some special aggregate functions like `quantile` and `sequence*` that use parameters for finalization only. [#26847](https://github.com/ClickHouse/ClickHouse/pull/26847) ([tavplubix](https://github.com/tavplubix)).
+* Under clickhouse-local, always treat local addresses with a port as remote. [#26736](https://github.com/ClickHouse/ClickHouse/pull/26736) ([Raúl Marín](https://github.com/Algunenano)).
+* Fix the issue that in case of some sophisticated query with column aliases identical to the names of expressions, bad cast may happen. This fixes [#25447](https://github.com/ClickHouse/ClickHouse/issues/25447). This fixes [#26914](https://github.com/ClickHouse/ClickHouse/issues/26914). This fix may introduce backward incompatibility: if there are different expressions with identical names, exception will be thrown. It may break some rare cases when `enable_optimize_predicate_expression` is set. [#26639](https://github.com/ClickHouse/ClickHouse/pull/26639) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Now, scalar subquery always returns `Nullable` result if it's type can be `Nullable`. It is needed because in case of empty subquery it's result should be `Null`. Previously, it was possible to get error about incompatible types (type deduction does not execute scalar subquery, and it could use not-nullable type). Scalar subquery with empty result which can't be converted to `Nullable` (like `Array` or `Tuple`) now throws error. Fixes [#25411](https://github.com/ClickHouse/ClickHouse/issues/25411). [#26423](https://github.com/ClickHouse/ClickHouse/pull/26423) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
+
+#### New Feature
+
+* Implementation of short circuit function evaluation, closes [#12587](https://github.com/ClickHouse/ClickHouse/issues/12587). Add settings `short_circuit_function_evaluation` to configure short circuit function evaluation. [#23367](https://github.com/ClickHouse/ClickHouse/pull/23367) ([Kruglov Pavel](https://github.com/Avogar)).
+* Add support for INTERSECT, EXCEPT, ANY, ALL operators. [#24757](https://github.com/ClickHouse/ClickHouse/pull/24757) ([Kirill Ershov](https://github.com/zdikov)). ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Add support for encryption at the virtual file system level (data encryption at rest) using AES-CTR algorithm. [#24206](https://github.com/ClickHouse/ClickHouse/pull/24206) ([Latysheva Alexandra](https://github.com/alexelex)). ([Vitaly Baranov](https://github.com/vitlibar)) [#26733](https://github.com/ClickHouse/ClickHouse/pull/26733) [#26377](https://github.com/ClickHouse/ClickHouse/pull/26377) [#26465](https://github.com/ClickHouse/ClickHouse/pull/26465).
+* Added natural language processing (NLP) functions for tokenization, stemming, lemmatizing and search in synonyms extensions. [#24997](https://github.com/ClickHouse/ClickHouse/pull/24997) ([Nikolay Degterinsky](https://github.com/evillique)).
+* Added integration with S2 geometry library. [#24980](https://github.com/ClickHouse/ClickHouse/pull/24980) ([Andr0901](https://github.com/Andr0901)). ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
+* Add SQLite table engine, table function, database engine. [#24194](https://github.com/ClickHouse/ClickHouse/pull/24194) ([Arslan Gumerov](https://github.com/g-arslan)). ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Added support for custom query for `MySQL`, `PostgreSQL`, `ClickHouse`, `JDBC`, `Cassandra` dictionary source. Closes [#1270](https://github.com/ClickHouse/ClickHouse/issues/1270). [#26995](https://github.com/ClickHouse/ClickHouse/pull/26995) ([Maksim Kita](https://github.com/kitaisreal)).
+* Introduce syntax for here documents. Example `SELECT $doc$ VALUE $doc$`. [#26671](https://github.com/ClickHouse/ClickHouse/pull/26671) ([Maksim Kita](https://github.com/kitaisreal)).
+* Add shared (replicated) storage of user, roles, row policies, quotas and settings profiles through ZooKeeper. [#27426](https://github.com/ClickHouse/ClickHouse/pull/27426) ([Kevin Michel](https://github.com/kmichel-aiven)).
+* Add compression for `INTO OUTFILE` that automatically choose compression algorithm. Closes [#3473](https://github.com/ClickHouse/ClickHouse/issues/3473). [#27134](https://github.com/ClickHouse/ClickHouse/pull/27134) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
+* Add `INSERT ... FROM INFILE` similarly to `SELECT ... INTO OUTFILE`. [#27655](https://github.com/ClickHouse/ClickHouse/pull/27655) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
+* Added `complex_key_range_hashed` dictionary. Closes [#22029](https://github.com/ClickHouse/ClickHouse/issues/22029). [#27629](https://github.com/ClickHouse/ClickHouse/pull/27629) ([Maksim Kita](https://github.com/kitaisreal)).
+* Support expressions in JOIN ON section. Close [#21868](https://github.com/ClickHouse/ClickHouse/issues/21868). [#24420](https://github.com/ClickHouse/ClickHouse/pull/24420) ([Vladimir C](https://github.com/vdimir)).
+* When client connects to server, it receives information about all warnings that are already were collected by server. (It can be disabled by using option `--no-warnings`). Add `system.warnings` table to collect warnings about server configuration. [#26246](https://github.com/ClickHouse/ClickHouse/pull/26246) ([Filatenkov Artur](https://github.com/FArthur-cmd)). [#26282](https://github.com/ClickHouse/ClickHouse/pull/26282) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
+* Allow using constant expressions from with and select in aggregate function parameters. Close [#10945](https://github.com/ClickHouse/ClickHouse/issues/10945). [#27531](https://github.com/ClickHouse/ClickHouse/pull/27531) ([abel-cheng](https://github.com/abel-cheng)).
+* Add `tupleToNameValuePairs`, a function that turns a named tuple into an array of pairs. [#27505](https://github.com/ClickHouse/ClickHouse/pull/27505) ([Braulio Valdivielso Martínez](https://github.com/BraulioVM)).
+* Add support for `bzip2` compression method for import/export. Closes [#22428](https://github.com/ClickHouse/ClickHouse/issues/22428). [#27377](https://github.com/ClickHouse/ClickHouse/pull/27377) ([Nikolay Degterinsky](https://github.com/evillique)).
+* Added `bitmapSubsetOffsetLimit(bitmap, offset, cardinality_limit)` function. It creates a subset of bitmap limit the results to `cardinality_limit` with offset of `offset`. [#27234](https://github.com/ClickHouse/ClickHouse/pull/27234) ([DHBin](https://github.com/DHBin)).
+* Add column `default_database` to `system.users`. [#27054](https://github.com/ClickHouse/ClickHouse/pull/27054) ([kevin wan](https://github.com/MaxWk)).
+* Supported `cluster` macros inside table functions 'cluster' and 'clusterAllReplicas'. [#26913](https://github.com/ClickHouse/ClickHouse/pull/26913) ([polyprogrammist](https://github.com/PolyProgrammist)).
+* Add new functions `currentRoles()`, `enabledRoles()`, `defaultRoles()`. [#26780](https://github.com/ClickHouse/ClickHouse/pull/26780) ([Vitaly Baranov](https://github.com/vitlibar)).
+* New functions `currentProfiles()`, `enabledProfiles()`, `defaultProfiles()`. [#26714](https://github.com/ClickHouse/ClickHouse/pull/26714) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Add functions that return (initial_)query_id of the current query. This closes [#23682](https://github.com/ClickHouse/ClickHouse/issues/23682). [#26410](https://github.com/ClickHouse/ClickHouse/pull/26410) ([Alexey Boykov](https://github.com/mathalex)).
+* Add `REPLACE GRANT` feature. [#26384](https://github.com/ClickHouse/ClickHouse/pull/26384) ([Caspian](https://github.com/Cas-pian)).
+* `EXPLAIN` query now has `EXPLAIN ESTIMATE ...` mode that will show information about read rows, marks and parts from MergeTree tables. Closes [#23941](https://github.com/ClickHouse/ClickHouse/issues/23941). [#26131](https://github.com/ClickHouse/ClickHouse/pull/26131) ([fastio](https://github.com/fastio)).
+* Added `system.zookeeper_log` table. All actions of ZooKeeper client are logged into this table. Implements [#25449](https://github.com/ClickHouse/ClickHouse/issues/25449). [#26129](https://github.com/ClickHouse/ClickHouse/pull/26129) ([tavplubix](https://github.com/tavplubix)).
+* Zero-copy replication for `ReplicatedMergeTree` over `HDFS` storage. [#25918](https://github.com/ClickHouse/ClickHouse/pull/25918) ([Zhichang Yu](https://github.com/yuzhichang)).
+* Allow to insert Nested type as array of structs in `Arrow`, `ORC` and `Parquet` input format. [#25902](https://github.com/ClickHouse/ClickHouse/pull/25902) ([Kruglov Pavel](https://github.com/Avogar)).
+* Add a new datatype `Date32` (store data as Int32), support date range same with `DateTime64` support load parquet date32 to ClickHouse `Date32` Add new function `toDate32` like `toDate`. [#25774](https://github.com/ClickHouse/ClickHouse/pull/25774) ([LiuNeng](https://github.com/liuneng1994)).
+* Allow setting default database for users. [#25268](https://github.com/ClickHouse/ClickHouse/issues/25268). [#25687](https://github.com/ClickHouse/ClickHouse/pull/25687) ([kevin wan](https://github.com/MaxWk)).
+* Add an optional parameter to `MongoDB` engine to accept connection string options and support SSL connection. Closes [#21189](https://github.com/ClickHouse/ClickHouse/issues/21189). Closes [#21041](https://github.com/ClickHouse/ClickHouse/issues/21041). [#22045](https://github.com/ClickHouse/ClickHouse/pull/22045) ([Omar Bazaraa](https://github.com/OmarBazaraa)).
+
+#### Experimental Feature
+
+* Added a compression codec `AES_128_GCM_SIV` which encrypts columns instead of compressing them. [#19896](https://github.com/ClickHouse/ClickHouse/pull/19896) ([PHO](https://github.com/depressed-pho)). Will be rewritten, do not use.
+* Rename `MaterializeMySQL` to `MaterializedMySQL`. [#26822](https://github.com/ClickHouse/ClickHouse/pull/26822) ([tavplubix](https://github.com/tavplubix)).
+
+#### Performance Improvement
+
+* Improve the performance of fast queries when `max_execution_time = 0` by reducing the number of `clock_gettime` system calls. [#27325](https://github.com/ClickHouse/ClickHouse/pull/27325) ([filimonov](https://github.com/filimonov)).
+* Specialize date time related comparison to achieve better performance. This fixes [#27083](https://github.com/ClickHouse/ClickHouse/issues/27083) . [#27122](https://github.com/ClickHouse/ClickHouse/pull/27122) ([Amos Bird](https://github.com/amosbird)).
+* Share file descriptors in concurrent reads of the same files. There is no noticeable performance difference on Linux. But the number of opened files will be significantly (10..100 times) lower on typical servers and it makes operations easier. See [#26214](https://github.com/ClickHouse/ClickHouse/issues/26214). [#26768](https://github.com/ClickHouse/ClickHouse/pull/26768) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Improve latency of short queries, that require reading from tables with large number of columns. [#26371](https://github.com/ClickHouse/ClickHouse/pull/26371) ([Anton Popov](https://github.com/CurtizJ)).
+* Don't build sets for indices when analyzing a query. [#26365](https://github.com/ClickHouse/ClickHouse/pull/26365) ([Raúl Marín](https://github.com/Algunenano)).
+* Vectorize the SUM of Nullable integer types with native representation ([David Manzanares](https://github.com/davidmanzanares), [Raúl Marín](https://github.com/Algunenano)). [#26248](https://github.com/ClickHouse/ClickHouse/pull/26248) ([Raúl Marín](https://github.com/Algunenano)).
+* Compile expressions involving columns with `Enum` types. [#26237](https://github.com/ClickHouse/ClickHouse/pull/26237) ([Maksim Kita](https://github.com/kitaisreal)).
+* Compile aggregate functions `groupBitOr`, `groupBitAnd`, `groupBitXor`. [#26161](https://github.com/ClickHouse/ClickHouse/pull/26161) ([Maksim Kita](https://github.com/kitaisreal)).
+* Improved memory usage with better block size prediction when reading empty DEFAULT columns. Closes [#17317](https://github.com/ClickHouse/ClickHouse/issues/17317). [#25917](https://github.com/ClickHouse/ClickHouse/pull/25917) ([Vladimir Chebotarev](https://github.com/excitoon)).
+* Reduce memory usage and number of read rows in queries with `ORDER BY primary_key`. [#25721](https://github.com/ClickHouse/ClickHouse/pull/25721) ([Anton Popov](https://github.com/CurtizJ)).
+* Enable `distributed_push_down_limit` by default. [#27104](https://github.com/ClickHouse/ClickHouse/pull/27104) ([Azat Khuzhin](https://github.com/azat)).
+* Make `toTimeZone` monotonicity when timeZone is a constant value to support partition puring when use sql like:. [#26261](https://github.com/ClickHouse/ClickHouse/pull/26261) ([huangzhaowei](https://github.com/SaintBacchus)).
+
+#### Improvement
+
+* Mark window functions as ready for general use. Remove the `allow_experimental_window_functions` setting. [#27184](https://github.com/ClickHouse/ClickHouse/pull/27184) ([Alexander Kuzmenkov](https://github.com/akuzm)).
+* Improve compatibility with non-whole-minute timezone offsets. [#27080](https://github.com/ClickHouse/ClickHouse/pull/27080) ([Raúl Marín](https://github.com/Algunenano)).
+* If file descriptor in `File` table is regular file - allow to read multiple times from it. It allows `clickhouse-local` to read multiple times from stdin (with multiple SELECT queries or subqueries) if stdin is a regular file like `clickhouse-local --query "SELECT * FROM table UNION ALL SELECT * FROM table" ... < file`. This closes [#11124](https://github.com/ClickHouse/ClickHouse/issues/11124). Co-authored with ([alexey-milovidov](https://github.com/alexey-milovidov)). [#25960](https://github.com/ClickHouse/ClickHouse/pull/25960) ([BoloniniD](https://github.com/BoloniniD)).
+* Remove duplicate index analysis and avoid possible invalid limit checks during projection analysis. [#27742](https://github.com/ClickHouse/ClickHouse/pull/27742) ([Amos Bird](https://github.com/amosbird)).
+* Enable query parameters to be passed in the body of HTTP requests. [#27706](https://github.com/ClickHouse/ClickHouse/pull/27706) ([Hermano Lustosa](https://github.com/hllustosa)).
+* Disallow `arrayJoin` on partition expressions. [#27648](https://github.com/ClickHouse/ClickHouse/pull/27648) ([Raúl Marín](https://github.com/Algunenano)).
+* Log client IP address if authentication fails. [#27514](https://github.com/ClickHouse/ClickHouse/pull/27514) ([Misko Lee](https://github.com/imiskolee)).
+* Use bytes instead of strings for binary data in the GRPC protocol. [#27431](https://github.com/ClickHouse/ClickHouse/pull/27431) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Send response with error message if HTTP port is not set and user tries to send HTTP request to TCP port. [#27385](https://github.com/ClickHouse/ClickHouse/pull/27385) ([Braulio Valdivielso Martínez](https://github.com/BraulioVM)).
+* Add `_CAST` function for internal usage, which will not preserve type nullability, but non-internal cast will preserve according to setting `cast_keep_nullable`. Closes [#12636](https://github.com/ClickHouse/ClickHouse/issues/12636). [#27382](https://github.com/ClickHouse/ClickHouse/pull/27382) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Add setting `log_formatted_queries` to log additional formatted query into `system.query_log`. It's useful for normalized query analysis because functions like `normalizeQuery` and `normalizeQueryKeepNames` don't parse/format queries in order to achieve better performance. [#27380](https://github.com/ClickHouse/ClickHouse/pull/27380) ([Amos Bird](https://github.com/amosbird)).
+* Add two settings `max_hyperscan_regexp_length` and `max_hyperscan_regexp_total_length` to prevent huge regexp being used in hyperscan related functions, such as `multiMatchAny`. [#27378](https://github.com/ClickHouse/ClickHouse/pull/27378) ([Amos Bird](https://github.com/amosbird)).
+* Memory consumed by bitmap aggregate functions now is taken into account for memory limits. This closes [#26555](https://github.com/ClickHouse/ClickHouse/issues/26555). [#27252](https://github.com/ClickHouse/ClickHouse/pull/27252) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Add new index data skipping minmax index format for proper Nullable support. [#27250](https://github.com/ClickHouse/ClickHouse/pull/27250) ([Azat Khuzhin](https://github.com/azat)).
+* Add 10 seconds cache for S3 proxy resolver. [#27216](https://github.com/ClickHouse/ClickHouse/pull/27216) ([ianton-ru](https://github.com/ianton-ru)).
+* Split global mutex into individual regexp construction. This helps avoid huge regexp construction blocking other related threads. [#27211](https://github.com/ClickHouse/ClickHouse/pull/27211) ([Amos Bird](https://github.com/amosbird)).
+* Support schema for PostgreSQL database engine. Closes [#27166](https://github.com/ClickHouse/ClickHouse/issues/27166). [#27198](https://github.com/ClickHouse/ClickHouse/pull/27198) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Track memory usage in clickhouse-client. [#27191](https://github.com/ClickHouse/ClickHouse/pull/27191) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
+* Try recording `query_kind` in `system.query_log` even when query fails to start. [#27182](https://github.com/ClickHouse/ClickHouse/pull/27182) ([Amos Bird](https://github.com/amosbird)).
+* Added columns `replica_is_active` that maps replica name to is replica active status to table `system.replicas`. Closes [#27138](https://github.com/ClickHouse/ClickHouse/issues/27138). [#27180](https://github.com/ClickHouse/ClickHouse/pull/27180) ([Maksim Kita](https://github.com/kitaisreal)).
+* Allow to pass query settings via server URI in Web UI. [#27177](https://github.com/ClickHouse/ClickHouse/pull/27177) ([kolsys](https://github.com/kolsys)).
+* Add a new metric called `MaxPushedDDLEntryID` which is the maximum ddl entry id that current node push to zookeeper. [#27174](https://github.com/ClickHouse/ClickHouse/pull/27174) ([Fuwang Hu](https://github.com/fuwhu)).
+* Improved the existence condition judgment and empty string node judgment when `clickhouse-keeper` creates znode. [#27125](https://github.com/ClickHouse/ClickHouse/pull/27125) ([小路](https://github.com/nicelulu)).
+* Merge JOIN correctly handles empty set in the right. [#27078](https://github.com/ClickHouse/ClickHouse/pull/27078) ([Vladimir C](https://github.com/vdimir)).
+* Now functions can be shard-level constants, which means if it's executed in the context of some distributed table, it generates a normal column, otherwise it produces a constant value. Notable functions are: `hostName()`, `tcpPort()`, `version()`, `buildId()`, `uptime()`, etc. [#27020](https://github.com/ClickHouse/ClickHouse/pull/27020) ([Amos Bird](https://github.com/amosbird)).
+* Updated `extractAllGroupsHorizontal` - upper limit on the number of matches per row can be set via optional third argument. [#26961](https://github.com/ClickHouse/ClickHouse/pull/26961) ([Vasily Nemkov](https://github.com/Enmk)).
+* Expose `RocksDB` statistics via system.rocksdb table. Read rocksdb options from ClickHouse config (`rocksdb...` keys). NOTE: ClickHouse does not rely on RocksDB, it is just one of the additional integration storage engines. [#26821](https://github.com/ClickHouse/ClickHouse/pull/26821) ([Azat Khuzhin](https://github.com/azat)).
+* Less verbose internal RocksDB logs. NOTE: ClickHouse does not rely on RocksDB, it is just one of the additional integration storage engines. This closes [#26252](https://github.com/ClickHouse/ClickHouse/issues/26252). [#26789](https://github.com/ClickHouse/ClickHouse/pull/26789) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Changing default roles affects new sessions only. [#26759](https://github.com/ClickHouse/ClickHouse/pull/26759) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Watchdog is disabled in docker by default. Fix for not handling ctrl+c. [#26757](https://github.com/ClickHouse/ClickHouse/pull/26757) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
+* `SET PROFILE` now applies constraints too if they're set for a passed profile. [#26730](https://github.com/ClickHouse/ClickHouse/pull/26730) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Improve handling of `KILL QUERY` requests. [#26675](https://github.com/ClickHouse/ClickHouse/pull/26675) ([Raúl Marín](https://github.com/Algunenano)).
+* `mapPopulatesSeries` function supports `Map` type. [#26663](https://github.com/ClickHouse/ClickHouse/pull/26663) ([Ildus Kurbangaliev](https://github.com/ildus)).
+* Fix excessive (x2) connect attempts with `skip_unavailable_shards`. [#26658](https://github.com/ClickHouse/ClickHouse/pull/26658) ([Azat Khuzhin](https://github.com/azat)).
+* Avoid hanging `clickhouse-benchmark` if connection fails (i.e. on EMFILE). [#26656](https://github.com/ClickHouse/ClickHouse/pull/26656) ([Azat Khuzhin](https://github.com/azat)).
+* Allow more threads to be used by the Kafka engine. [#26642](https://github.com/ClickHouse/ClickHouse/pull/26642) ([feihengye](https://github.com/feihengye)).
+* Add round-robin support for `clickhouse-benchmark` (it does not differ from the regular multi host/port run except for statistics report). [#26607](https://github.com/ClickHouse/ClickHouse/pull/26607) ([Azat Khuzhin](https://github.com/azat)).
+* Executable dictionaries (`executable`, `executable_pool`) enable creation with DDL query using `clickhouse-local`. Closes [#22355](https://github.com/ClickHouse/ClickHouse/issues/22355). [#26510](https://github.com/ClickHouse/ClickHouse/pull/26510) ([Maksim Kita](https://github.com/kitaisreal)).
+* Set client query kind for `mysql` and `postgresql` compatibility protocol handlers. [#26498](https://github.com/ClickHouse/ClickHouse/pull/26498) ([anneji-dev](https://github.com/anneji-dev)).
+* Apply `LIMIT` on the shards for queries like `SELECT * FROM dist ORDER BY key LIMIT 10` w/ `distributed_push_down_limit=1`. Avoid running `Distinct`/`LIMIT BY` steps for queries like `SELECT DISTINCT shading_key FROM dist ORDER BY key`. Now `distributed_push_down_limit` is respected by `optimize_distributed_group_by_sharding_key` optimization. [#26466](https://github.com/ClickHouse/ClickHouse/pull/26466) ([Azat Khuzhin](https://github.com/azat)).
+* Updated protobuf to 3.17.3. Changelogs are available on https://github.com/protocolbuffers/protobuf/releases. [#26424](https://github.com/ClickHouse/ClickHouse/pull/26424) ([Ilya Yatsishin](https://github.com/qoega)).
+* Enable `use_hedged_requests` setting that allows to mitigate tail latencies on large clusters. [#26380](https://github.com/ClickHouse/ClickHouse/pull/26380) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Improve behaviour with non-existing host in user allowed host list. [#26368](https://github.com/ClickHouse/ClickHouse/pull/26368) ([ianton-ru](https://github.com/ianton-ru)).
+* Add ability to set `Distributed` directory monitor settings via CREATE TABLE (i.e. `CREATE TABLE dist (key Int) Engine=Distributed(cluster, db, table) SETTINGS monitor_batch_inserts=1` and similar). [#26336](https://github.com/ClickHouse/ClickHouse/pull/26336) ([Azat Khuzhin](https://github.com/azat)).
+* Save server address in history URLs in web UI if it differs from the origin of web UI. This closes [#26044](https://github.com/ClickHouse/ClickHouse/issues/26044). [#26322](https://github.com/ClickHouse/ClickHouse/pull/26322) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Add events to profile calls to `sleep` / `sleepEachRow`. [#26320](https://github.com/ClickHouse/ClickHouse/pull/26320) ([Raúl Marín](https://github.com/Algunenano)).
+* Allow to reuse connections of shards among different clusters. It also avoids creating new connections when using `cluster` table function. [#26318](https://github.com/ClickHouse/ClickHouse/pull/26318) ([Amos Bird](https://github.com/amosbird)).
+* Control the execution period of clear old temporary directories by parameter with default value. [#26212](https://github.com/ClickHouse/ClickHouse/issues/26212). [#26313](https://github.com/ClickHouse/ClickHouse/pull/26313) ([fastio](https://github.com/fastio)).
+* Add a setting `function_range_max_elements_in_block` to tune the safety threshold for data volume generated by function `range`. This closes [#26303](https://github.com/ClickHouse/ClickHouse/issues/26303). [#26305](https://github.com/ClickHouse/ClickHouse/pull/26305) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Check hash function at table creation, not at sampling. Add settings for MergeTree, if someone create a table with incorrect sampling column but sampling never be used, disable this settings for starting the server without exception. [#26256](https://github.com/ClickHouse/ClickHouse/pull/26256) ([zhaoyu](https://github.com/zxc111)).
+* Added `output_format_avro_string_column_pattern` setting to put specified String columns to Avro as string instead of default bytes. Implements [#22414](https://github.com/ClickHouse/ClickHouse/issues/22414). [#26245](https://github.com/ClickHouse/ClickHouse/pull/26245) ([Ilya Golshtein](https://github.com/ilejn)).
+* Add information about column sizes in `system.columns` table for `Log` and `TinyLog` tables. This closes [#9001](https://github.com/ClickHouse/ClickHouse/issues/9001). [#26241](https://github.com/ClickHouse/ClickHouse/pull/26241) ([Nikolay Degterinsky](https://github.com/evillique)).
+* Don't throw exception when querying `system.detached_parts` table if there is custom disk configuration and `detached` directory does not exist on some disks. This closes [#26078](https://github.com/ClickHouse/ClickHouse/issues/26078). [#26236](https://github.com/ClickHouse/ClickHouse/pull/26236) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Check for non-deterministic functions in keys, including constant expressions like `now()`, `today()`. This closes [#25875](https://github.com/ClickHouse/ClickHouse/issues/25875). This closes [#11333](https://github.com/ClickHouse/ClickHouse/issues/11333). [#26235](https://github.com/ClickHouse/ClickHouse/pull/26235) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* convert timestamp and timestamptz data types to `DateTime64` in PostgreSQL table engine. [#26234](https://github.com/ClickHouse/ClickHouse/pull/26234) ([jasine](https://github.com/jasine)).
+* Apply aggressive IN index analysis for projections so that better projection candidate can be selected. [#26218](https://github.com/ClickHouse/ClickHouse/pull/26218) ([Amos Bird](https://github.com/amosbird)).
+* Remove GLOBAL keyword for IN when scalar function is passed. In previous versions, if user specified `GLOBAL IN f(x)` exception was thrown. [#26217](https://github.com/ClickHouse/ClickHouse/pull/26217) ([Amos Bird](https://github.com/amosbird)).
+* Add error id (like `BAD_ARGUMENTS`) to exception messages. This closes [#25862](https://github.com/ClickHouse/ClickHouse/issues/25862). [#26172](https://github.com/ClickHouse/ClickHouse/pull/26172) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Fix incorrect output with --progress option for clickhouse-local. Progress bar will be cleared once it gets to 100% - same as it is done for clickhouse-client. Closes [#17484](https://github.com/ClickHouse/ClickHouse/issues/17484). [#26128](https://github.com/ClickHouse/ClickHouse/pull/26128) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Add `merge_selecting_sleep_ms` setting. [#26120](https://github.com/ClickHouse/ClickHouse/pull/26120) ([lthaooo](https://github.com/lthaooo)).
+* Remove complicated usage of Linux AIO with one block readahead and replace it with plain simple synchronous IO with O_DIRECT. In previous versions, the setting `min_bytes_to_use_direct_io` may not work correctly if `max_threads` is greater than one. Reading with direct IO (that is disabled by default for queries and enabled by default for large merges) will work in less efficient way. This closes [#25997](https://github.com/ClickHouse/ClickHouse/issues/25997). [#26003](https://github.com/ClickHouse/ClickHouse/pull/26003) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Flush `Distributed` table on `REPLACE TABLE` query. Resolves [#24566](https://github.com/ClickHouse/ClickHouse/issues/24566) - Do not replace (or create) table on `[CREATE OR] REPLACE TABLE ... AS SELECT` query if insertion into new table fails. Resolves [#23175](https://github.com/ClickHouse/ClickHouse/issues/23175). [#25895](https://github.com/ClickHouse/ClickHouse/pull/25895) ([tavplubix](https://github.com/tavplubix)).
+* Add `views` column to system.query_log containing the names of the (materialized or live) views executed by the query. Adds a new log table (`system.query_views_log`) that contains information about each view executed during a query. Modifies view execution: When an exception is thrown while executing a view, any view that has already startedwill continue running until it finishes. This used to be the behaviour under parallel_view_processing=true and now it's always the same behaviour. - Dependent views now report reading progress to the context. [#25714](https://github.com/ClickHouse/ClickHouse/pull/25714) ([Raúl Marín](https://github.com/Algunenano)).
+* Do connection draining asynchonously upon finishing executing distributed queries. A new server setting is added `max_threads_for_connection_collector` which specifies the number of workers to recycle connections in background. If the pool is full, connection will be drained synchronously but a bit different than before: It's drained after we send EOS to client, query will succeed immediately after receiving enough data, and any exception will be logged instead of throwing to the client. Added setting `drain_timeout` (3 seconds by default). Connection draining will disconnect upon timeout. [#25674](https://github.com/ClickHouse/ClickHouse/pull/25674) ([Amos Bird](https://github.com/amosbird)).
+* Support for multiple includes in configuration. It is possible to include users configuration, remote servers configuration from multiple sources. Simply place `` element with `from_zk`, `from_env` or `incl` attribute and it will be replaced with the substitution. [#24404](https://github.com/ClickHouse/ClickHouse/pull/24404) ([nvartolomei](https://github.com/nvartolomei)).
+* Fix multiple block insertion into distributed table with `insert_distributed_one_random_shard = 1`. This is a marginal feature. Mark as improvement. [#23140](https://github.com/ClickHouse/ClickHouse/pull/23140) ([Amos Bird](https://github.com/amosbird)).
+* Support `LowCardinality` and `FixedString` keys/values for `Map` type. [#21543](https://github.com/ClickHouse/ClickHouse/pull/21543) ([hexiaoting](https://github.com/hexiaoting)).
+* Enable reloading of local disk config. [#19526](https://github.com/ClickHouse/ClickHouse/pull/19526) ([taiyang-li](https://github.com/taiyang-li)).
+* Now KeyConditions can correctly skip nullable keys, including `isNull` and `isNotNull`. https://github.com/ClickHouse/ClickHouse/pull/12433. [#12455](https://github.com/ClickHouse/ClickHouse/pull/12455) ([Amos Bird](https://github.com/amosbird)).
+
+#### Bug Fix
+
+* Fix a couple of bugs that may cause replicas to diverge. [#27808](https://github.com/ClickHouse/ClickHouse/pull/27808) ([tavplubix](https://github.com/tavplubix)).
+* Fix a rare bug in `DROP PART` which can lead to the error `Unexpected merged part intersects drop range`. [#27807](https://github.com/ClickHouse/ClickHouse/pull/27807) ([alesapin](https://github.com/alesapin)).
+* Prevent crashes for some formats when NULL (tombstone) message was coming from Kafka. Closes [#19255](https://github.com/ClickHouse/ClickHouse/issues/19255). [#27794](https://github.com/ClickHouse/ClickHouse/pull/27794) ([filimonov](https://github.com/filimonov)).
+* Fix column filtering with union distinct in subquery. Closes [#27578](https://github.com/ClickHouse/ClickHouse/issues/27578). [#27689](https://github.com/ClickHouse/ClickHouse/pull/27689) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Fix bad type cast when functions like `arrayHas` are applied to arrays of LowCardinality of Nullable of different non-numeric types like `DateTime` and `DateTime64`. In previous versions bad cast occurs. In new version it will lead to exception. This closes [#26330](https://github.com/ClickHouse/ClickHouse/issues/26330). [#27682](https://github.com/ClickHouse/ClickHouse/pull/27682) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Fix postgresql table function resulting in non-closing connections. Closes [#26088](https://github.com/ClickHouse/ClickHouse/issues/26088). [#27662](https://github.com/ClickHouse/ClickHouse/pull/27662) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Fixed another case of `Unexpected merged part ... intersecting drop range ...` error. [#27656](https://github.com/ClickHouse/ClickHouse/pull/27656) ([tavplubix](https://github.com/tavplubix)).
+* Fix an error with aliased column in `Distributed` table. [#27652](https://github.com/ClickHouse/ClickHouse/pull/27652) ([Vladimir C](https://github.com/vdimir)).
+* After setting `max_memory_usage*` to non-zero value it was not possible to reset it back to 0 (unlimited). It's fixed. [#27638](https://github.com/ClickHouse/ClickHouse/pull/27638) ([tavplubix](https://github.com/tavplubix)).
+* Fixed underflow of the time value when constructing it from components. Closes [#27193](https://github.com/ClickHouse/ClickHouse/issues/27193). [#27605](https://github.com/ClickHouse/ClickHouse/pull/27605) ([Vasily Nemkov](https://github.com/Enmk)).
+* Fix crash during projection materialization when some parts contain missing columns. This fixes [#27512](https://github.com/ClickHouse/ClickHouse/issues/27512). [#27528](https://github.com/ClickHouse/ClickHouse/pull/27528) ([Amos Bird](https://github.com/amosbird)).
+* fix metric `BackgroundMessageBrokerSchedulePoolTask`, maybe mistyped. [#27452](https://github.com/ClickHouse/ClickHouse/pull/27452) ([Ben](https://github.com/benbiti)).
+* Fix distributed queries with zero shards and aggregation. [#27427](https://github.com/ClickHouse/ClickHouse/pull/27427) ([Azat Khuzhin](https://github.com/azat)).
+* Compatibility when `/proc/meminfo` does not contain KB suffix. [#27361](https://github.com/ClickHouse/ClickHouse/pull/27361) ([Mike Kot](https://github.com/myrrc)).
+* Fix incorrect result for query with row-level security, PREWHERE and LowCardinality filter. Fixes [#27179](https://github.com/ClickHouse/ClickHouse/issues/27179). [#27329](https://github.com/ClickHouse/ClickHouse/pull/27329) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
+* Fixed incorrect validation of partition id for MergeTree tables that created with old syntax. [#27328](https://github.com/ClickHouse/ClickHouse/pull/27328) ([tavplubix](https://github.com/tavplubix)).
+* Fix MySQL protocol when using parallel formats (CSV / TSV). [#27326](https://github.com/ClickHouse/ClickHouse/pull/27326) ([Raúl Marín](https://github.com/Algunenano)).
+* Fix `Cannot find column` error for queries with sampling. Was introduced in [#24574](https://github.com/ClickHouse/ClickHouse/issues/24574). Fixes [#26522](https://github.com/ClickHouse/ClickHouse/issues/26522). [#27301](https://github.com/ClickHouse/ClickHouse/pull/27301) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
+* Fix errors like `Expected ColumnLowCardinality, gotUInt8` or `Bad cast from type DB::ColumnVector to DB::ColumnLowCardinality` for some queries with `LowCardinality` in `PREWHERE`. And more importantly, fix the lack of whitespace in the error message. Fixes [#23515](https://github.com/ClickHouse/ClickHouse/issues/23515). [#27298](https://github.com/ClickHouse/ClickHouse/pull/27298) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
+* Fix `distributed_group_by_no_merge = 2` with `distributed_push_down_limit = 1` or `optimize_distributed_group_by_sharding_key = 1` with `LIMIT BY` and `LIMIT OFFSET`. [#27249](https://github.com/ClickHouse/ClickHouse/pull/27249) ([Azat Khuzhin](https://github.com/azat)). These are obscure combination of settings that no one is using.
+* Fix mutation stuck on invalid partitions in non-replicated MergeTree. [#27248](https://github.com/ClickHouse/ClickHouse/pull/27248) ([Azat Khuzhin](https://github.com/azat)).
+* In case of ambiguity, lambda functions prefer its arguments to other aliases or identifiers. [#27235](https://github.com/ClickHouse/ClickHouse/pull/27235) ([Raúl Marín](https://github.com/Algunenano)).
+* Fix column structure in merge join, close [#27091](https://github.com/ClickHouse/ClickHouse/issues/27091). [#27217](https://github.com/ClickHouse/ClickHouse/pull/27217) ([Vladimir C](https://github.com/vdimir)).
+* In rare cases `system.detached_parts` table might contain incorrect information for some parts, it's fixed. Fixes [#27114](https://github.com/ClickHouse/ClickHouse/issues/27114). [#27183](https://github.com/ClickHouse/ClickHouse/pull/27183) ([tavplubix](https://github.com/tavplubix)).
+* Fix uninitialized memory in functions `multiSearch*` with empty array, close [#27169](https://github.com/ClickHouse/ClickHouse/issues/27169). [#27181](https://github.com/ClickHouse/ClickHouse/pull/27181) ([Vladimir C](https://github.com/vdimir)).
+* Fix synchronization in GRPCServer. This PR fixes [#27024](https://github.com/ClickHouse/ClickHouse/issues/27024). [#27064](https://github.com/ClickHouse/ClickHouse/pull/27064) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Fixed `cache`, `complex_key_cache`, `ssd_cache`, `complex_key_ssd_cache` configuration parsing. Options `allow_read_expired_keys`, `max_update_queue_size`, `update_queue_push_timeout_milliseconds`, `query_wait_timeout_milliseconds` were not parsed for dictionaries with non `cache` type. [#27032](https://github.com/ClickHouse/ClickHouse/pull/27032) ([Maksim Kita](https://github.com/kitaisreal)).
+* Fix possible mutation stack due to race with DROP_RANGE. [#27002](https://github.com/ClickHouse/ClickHouse/pull/27002) ([Azat Khuzhin](https://github.com/azat)).
+* Now partition ID in queries like `ALTER TABLE ... PARTITION ID xxx` validates for correctness. Fixes [#25718](https://github.com/ClickHouse/ClickHouse/issues/25718). [#26963](https://github.com/ClickHouse/ClickHouse/pull/26963) ([alesapin](https://github.com/alesapin)).
+* Fix "Unknown column name" error with multiple JOINs in some cases, close [#26899](https://github.com/ClickHouse/ClickHouse/issues/26899). [#26957](https://github.com/ClickHouse/ClickHouse/pull/26957) ([Vladimir C](https://github.com/vdimir)).
+* Fix reading of custom TLDs (stops processing with lower buffer or bigger file). [#26948](https://github.com/ClickHouse/ClickHouse/pull/26948) ([Azat Khuzhin](https://github.com/azat)).
+* Fix error `Missing columns: 'xxx'` when `DEFAULT` column references other non materialized column without `DEFAULT` expression. Fixes [#26591](https://github.com/ClickHouse/ClickHouse/issues/26591). [#26900](https://github.com/ClickHouse/ClickHouse/pull/26900) ([alesapin](https://github.com/alesapin)).
+* Fix loading of dictionary keys in `library-bridge` for `library` dictionary source. [#26834](https://github.com/ClickHouse/ClickHouse/pull/26834) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Aggregate function parameters might be lost when applying some combinators causing exceptions like `Conversion from AggregateFunction(topKArray, Array(String)) to AggregateFunction(topKArray(10), Array(String)) is not supported`. It's fixed. Fixes [#26196](https://github.com/ClickHouse/ClickHouse/issues/26196) and [#26433](https://github.com/ClickHouse/ClickHouse/issues/26433). [#26814](https://github.com/ClickHouse/ClickHouse/pull/26814) ([tavplubix](https://github.com/tavplubix)).
+* Add `event_time_microseconds` value for `REMOVE_PART` in `system.part_log`. In previous versions is was not set. [#26720](https://github.com/ClickHouse/ClickHouse/pull/26720) ([Azat Khuzhin](https://github.com/azat)).
+* Do not remove data on ReplicatedMergeTree table shutdown to avoid creating data to metadata inconsistency. [#26716](https://github.com/ClickHouse/ClickHouse/pull/26716) ([nvartolomei](https://github.com/nvartolomei)).
+* Sometimes `SET ROLE` could work incorrectly, this PR fixes that. [#26707](https://github.com/ClickHouse/ClickHouse/pull/26707) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Some fixes for parallel formatting (https://github.com/ClickHouse/ClickHouse/issues/26694). [#26703](https://github.com/ClickHouse/ClickHouse/pull/26703) ([Raúl Marín](https://github.com/Algunenano)).
+* Fix potential nullptr dereference in window functions. This fixes [#25276](https://github.com/ClickHouse/ClickHouse/issues/25276). [#26668](https://github.com/ClickHouse/ClickHouse/pull/26668) ([Alexander Kuzmenkov](https://github.com/akuzm)).
+* Fix clickhouse-client history file conversion (when upgrading from the format of 3 years old version of clickhouse-client) if file is empty. [#26589](https://github.com/ClickHouse/ClickHouse/pull/26589) ([Azat Khuzhin](https://github.com/azat)).
+* Fix incorrect function names of groupBitmapAnd/Or/Xor (can be displayed in some occasions). This fixes. [#26557](https://github.com/ClickHouse/ClickHouse/pull/26557) ([Amos Bird](https://github.com/amosbird)).
+* Update `chown` cmd check in clickhouse-server docker entrypoint. It fixes the bug that cluster pod restart failed (or timeout) on kubernetes. [#26545](https://github.com/ClickHouse/ClickHouse/pull/26545) ([Ky Li](https://github.com/Kylinrix)).
+* Fix crash in `RabbitMQ` shutdown in case `RabbitMQ` setup was not started. Closes [#26504](https://github.com/ClickHouse/ClickHouse/issues/26504). [#26529](https://github.com/ClickHouse/ClickHouse/pull/26529) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Fix issues with `CREATE DICTIONARY` query if dictionary name or database name was quoted. Closes [#26491](https://github.com/ClickHouse/ClickHouse/issues/26491). [#26508](https://github.com/ClickHouse/ClickHouse/pull/26508) ([Maksim Kita](https://github.com/kitaisreal)).
+* Fix broken column name resolution after rewriting column aliases. This fixes [#26432](https://github.com/ClickHouse/ClickHouse/issues/26432). [#26475](https://github.com/ClickHouse/ClickHouse/pull/26475) ([Amos Bird](https://github.com/amosbird)).
+* Fix some fuzzed msan crash. Fixes [#22517](https://github.com/ClickHouse/ClickHouse/issues/22517). [#26428](https://github.com/ClickHouse/ClickHouse/pull/26428) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
+* Fix infinite non joined block stream in `partial_merge_join` close [#26325](https://github.com/ClickHouse/ClickHouse/issues/26325). [#26374](https://github.com/ClickHouse/ClickHouse/pull/26374) ([Vladimir C](https://github.com/vdimir)).
+* Fix possible crash when login as dropped user. This PR fixes [#26073](https://github.com/ClickHouse/ClickHouse/issues/26073). [#26363](https://github.com/ClickHouse/ClickHouse/pull/26363) ([Vitaly Baranov](https://github.com/vitlibar)).
+* Fix `optimize_distributed_group_by_sharding_key` for multiple columns (leads to incorrect result w/ `optimize_skip_unused_shards=1`/`allow_nondeterministic_optimize_skip_unused_shards=1` and multiple columns in sharding key expression). [#26353](https://github.com/ClickHouse/ClickHouse/pull/26353) ([Azat Khuzhin](https://github.com/azat)).
+* Fixed rare bug in lost replica recovery that may cause replicas to diverge. [#26321](https://github.com/ClickHouse/ClickHouse/pull/26321) ([tavplubix](https://github.com/tavplubix)).
+* Fix zstd decompression (for import/export in zstd framing format that is unrelated to tables data) in case there are escape sequences at the end of internal buffer. Closes [#26013](https://github.com/ClickHouse/ClickHouse/issues/26013). [#26314](https://github.com/ClickHouse/ClickHouse/pull/26314) ([Kseniia Sumarokova](https://github.com/kssenii)).
+* Fix logical error on join with totals, close [#26017](https://github.com/ClickHouse/ClickHouse/issues/26017). [#26250](https://github.com/ClickHouse/ClickHouse/pull/26250) ([Vladimir C](https://github.com/vdimir)).
+* Remove excessive newline in `thread_name` column in `system.stack_trace` table. This fixes [#24124](https://github.com/ClickHouse/ClickHouse/issues/24124). [#26210](https://github.com/ClickHouse/ClickHouse/pull/26210) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Fix potential crash if more than one `untuple` expression is used. [#26179](https://github.com/ClickHouse/ClickHouse/pull/26179) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Don't throw exception in `toString` for Nullable Enum if Enum does not have a value for zero, close [#25806](https://github.com/ClickHouse/ClickHouse/issues/25806). [#26123](https://github.com/ClickHouse/ClickHouse/pull/26123) ([Vladimir C](https://github.com/vdimir)).
+* Fixed incorrect `sequence_id` in MySQL protocol packets that ClickHouse sends on exception during query execution. It might cause MySQL client to reset connection to ClickHouse server. Fixes [#21184](https://github.com/ClickHouse/ClickHouse/issues/21184). [#26051](https://github.com/ClickHouse/ClickHouse/pull/26051) ([tavplubix](https://github.com/tavplubix)).
+* Fix for the case that `cutToFirstSignificantSubdomainCustom()`/`cutToFirstSignificantSubdomainCustomWithWWW()`/`firstSignificantSubdomainCustom()` returns incorrect type for consts, and hence `optimize_skip_unused_shards` does not work:. [#26041](https://github.com/ClickHouse/ClickHouse/pull/26041) ([Azat Khuzhin](https://github.com/azat)).
+* Fix possible mismatched header when using normal projection with prewhere. This fixes [#26020](https://github.com/ClickHouse/ClickHouse/issues/26020). [#26038](https://github.com/ClickHouse/ClickHouse/pull/26038) ([Amos Bird](https://github.com/amosbird)).
+* Fix sharding_key from column w/o function for remote() (before `select * from remote('127.1', system.one, dummy)` leads to `Unknown column: dummy, there are only columns .` error). [#25824](https://github.com/ClickHouse/ClickHouse/pull/25824) ([Azat Khuzhin](https://github.com/azat)).
+* Fixed `Not found column ...` and `Missing column ...` errors when selecting from `MaterializeMySQL`. Fixes [#23708](https://github.com/ClickHouse/ClickHouse/issues/23708), [#24830](https://github.com/ClickHouse/ClickHouse/issues/24830), [#25794](https://github.com/ClickHouse/ClickHouse/issues/25794). [#25822](https://github.com/ClickHouse/ClickHouse/pull/25822) ([tavplubix](https://github.com/tavplubix)).
+* Fix `optimize_skip_unused_shards_rewrite_in` for non-UInt64 types (may select incorrect shards eventually or throw `Cannot infer type of an empty tuple` or `Function tuple requires at least one argument`). [#25798](https://github.com/ClickHouse/ClickHouse/pull/25798) ([Azat Khuzhin](https://github.com/azat)).
+
+#### Build/Testing/Packaging Improvement
+
+* Now we ran stateful and stateless tests in random timezones. Fixes [#12439](https://github.com/ClickHouse/ClickHouse/issues/12439). Reading String as DateTime and writing DateTime as String in Protobuf format now respect timezone. Reading UInt16 as DateTime in Arrow and Parquet formats now treat it as Date and then converts to DateTime with respect to DateTime's timezone, because Date is serialized in Arrow and Parquet as UInt16. GraphiteMergeTree now respect time zone for rounding of times. Fixes [#5098](https://github.com/ClickHouse/ClickHouse/issues/5098). Author: @alexey-milovidov. [#15408](https://github.com/ClickHouse/ClickHouse/pull/15408) ([alesapin](https://github.com/alesapin)).
+* `clickhouse-test` supports SQL tests with [Jinja2](https://jinja.palletsprojects.com/en/3.0.x/templates/#synopsis) templates. [#26579](https://github.com/ClickHouse/ClickHouse/pull/26579) ([Vladimir C](https://github.com/vdimir)).
+* Add support for build with `clang-13`. This closes [#27705](https://github.com/ClickHouse/ClickHouse/issues/27705). [#27714](https://github.com/ClickHouse/ClickHouse/pull/27714) ([alexey-milovidov](https://github.com/alexey-milovidov)). [#27777](https://github.com/ClickHouse/ClickHouse/pull/27777) ([Sergei Semin](https://github.com/syominsergey))
+* Add CMake options to build with or without specific CPU instruction set. This is for [#17469](https://github.com/ClickHouse/ClickHouse/issues/17469) and [#27509](https://github.com/ClickHouse/ClickHouse/issues/27509). [#27508](https://github.com/ClickHouse/ClickHouse/pull/27508) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+* Fix linking of auxiliar programs when using dynamic libraries. [#26958](https://github.com/ClickHouse/ClickHouse/pull/26958) ([Raúl Marín](https://github.com/Algunenano)).
+* Update RocksDB to `2021-07-16` master. [#26411](https://github.com/ClickHouse/ClickHouse/pull/26411) ([alexey-milovidov](https://github.com/alexey-milovidov)).
+
+
### ClickHouse release v21.8, 2021-08-12
#### Upgrade Notes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index de517b1b589..9c8903d853c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,16 +80,16 @@ include (cmake/find/ccache.cmake)
# ccache ignore it.
option(ENABLE_CHECK_HEAVY_BUILDS "Don't allow C++ translation units to compile too long or to take too much memory while compiling." OFF)
if (ENABLE_CHECK_HEAVY_BUILDS)
- # set DATA (since RSS does not work since 2.6.x+) to 2G
+ # set DATA (since RSS does not work since 2.6.x+) to 5G
set (RLIMIT_DATA 5000000000)
# set VIRT (RLIMIT_AS) to 10G (DATA*10)
set (RLIMIT_AS 10000000000)
- # set CPU time limit to 600 seconds
- set (RLIMIT_CPU 600)
+ # set CPU time limit to 1000 seconds
+ set (RLIMIT_CPU 1000)
# gcc10/gcc10/clang -fsanitize=memory is too heavy
if (SANITIZE STREQUAL "memory" OR COMPILER_GCC)
- set (RLIMIT_DATA 10000000000)
+ set (RLIMIT_DATA 10000000000) # 10G
endif()
set (CMAKE_CXX_COMPILER_LAUNCHER prlimit --as=${RLIMIT_AS} --data=${RLIMIT_DATA} --cpu=${RLIMIT_CPU} ${CMAKE_CXX_COMPILER_LAUNCHER})
@@ -152,6 +152,7 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT DISABLE_COLORED_BUILD)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
endif ()
+include (cmake/check_flags.cmake)
include (cmake/add_warning.cmake)
if (NOT MSVC)
@@ -165,6 +166,14 @@ if (COMPILER_CLANG)
if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -gdwarf-aranges")
endif ()
+
+ if (HAS_USE_CTOR_HOMING)
+ # For more info see https://blog.llvm.org/posts/2021-04-05-constructor-homing-for-debug-info/
+ if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELWITHDEBINFO")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fuse-ctor-homing")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Xclang -fuse-ctor-homing")
+ endif()
+ endif()
endif ()
# If turned `ON`, assumes the user has either the system GTest library or the bundled one.
@@ -185,7 +194,7 @@ endif ()
# Make sure the final executable has symbols exported
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
-find_program (OBJCOPY_PATH NAMES "llvm-objcopy" "llvm-objcopy-12" "llvm-objcopy-11" "llvm-objcopy-10" "llvm-objcopy-9" "llvm-objcopy-8" "objcopy")
+find_program (OBJCOPY_PATH NAMES "llvm-objcopy" "llvm-objcopy-13" "llvm-objcopy-12" "llvm-objcopy-11" "llvm-objcopy-10" "llvm-objcopy-9" "llvm-objcopy-8" "objcopy")
if (NOT OBJCOPY_PATH AND OS_DARWIN)
find_program (BREW_PATH NAMES "brew")
@@ -372,7 +381,7 @@ if (COMPILER_CLANG)
endif ()
# Always prefer llvm tools when using clang. For instance, we cannot use GNU ar when llvm LTO is enabled
- find_program (LLVM_AR_PATH NAMES "llvm-ar" "llvm-ar-12" "llvm-ar-11" "llvm-ar-10" "llvm-ar-9" "llvm-ar-8")
+ find_program (LLVM_AR_PATH NAMES "llvm-ar" "llvm-ar-13" "llvm-ar-12" "llvm-ar-11" "llvm-ar-10" "llvm-ar-9" "llvm-ar-8")
if (LLVM_AR_PATH)
message(STATUS "Using llvm-ar: ${LLVM_AR_PATH}.")
@@ -381,7 +390,7 @@ if (COMPILER_CLANG)
message(WARNING "Cannot find llvm-ar. System ar will be used instead. It does not work with ThinLTO.")
endif ()
- find_program (LLVM_RANLIB_PATH NAMES "llvm-ranlib" "llvm-ranlib-12" "llvm-ranlib-11" "llvm-ranlib-10" "llvm-ranlib-9" "llvm-ranlib-8")
+ find_program (LLVM_RANLIB_PATH NAMES "llvm-ranlib" "llvm-ranlib-13" "llvm-ranlib-12" "llvm-ranlib-11" "llvm-ranlib-10" "llvm-ranlib-9" "llvm-ranlib-8")
if (LLVM_RANLIB_PATH)
message(STATUS "Using llvm-ranlib: ${LLVM_RANLIB_PATH}.")
@@ -622,9 +631,6 @@ include_directories(${ConfigIncludePath})
# Add as many warnings as possible for our own code.
include (cmake/warnings.cmake)
-# Check if needed compiler flags are supported
-include (cmake/check_flags.cmake)
-
add_subdirectory (base)
add_subdirectory (src)
add_subdirectory (programs)
diff --git a/LICENSE b/LICENSE
index 9167b80e269..c46bc7d19e1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2016-2021 Yandex LLC
+Copyright 2016-2021 ClickHouse, Inc.
Apache License
Version 2.0, January 2004
diff --git a/SECURITY.md b/SECURITY.md
index 846b7e8239c..0405d5cf8fc 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -28,15 +28,16 @@ The following versions of ClickHouse server are currently being supported with s
| 21.3 | ✅ |
| 21.4 | :x: |
| 21.5 | :x: |
-| 21.6 | ✅ |
+| 21.6 | :x: |
| 21.7 | ✅ |
| 21.8 | ✅ |
+| 21.9 | ✅ |
## Reporting a Vulnerability
We're extremely grateful for security researchers and users that report vulnerabilities to the ClickHouse Open Source Community. All reports are thoroughly investigated by developers.
-To report a potential vulnerability in ClickHouse please send the details about it to [clickhouse-feedback@yandex-team.com](mailto:clickhouse-feedback@yandex-team.com).
+To report a potential vulnerability in ClickHouse please send the details about it to [security@clickhouse.com](mailto:security@clickhouse.com).
### When Should I Report a Vulnerability?
diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt
index e5e18669ebe..202a2dff56f 100644
--- a/base/common/CMakeLists.txt
+++ b/base/common/CMakeLists.txt
@@ -85,6 +85,7 @@ target_link_libraries (common
replxx
cctz
fmt
+ magic_enum
)
if (ENABLE_TESTS)
diff --git a/base/common/Decimal.h b/base/common/Decimal.h
new file mode 100644
index 00000000000..e856abf23c7
--- /dev/null
+++ b/base/common/Decimal.h
@@ -0,0 +1,157 @@
+#pragma once
+#include "common/extended_types.h"
+
+#if !defined(NO_SANITIZE_UNDEFINED)
+#if defined(__clang__)
+ #define NO_SANITIZE_UNDEFINED __attribute__((__no_sanitize__("undefined")))
+#else
+ #define NO_SANITIZE_UNDEFINED
+#endif
+#endif
+
+namespace DB
+{
+template struct Decimal;
+class DateTime64;
+
+using Decimal32 = Decimal;
+using Decimal64 = Decimal;
+using Decimal128 = Decimal;
+using Decimal256 = Decimal;
+
+template
+concept is_decimal =
+ std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v;
+
+template
+concept is_over_big_int =
+ std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v;
+
+template struct NativeTypeT { using Type = T; };
+template struct NativeTypeT { using Type = typename T::NativeType; };
+template using NativeType = typename NativeTypeT::Type;
+
+/// Own FieldType for Decimal.
+/// It is only a "storage" for decimal.
+/// To perform operations, you also have to provide a scale (number of digits after point).
+template
+struct Decimal
+{
+ using NativeType = T;
+
+ constexpr Decimal() = default;
+ constexpr Decimal(Decimal &&) = default;
+ constexpr Decimal(const Decimal &) = default;
+
+ constexpr Decimal(const T & value_): value(value_) {}
+
+ template
+ constexpr Decimal(const Decimal & x): value(x.value) {}
+
+ constexpr Decimal & operator = (Decimal &&) = default;
+ constexpr Decimal & operator = (const Decimal &) = default;
+
+ constexpr operator T () const { return value; }
+
+ template
+ constexpr U convertTo() const
+ {
+ if constexpr (is_decimal)
+ return convertTo();
+ else
+ return static_cast(value);
+ }
+
+ const Decimal & operator += (const T & x) { value += x; return *this; }
+ const Decimal & operator -= (const T & x) { value -= x; return *this; }
+ const Decimal & operator *= (const T & x) { value *= x; return *this; }
+ const Decimal & operator /= (const T & x) { value /= x; return *this; }
+ const Decimal & operator %= (const T & x) { value %= x; return *this; }
+
+ template const Decimal & operator += (const Decimal & x) { value += x.value; return *this; }
+ template const Decimal & operator -= (const Decimal & x) { value -= x.value; return *this; }
+ template const Decimal & operator *= (const Decimal & x) { value *= x.value; return *this; }
+ template const Decimal & operator /= (const Decimal & x) { value /= x.value; return *this; }
+ template const Decimal & operator %= (const Decimal & x) { value %= x.value; return *this; }
+
+ /// This is to avoid UB for sumWithOverflow()
+ void NO_SANITIZE_UNDEFINED addOverflow(const T & x) { value += x; }
+
+ T value;
+};
+
+template inline bool operator< (const Decimal & x, const Decimal & y) { return x.value < y.value; }
+template inline bool operator> (const Decimal & x, const Decimal & y) { return x.value > y.value; }
+template inline bool operator<= (const Decimal & x, const Decimal & y) { return x.value <= y.value; }
+template inline bool operator>= (const Decimal & x, const Decimal & y) { return x.value >= y.value; }
+template inline bool operator== (const Decimal & x, const Decimal & y) { return x.value == y.value; }
+template inline bool operator!= (const Decimal & x, const Decimal & y) { return x.value != y.value; }
+
+template inline Decimal operator+ (const Decimal & x, const Decimal & y) { return x.value + y.value; }
+template inline Decimal operator- (const Decimal & x, const Decimal & y) { return x.value - y.value; }
+template inline Decimal operator* (const Decimal & x, const Decimal & y) { return x.value * y.value; }
+template inline Decimal operator/ (const Decimal & x, const Decimal & y) { return x.value / y.value; }
+template inline Decimal operator- (const Decimal & x) { return -x.value; }
+
+/// Distinguishable type to allow function resolution/deduction based on value type,
+/// but also relatively easy to convert to/from Decimal64.
+class DateTime64 : public Decimal64
+{
+public:
+ using Base = Decimal64;
+ using Base::Base;
+ using NativeType = Base::NativeType;
+
+ constexpr DateTime64(const Base & v): Base(v) {}
+};
+}
+
+constexpr DB::UInt64 max_uint_mask = std::numeric_limits::max();
+
+namespace std
+{
+ template
+ struct hash>
+ {
+ size_t operator()(const DB::Decimal & x) const { return hash()(x.value); }
+ };
+
+ template <>
+ struct hash
+ {
+ size_t operator()(const DB::Decimal128 & x) const
+ {
+ return std::hash()(x.value >> 64)
+ ^ std::hash()(x.value & max_uint_mask);
+ }
+ };
+
+ template <>
+ struct hash
+ {
+ size_t operator()(const DB::DateTime64 & x) const
+ {
+ return std::hash()(x);
+ }
+ };
+
+ template <>
+ struct hash
+ {
+ size_t operator()(const DB::Decimal256 & x) const
+ {
+ // FIXME temp solution
+ return std::hash()(static_cast(x.value >> 64 & max_uint_mask))
+ ^ std::hash()(static_cast(x.value & max_uint_mask));
+ }
+ };
+}
diff --git a/base/common/EnumReflection.h b/base/common/EnumReflection.h
new file mode 100644
index 00000000000..0d1f8ae0a40
--- /dev/null
+++ b/base/common/EnumReflection.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include
+#include
+
+template concept is_enum = std::is_enum_v;
+
+namespace detail
+{
+template
+constexpr void static_for(F && f, std::index_sequence)
+{
+ (std::forward(f)(std::integral_constant(I)>()) , ...);
+}
+}
+
+/**
+ * Iterate over enum values in compile-time (compile-time switch/case, loop unrolling).
+ *
+ * @example static_for([](auto enum_value) { return template_func(); }
+ * ^ enum_value can be used as a template parameter
+ */
+template
+constexpr void static_for(F && f)
+{
+ constexpr size_t count = magic_enum::enum_count();
+ detail::static_for(std::forward(f), std::make_index_sequence());
+}
+
+/// Enable printing enum values as strings via fmt + magic_enum
+template
+struct fmt::formatter : fmt::formatter
+{
+ constexpr auto format(T value, auto& format_context)
+ {
+ return formatter::format(magic_enum::enum_name(value), format_context);
+ }
+};
diff --git a/base/common/LineReader.cpp b/base/common/LineReader.cpp
index a32906dd5a5..7dc37322bb0 100644
--- a/base/common/LineReader.cpp
+++ b/base/common/LineReader.cpp
@@ -16,6 +16,10 @@ extern "C"
}
#endif
+#if defined(__clang__) && __clang_major__ >= 13
+#pragma clang diagnostic ignored "-Wreserved-identifier"
+#endif
+
namespace
{
diff --git a/base/common/StringRef.h b/base/common/StringRef.h
index ac9d7c47b72..61abc268da4 100644
--- a/base/common/StringRef.h
+++ b/base/common/StringRef.h
@@ -96,6 +96,39 @@ inline bool compareSSE2x4(const char * p1, const char * p2)
inline bool memequalSSE2Wide(const char * p1, const char * p2, size_t size)
{
+ /** The order of branches and the trick with overlapping comparisons
+ * are the same as in memcpy implementation.
+ * See the comments in base/glibc-compatibility/memcpy/memcpy.h
+ */
+
+ if (size <= 16)
+ {
+ if (size >= 8)
+ {
+ /// Chunks of 8..16 bytes.
+ return unalignedLoad(p1) == unalignedLoad(p2)
+ && unalignedLoad(p1 + size - 8) == unalignedLoad(p2 + size - 8);
+ }
+ else if (size >= 4)
+ {
+ /// Chunks of 4..7 bytes.
+ return unalignedLoad(p1) == unalignedLoad(p2)
+ && unalignedLoad(p1 + size - 4) == unalignedLoad(p2 + size - 4);
+ }
+ else if (size >= 2)
+ {
+ /// Chunks of 2..3 bytes.
+ return unalignedLoad(p1) == unalignedLoad(p2)
+ && unalignedLoad(p1 + size - 2) == unalignedLoad(p2 + size - 2);
+ }
+ else if (size >= 1)
+ {
+ /// A single byte.
+ return *p1 == *p2;
+ }
+ return true;
+ }
+
while (size >= 64)
{
if (compareSSE2x4(p1, p2))
@@ -108,39 +141,14 @@ inline bool memequalSSE2Wide(const char * p1, const char * p2, size_t size)
return false;
}
- switch ((size % 64) / 16)
+ switch (size / 16)
{
case 3: if (!compareSSE2(p1 + 32, p2 + 32)) return false; [[fallthrough]];
case 2: if (!compareSSE2(p1 + 16, p2 + 16)) return false; [[fallthrough]];
- case 1: if (!compareSSE2(p1 , p2 )) return false; [[fallthrough]];
- case 0: break;
+ case 1: if (!compareSSE2(p1, p2)) return false;
}
- p1 += (size % 64) / 16 * 16;
- p2 += (size % 64) / 16 * 16;
-
- switch (size % 16)
- {
- case 15: if (p1[14] != p2[14]) return false; [[fallthrough]];
- case 14: if (p1[13] != p2[13]) return false; [[fallthrough]];
- case 13: if (p1[12] != p2[12]) return false; [[fallthrough]];
- case 12: if (unalignedLoad(p1 + 8) == unalignedLoad(p2 + 8)) goto l8; else return false;
- case 11: if (p1[10] != p2[10]) return false; [[fallthrough]];
- case 10: if (p1[9] != p2[9]) return false; [[fallthrough]];
- case 9: if (p1[8] != p2[8]) return false;
- l8: [[fallthrough]];
- case 8: return unalignedLoad(p1) == unalignedLoad(p2);
- case 7: if (p1[6] != p2[6]) return false; [[fallthrough]];
- case 6: if (p1[5] != p2[5]) return false; [[fallthrough]];
- case 5: if (p1[4] != p2[4]) return false; [[fallthrough]];
- case 4: return unalignedLoad(p1) == unalignedLoad(p2);
- case 3: if (p1[2] != p2[2]) return false; [[fallthrough]];
- case 2: return unalignedLoad(p1) == unalignedLoad(p2);
- case 1: if (p1[0] != p2[0]) return false; [[fallthrough]];
- case 0: break;
- }
-
- return true;
+ return compareSSE2(p1 + size - 16, p2 + size - 16);
}
#endif
diff --git a/base/common/arithmeticOverflow.h b/base/common/arithmeticOverflow.h
index 175e75a62f4..0957342bbb4 100644
--- a/base/common/arithmeticOverflow.h
+++ b/base/common/arithmeticOverflow.h
@@ -145,6 +145,19 @@ namespace common
return __builtin_mul_overflow(x, y, &res);
}
+ template
+ inline bool mulOverflow(T x, U y, R & res)
+ {
+ // not built in type, wide integer
+ if constexpr (is_big_int_v || is_big_int_v || is_big_int_v)
+ {
+ res = mulIgnoreOverflow(x, y);
+ return false;
+ }
+ else
+ return __builtin_mul_overflow(x, y, &res);
+ }
+
template <>
inline bool mulOverflow(int x, int y, int & res)
{
diff --git a/base/common/extended_types.h b/base/common/extended_types.h
index 79209568ef5..cbd5688c491 100644
--- a/base/common/extended_types.h
+++ b/base/common/extended_types.h
@@ -41,22 +41,14 @@ template <> struct is_unsigned { static constexpr bool value = true; };
template
inline constexpr bool is_unsigned_v = is_unsigned::value;
+template concept is_integer =
+ std::is_integral_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v
+ || std::is_same_v;
-/// TODO: is_integral includes char, char8_t and wchar_t.
-template
-struct is_integer
-{
- static constexpr bool value = std::is_integral_v;
-};
-
-template <> struct is_integer { static constexpr bool value = true; };
-template <> struct is_integer { static constexpr bool value = true; };
-template <> struct is_integer { static constexpr bool value = true; };
-template <> struct is_integer { static constexpr bool value = true; };
-
-template
-inline constexpr bool is_integer_v = is_integer::value;
-
+template concept is_floating_point = std::is_floating_point_v;
template
struct is_arithmetic
diff --git a/base/common/find_symbols.h b/base/common/find_symbols.h
index a5921b813a1..b28749afda6 100644
--- a/base/common/find_symbols.h
+++ b/base/common/find_symbols.h
@@ -36,18 +36,7 @@
namespace detail
{
-
-template
-inline bool is_in(char x)
-{
- return x == s0;
-}
-
-template
-inline bool is_in(char x)
-{
- return x == s0 || is_in(x);
-}
+template constexpr bool is_in(char x) { return ((x == chars) || ...); }
#if defined(__SSE2__)
template
@@ -67,16 +56,10 @@ inline __m128i mm_is_in(__m128i bytes)
#endif
template
-bool maybe_negate(bool x)
-{
- if constexpr (positive)
- return x;
- else
- return !x;
-}
+constexpr bool maybe_negate(bool x) { return x == positive; }
template
-uint16_t maybe_negate(uint16_t x)
+constexpr uint16_t maybe_negate(uint16_t x)
{
if constexpr (positive)
return x;
@@ -149,12 +132,13 @@ template
-inline const char * find_first_symbols_sse42_impl(const char * const begin, const char * const end)
+inline const char * find_first_symbols_sse42(const char * const begin, const char * const end)
{
const char * pos = begin;
#if defined(__SSE4_2__)
-#define MODE (_SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT)
+ constexpr int mode = _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT;
+
__m128i set = _mm_setr_epi8(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10, c11, c12, c13, c14, c15, c16);
for (; pos + 15 < end; pos += 16)
@@ -163,16 +147,15 @@ inline const char * find_first_symbols_sse42_impl(const char * const begin, cons
if constexpr (positive)
{
- if (_mm_cmpestrc(set, num_chars, bytes, 16, MODE))
- return pos + _mm_cmpestri(set, num_chars, bytes, 16, MODE);
+ if (_mm_cmpestrc(set, num_chars, bytes, 16, mode))
+ return pos + _mm_cmpestri(set, num_chars, bytes, 16, mode);
}
else
{
- if (_mm_cmpestrc(set, num_chars, bytes, 16, MODE | _SIDD_NEGATIVE_POLARITY))
- return pos + _mm_cmpestri(set, num_chars, bytes, 16, MODE | _SIDD_NEGATIVE_POLARITY);
+ if (_mm_cmpestrc(set, num_chars, bytes, 16, mode | _SIDD_NEGATIVE_POLARITY))
+ return pos + _mm_cmpestri(set, num_chars, bytes, 16, mode | _SIDD_NEGATIVE_POLARITY);
}
}
-#undef MODE
#endif
for (; pos < end; ++pos)
@@ -197,20 +180,15 @@ inline const char * find_first_symbols_sse42_impl(const char * const begin, cons
}
-template
-inline const char * find_first_symbols_sse42(const char * begin, const char * end)
-{
- return find_first_symbols_sse42_impl(begin, end);
-}
-
/// NOTE No SSE 4.2 implementation for find_last_symbols_or_null. Not worth to do.
template
inline const char * find_first_symbols_dispatch(const char * begin, const char * end)
+ requires(0 <= sizeof...(symbols) && sizeof...(symbols) <= 16)
{
#if defined(__SSE4_2__)
if (sizeof...(symbols) >= 5)
- return find_first_symbols_sse42(begin, end);
+ return find_first_symbols_sse42(begin, end);
else
#endif
return find_first_symbols_sse2(begin, end);
diff --git a/base/common/phdr_cache.cpp b/base/common/phdr_cache.cpp
index 49d566dac19..8ca9137cd29 100644
--- a/base/common/phdr_cache.cpp
+++ b/base/common/phdr_cache.cpp
@@ -1,3 +1,7 @@
+#if defined(__clang__) && __clang_major__ >= 13
+#pragma clang diagnostic ignored "-Wreserved-identifier"
+#endif
+
/// This code was based on the code by Fedor Korotkiy (prime@yandex-team.ru) for YT product in Yandex.
#include
diff --git a/base/common/strong_typedef.h b/base/common/strong_typedef.h
index a1e2b253aa7..0c2e9ca7e8e 100644
--- a/base/common/strong_typedef.h
+++ b/base/common/strong_typedef.h
@@ -15,15 +15,15 @@ private:
public:
using UnderlyingType = T;
template ::type>
- explicit StrongTypedef(const T & t_) : t(t_) {}
+ constexpr explicit StrongTypedef(const T & t_) : t(t_) {}
template ::type>
- explicit StrongTypedef(T && t_) : t(std::move(t_)) {}
+ constexpr explicit StrongTypedef(T && t_) : t(std::move(t_)) {}
template ::type>
- StrongTypedef(): t() {}
+ constexpr StrongTypedef(): t() {}
- StrongTypedef(const Self &) = default;
- StrongTypedef(Self &&) = default;
+ constexpr StrongTypedef(const Self &) = default;
+ constexpr StrongTypedef(Self &&) = default;
Self & operator=(const Self &) = default;
Self & operator=(Self &&) = default;
diff --git a/base/common/unit.h b/base/common/unit.h
index d5c8d5c9027..5bf5e00c049 100644
--- a/base/common/unit.h
+++ b/base/common/unit.h
@@ -1,6 +1,10 @@
#pragma once
#include
+#if defined(__clang__) && __clang_major__ >= 13
+#pragma clang diagnostic ignored "-Wreserved-identifier"
+#endif
+
constexpr size_t KiB = 1024;
constexpr size_t MiB = 1024 * KiB;
constexpr size_t GiB = 1024 * MiB;
diff --git a/base/common/ya.make b/base/common/ya.make
deleted file mode 100644
index fd88760c933..00000000000
--- a/base/common/ya.make
+++ /dev/null
@@ -1,63 +0,0 @@
-# This file is generated automatically, do not edit. See 'ya.make.in' and use 'utils/generate-ya-make' to regenerate it.
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-ADDINCL(
- GLOBAL clickhouse/base
-)
-
-CFLAGS (GLOBAL -DARCADIA_BUILD)
-
-CFLAGS (GLOBAL -DUSE_CPUID=1)
-CFLAGS (GLOBAL -DUSE_JEMALLOC=0)
-CFLAGS (GLOBAL -DUSE_RAPIDJSON=1)
-CFLAGS (GLOBAL -DUSE_SSL=1)
-
-IF (OS_DARWIN)
- CFLAGS (GLOBAL -DOS_DARWIN)
-ELSEIF (OS_FREEBSD)
- CFLAGS (GLOBAL -DOS_FREEBSD)
-ELSEIF (OS_LINUX)
- CFLAGS (GLOBAL -DOS_LINUX)
-ENDIF ()
-
-PEERDIR(
- contrib/libs/cctz
- contrib/libs/cxxsupp/libcxx-filesystem
- contrib/libs/poco/Net
- contrib/libs/poco/Util
- contrib/libs/poco/NetSSL_OpenSSL
- contrib/libs/fmt
- contrib/restricted/boost
- contrib/restricted/cityhash-1.0.2
-)
-
-CFLAGS(-g0)
-
-SRCS(
- DateLUT.cpp
- DateLUTImpl.cpp
- JSON.cpp
- LineReader.cpp
- StringRef.cpp
- argsToConfig.cpp
- coverage.cpp
- demangle.cpp
- errnoToString.cpp
- getFQDNOrHostName.cpp
- getMemoryAmount.cpp
- getPageSize.cpp
- getResource.cpp
- getThreadId.cpp
- mremap.cpp
- phdr_cache.cpp
- preciseExp10.cpp
- setTerminalEcho.cpp
- shift10.cpp
- sleep.cpp
- terminalColors.cpp
-
-)
-
-END()
diff --git a/base/common/ya.make.in b/base/common/ya.make.in
deleted file mode 100644
index 3deb36a2c71..00000000000
--- a/base/common/ya.make.in
+++ /dev/null
@@ -1,41 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-ADDINCL(
- GLOBAL clickhouse/base
-)
-
-CFLAGS (GLOBAL -DARCADIA_BUILD)
-
-CFLAGS (GLOBAL -DUSE_CPUID=1)
-CFLAGS (GLOBAL -DUSE_JEMALLOC=0)
-CFLAGS (GLOBAL -DUSE_RAPIDJSON=1)
-CFLAGS (GLOBAL -DUSE_SSL=1)
-
-IF (OS_DARWIN)
- CFLAGS (GLOBAL -DOS_DARWIN)
-ELSEIF (OS_FREEBSD)
- CFLAGS (GLOBAL -DOS_FREEBSD)
-ELSEIF (OS_LINUX)
- CFLAGS (GLOBAL -DOS_LINUX)
-ENDIF ()
-
-PEERDIR(
- contrib/libs/cctz
- contrib/libs/cxxsupp/libcxx-filesystem
- contrib/libs/poco/Net
- contrib/libs/poco/Util
- contrib/libs/poco/NetSSL_OpenSSL
- contrib/libs/fmt
- contrib/restricted/boost
- contrib/restricted/cityhash-1.0.2
-)
-
-CFLAGS(-g0)
-
-SRCS(
- find . -name '*.cpp' | grep -v -F tests/ | grep -v -F examples | grep -v -F Replxx | grep -v -F Readline | sed 's/^\.\// /' | sort ?>
-)
-
-END()
diff --git a/base/daemon/BaseDaemon.cpp b/base/daemon/BaseDaemon.cpp
index 745e020c8bb..141b7b7bbc6 100644
--- a/base/daemon/BaseDaemon.cpp
+++ b/base/daemon/BaseDaemon.cpp
@@ -1,3 +1,7 @@
+#if defined(__clang__) && __clang_major__ >= 13
+#pragma clang diagnostic ignored "-Wreserved-identifier"
+#endif
+
#include
#include
diff --git a/base/daemon/ya.make b/base/daemon/ya.make
deleted file mode 100644
index f3b4059f002..00000000000
--- a/base/daemon/ya.make
+++ /dev/null
@@ -1,19 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-NO_COMPILER_WARNINGS()
-
-PEERDIR(
- clickhouse/src/Common
-)
-
-CFLAGS(-g0)
-
-SRCS(
- BaseDaemon.cpp
- GraphiteWriter.cpp
- SentryWriter.cpp
-)
-
-END()
diff --git a/base/loggers/ya.make b/base/loggers/ya.make
deleted file mode 100644
index 943b6f12b73..00000000000
--- a/base/loggers/ya.make
+++ /dev/null
@@ -1,19 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-PEERDIR(
- clickhouse/src/Common
-)
-
-CFLAGS(-g0)
-
-SRCS(
- ExtendedLogChannel.cpp
- Loggers.cpp
- OwnFormattingChannel.cpp
- OwnPatternFormatter.cpp
- OwnSplitChannel.cpp
-)
-
-END()
diff --git a/base/mysqlxx/CMakeLists.txt b/base/mysqlxx/CMakeLists.txt
index c5230c2b49f..947f61f9051 100644
--- a/base/mysqlxx/CMakeLists.txt
+++ b/base/mysqlxx/CMakeLists.txt
@@ -49,6 +49,8 @@ if (NOT USE_INTERNAL_MYSQL_LIBRARY AND OPENSSL_INCLUDE_DIR)
target_include_directories (mysqlxx SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
endif ()
+target_no_warning(mysqlxx reserved-macro-identifier)
+
if (NOT USE_INTERNAL_MYSQL_LIBRARY AND USE_STATIC_LIBRARIES)
message(WARNING "Statically linking with system mysql/mariadb only works "
"if mysql client libraries are built with same openssl version as "
diff --git a/base/mysqlxx/Pool.cpp b/base/mysqlxx/Pool.cpp
index 2f47aa67356..cee386311d4 100644
--- a/base/mysqlxx/Pool.cpp
+++ b/base/mysqlxx/Pool.cpp
@@ -7,10 +7,22 @@
#endif
#include
-
#include
-
#include
+#include
+
+
+namespace
+{
+
+inline uint64_t clock_gettime_ns(clockid_t clock_type = CLOCK_MONOTONIC)
+{
+ struct timespec ts;
+ clock_gettime(clock_type, &ts);
+ return uint64_t(ts.tv_sec * 1000000000LL + ts.tv_nsec);
+}
+
+}
namespace mysqlxx
@@ -124,10 +136,15 @@ Pool::~Pool()
}
-Pool::Entry Pool::get()
+Pool::Entry Pool::get(uint64_t wait_timeout)
{
std::unique_lock lock(mutex);
+ uint64_t deadline = 0;
+ /// UINT64_MAX -- wait indefinitely
+ if (wait_timeout && wait_timeout != UINT64_MAX)
+ deadline = clock_gettime_ns() + wait_timeout * 1'000'000'000;
+
initialize();
for (;;)
{
@@ -153,6 +170,12 @@ Pool::Entry Pool::get()
logger.trace("(%s): Unable to create a new connection: Max number of connections has been reached.", getDescription());
}
+ if (!wait_timeout)
+ throw Poco::Exception("mysqlxx::Pool is full (wait is disabled, see connection_wait_timeout setting)");
+
+ if (deadline && clock_gettime_ns() >= deadline)
+ throw Poco::Exception("mysqlxx::Pool is full (connection_wait_timeout is exceeded)");
+
lock.unlock();
logger.trace("(%s): Sleeping for %d seconds.", getDescription(), MYSQLXX_POOL_SLEEP_ON_CONNECT_FAIL);
sleepForSeconds(MYSQLXX_POOL_SLEEP_ON_CONNECT_FAIL);
diff --git a/base/mysqlxx/Pool.h b/base/mysqlxx/Pool.h
index 530e2c78cf2..f542c3d3b76 100644
--- a/base/mysqlxx/Pool.h
+++ b/base/mysqlxx/Pool.h
@@ -189,7 +189,7 @@ public:
~Pool();
/// Allocates connection.
- Entry get();
+ Entry get(uint64_t wait_timeout = UINT64_MAX);
/// Allocates connection.
/// If database is not accessible, returns empty Entry object.
diff --git a/base/mysqlxx/PoolFactory.cpp b/base/mysqlxx/PoolFactory.cpp
index f0a5543d723..1d2f9fc74c7 100644
--- a/base/mysqlxx/PoolFactory.cpp
+++ b/base/mysqlxx/PoolFactory.cpp
@@ -79,7 +79,7 @@ PoolWithFailover PoolFactory::get(const Poco::Util::AbstractConfiguration & conf
std::lock_guard lock(impl->mutex);
if (auto entry = impl->pools.find(config_name); entry != impl->pools.end())
{
- return *(entry->second.get());
+ return *(entry->second);
}
else
{
@@ -100,7 +100,7 @@ PoolWithFailover PoolFactory::get(const Poco::Util::AbstractConfiguration & conf
impl->pools.insert_or_assign(config_name, pool);
impl->pools_by_ids.insert_or_assign(entry_name, config_name);
}
- return *(pool.get());
+ return *pool;
}
}
diff --git a/base/mysqlxx/PoolWithFailover.cpp b/base/mysqlxx/PoolWithFailover.cpp
index e317ab7f228..14c0db9ecd5 100644
--- a/base/mysqlxx/PoolWithFailover.cpp
+++ b/base/mysqlxx/PoolWithFailover.cpp
@@ -21,8 +21,9 @@ PoolWithFailover::PoolWithFailover(
const unsigned max_connections_,
const size_t max_tries_)
: max_tries(max_tries_)
+ , shareable(config_.getBool(config_name_ + ".share_connection", false))
+ , wait_timeout(UINT64_MAX)
{
- shareable = config_.getBool(config_name_ + ".share_connection", false);
if (config_.has(config_name_ + ".replica"))
{
Poco::Util::AbstractConfiguration::Keys replica_keys;
@@ -80,9 +81,11 @@ PoolWithFailover::PoolWithFailover(
const std::string & password,
unsigned default_connections_,
unsigned max_connections_,
- size_t max_tries_)
+ size_t max_tries_,
+ uint64_t wait_timeout_)
: max_tries(max_tries_)
, shareable(false)
+ , wait_timeout(wait_timeout_)
{
/// Replicas have the same priority, but traversed replicas are moved to the end of the queue.
for (const auto & [host, port] : addresses)
@@ -101,6 +104,7 @@ PoolWithFailover::PoolWithFailover(
PoolWithFailover::PoolWithFailover(const PoolWithFailover & other)
: max_tries{other.max_tries}
, shareable{other.shareable}
+ , wait_timeout(other.wait_timeout)
{
if (shareable)
{
@@ -140,7 +144,7 @@ PoolWithFailover::Entry PoolWithFailover::get()
try
{
- Entry entry = shareable ? pool->get() : pool->tryGet();
+ Entry entry = shareable ? pool->get(wait_timeout) : pool->tryGet();
if (!entry.isNull())
{
@@ -172,7 +176,7 @@ PoolWithFailover::Entry PoolWithFailover::get()
if (full_pool)
{
app.logger().error("All connections failed, trying to wait on a full pool " + (*full_pool)->getDescription());
- return (*full_pool)->get();
+ return (*full_pool)->get(wait_timeout);
}
std::stringstream message;
diff --git a/base/mysqlxx/PoolWithFailover.h b/base/mysqlxx/PoolWithFailover.h
index 1c7a63e76c0..2bd5ec9f30a 100644
--- a/base/mysqlxx/PoolWithFailover.h
+++ b/base/mysqlxx/PoolWithFailover.h
@@ -80,6 +80,8 @@ namespace mysqlxx
std::mutex mutex;
/// Can the Pool be shared
bool shareable;
+ /// Timeout for waiting free connection.
+ uint64_t wait_timeout = 0;
public:
using Entry = Pool::Entry;
@@ -96,6 +98,7 @@ namespace mysqlxx
* default_connections Number of connection in pool to each replica at start.
* max_connections Maximum number of connections in pool to each replica.
* max_tries_ Max number of connection tries.
+ * wait_timeout_ Timeout for waiting free connection.
*/
PoolWithFailover(
const std::string & config_name_,
@@ -117,7 +120,8 @@ namespace mysqlxx
const std::string & password,
unsigned default_connections_ = MYSQLXX_POOL_WITH_FAILOVER_DEFAULT_START_CONNECTIONS,
unsigned max_connections_ = MYSQLXX_POOL_WITH_FAILOVER_DEFAULT_MAX_CONNECTIONS,
- size_t max_tries_ = MYSQLXX_POOL_WITH_FAILOVER_DEFAULT_MAX_TRIES);
+ size_t max_tries_ = MYSQLXX_POOL_WITH_FAILOVER_DEFAULT_MAX_TRIES,
+ uint64_t wait_timeout_ = UINT64_MAX);
PoolWithFailover(const PoolWithFailover & other);
diff --git a/base/mysqlxx/Query.cpp b/base/mysqlxx/Query.cpp
index c0d5c20fdfd..e7d1e0c1d69 100644
--- a/base/mysqlxx/Query.cpp
+++ b/base/mysqlxx/Query.cpp
@@ -77,7 +77,9 @@ void Query::executeImpl()
case CR_SERVER_LOST:
throw ConnectionLost(errorMessage(mysql_driver), err_no);
default:
- throw BadQuery(errorMessage(mysql_driver), err_no);
+ /// Add query to the exception message, since it may differs from the user input query.
+ /// (also you can use this and create query with an error to see what query ClickHouse created)
+ throw BadQuery(errorMessage(mysql_driver) + " (query: " + query_string + ")", err_no);
}
}
}
diff --git a/base/mysqlxx/ya.make b/base/mysqlxx/ya.make
deleted file mode 100644
index aabc9922e72..00000000000
--- a/base/mysqlxx/ya.make
+++ /dev/null
@@ -1,39 +0,0 @@
-# This file is generated automatically, do not edit. See 'ya.make.in' and use 'utils/generate-ya-make' to regenerate it.
-LIBRARY()
-
-OWNER(g:clickhouse)
-
-CFLAGS(-g0)
-
-PEERDIR(
- contrib/restricted/boost/libs
- contrib/libs/libmysql_r
- contrib/libs/poco/Foundation
- contrib/libs/poco/Util
-)
-
-ADDINCL(
- GLOBAL clickhouse/base
- clickhouse/base
- contrib/libs/libmysql_r
-)
-
-NO_COMPILER_WARNINGS()
-
-NO_UTIL()
-
-SRCS(
- Connection.cpp
- Exception.cpp
- Pool.cpp
- PoolFactory.cpp
- PoolWithFailover.cpp
- Query.cpp
- ResultBase.cpp
- Row.cpp
- UseQueryResult.cpp
- Value.cpp
-
-)
-
-END()
diff --git a/base/mysqlxx/ya.make.in b/base/mysqlxx/ya.make.in
deleted file mode 100644
index 10755078e20..00000000000
--- a/base/mysqlxx/ya.make.in
+++ /dev/null
@@ -1,28 +0,0 @@
-LIBRARY()
-
-OWNER(g:clickhouse)
-
-CFLAGS(-g0)
-
-PEERDIR(
- contrib/restricted/boost/libs
- contrib/libs/libmysql_r
- contrib/libs/poco/Foundation
- contrib/libs/poco/Util
-)
-
-ADDINCL(
- GLOBAL clickhouse/base
- clickhouse/base
- contrib/libs/libmysql_r
-)
-
-NO_COMPILER_WARNINGS()
-
-NO_UTIL()
-
-SRCS(
- find . -name '*.cpp' | grep -v -F tests/ | grep -v -F examples | sed 's/^\.\// /' | sort ?>
-)
-
-END()
diff --git a/base/pcg-random/ya.make b/base/pcg-random/ya.make
deleted file mode 100644
index 705cdc05341..00000000000
--- a/base/pcg-random/ya.make
+++ /dev/null
@@ -1,7 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-ADDINCL (GLOBAL clickhouse/base/pcg-random)
-
-END()
diff --git a/base/readpassphrase/readpassphrase.c b/base/readpassphrase/readpassphrase.c
index 8a7d3153915..3bcad34e481 100644
--- a/base/readpassphrase/readpassphrase.c
+++ b/base/readpassphrase/readpassphrase.c
@@ -27,6 +27,10 @@
#define _PATH_TTY "/dev/tty"
#endif
+#if defined(__clang__) && __clang_major__ >= 13
+#pragma clang diagnostic ignored "-Wreserved-identifier"
+#endif
+
#include
#include
#include
diff --git a/base/readpassphrase/ya.make b/base/readpassphrase/ya.make
deleted file mode 100644
index d1ace8925ae..00000000000
--- a/base/readpassphrase/ya.make
+++ /dev/null
@@ -1,11 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-CFLAGS(-g0)
-
-SRCS(
- readpassphrase.c
-)
-
-END()
diff --git a/base/widechar_width/ya.make b/base/widechar_width/ya.make
deleted file mode 100644
index 0d61e0dbf70..00000000000
--- a/base/widechar_width/ya.make
+++ /dev/null
@@ -1,13 +0,0 @@
-OWNER(g:clickhouse)
-
-LIBRARY()
-
-ADDINCL(GLOBAL clickhouse/base/widechar_width)
-
-CFLAGS(-g0)
-
-SRCS(
- widechar_width.cpp
-)
-
-END()
diff --git a/base/ya.make b/base/ya.make
deleted file mode 100644
index 19a16044280..00000000000
--- a/base/ya.make
+++ /dev/null
@@ -1,11 +0,0 @@
-OWNER(g:clickhouse)
-
-RECURSE(
- common
- daemon
- loggers
- mysqlxx
- pcg-random
- widechar_width
- readpassphrase
-)
diff --git a/cmake/analysis.cmake b/cmake/analysis.cmake
index 267bb34248b..d1b9c86f15f 100644
--- a/cmake/analysis.cmake
+++ b/cmake/analysis.cmake
@@ -6,7 +6,7 @@ if (ENABLE_CLANG_TIDY)
message(FATAL_ERROR "clang-tidy requires CMake version at least 3.6.")
endif()
- find_program (CLANG_TIDY_PATH NAMES "clang-tidy" "clang-tidy-11" "clang-tidy-10" "clang-tidy-9" "clang-tidy-8")
+ find_program (CLANG_TIDY_PATH NAMES "clang-tidy" "clang-tidy-13" "clang-tidy-12" "clang-tidy-11" "clang-tidy-10" "clang-tidy-9" "clang-tidy-8")
if (CLANG_TIDY_PATH)
message(STATUS
diff --git a/cmake/autogenerated_versions.txt b/cmake/autogenerated_versions.txt
index 03247b4b3ea..dd6ead7d97f 100644
--- a/cmake/autogenerated_versions.txt
+++ b/cmake/autogenerated_versions.txt
@@ -2,11 +2,11 @@
# NOTE: has nothing common with DBMS_TCP_PROTOCOL_VERSION,
# only DBMS_TCP_PROTOCOL_VERSION should be incremented on protocol changes.
-SET(VERSION_REVISION 54455)
+SET(VERSION_REVISION 54456)
SET(VERSION_MAJOR 21)
-SET(VERSION_MINOR 10)
+SET(VERSION_MINOR 11)
SET(VERSION_PATCH 1)
-SET(VERSION_GITHASH 09df5018f95edcd0f759d4689ac5d029dd400c2a)
-SET(VERSION_DESCRIBE v21.10.1.1-testing)
-SET(VERSION_STRING 21.10.1.1)
+SET(VERSION_GITHASH 7a4a0b0edef0ad6e0aa662cd3b90c3f4acf796e7)
+SET(VERSION_DESCRIBE v21.11.1.1-prestable)
+SET(VERSION_STRING 21.11.1.1)
# end of autochange
diff --git a/cmake/check_flags.cmake b/cmake/check_flags.cmake
index 5a4ff472868..58605543dff 100644
--- a/cmake/check_flags.cmake
+++ b/cmake/check_flags.cmake
@@ -4,3 +4,4 @@ include (CheckCCompilerFlag)
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
check_cxx_compiler_flag("-Wshadow" HAS_SHADOW)
check_cxx_compiler_flag("-Wsuggest-override" HAS_SUGGEST_OVERRIDE)
+check_cxx_compiler_flag("-Xclang -fuse-ctor-homing" HAS_USE_CTOR_HOMING)
diff --git a/cmake/find/ccache.cmake b/cmake/find/ccache.cmake
index 986c9cb5fe2..43c2de0c921 100644
--- a/cmake/find/ccache.cmake
+++ b/cmake/find/ccache.cmake
@@ -51,8 +51,8 @@ if (CCACHE_FOUND AND NOT COMPILER_MATCHES_CCACHE)
message(STATUS "ccache is 4.2+ no quirks for SOURCE_DATE_EPOCH required")
elseif (CCACHE_VERSION VERSION_GREATER_EQUAL "4.0")
message(STATUS "Ignore SOURCE_DATE_EPOCH for ccache")
- set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE "env -u SOURCE_DATE_EPOCH ${CCACHE_FOUND}")
- set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK "env -u SOURCE_DATE_EPOCH ${CCACHE_FOUND}")
+ set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE "env -u SOURCE_DATE_EPOCH")
+ set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK "env -u SOURCE_DATE_EPOCH")
endif()
else ()
message(${RECONFIGURE_MESSAGE_LEVEL} "Not using ${CCACHE_FOUND} ${CCACHE_VERSION} bug: https://bugzilla.samba.org/show_bug.cgi?id=8118")
diff --git a/cmake/find/llvm.cmake b/cmake/find/llvm.cmake
index 816164bef10..84ac29991ab 100644
--- a/cmake/find/llvm.cmake
+++ b/cmake/find/llvm.cmake
@@ -1,8 +1,10 @@
-if (APPLE OR SPLIT_SHARED_LIBRARIES OR NOT ARCH_AMD64 OR SANITIZE STREQUAL "undefined")
- set (ENABLE_EMBEDDED_COMPILER OFF CACHE INTERNAL "")
+if (APPLE OR NOT ARCH_AMD64 OR SANITIZE STREQUAL "undefined")
+ set (ENABLE_EMBEDDED_COMPILER_DEFAULT OFF)
+else()
+ set (ENABLE_EMBEDDED_COMPILER_DEFAULT ON)
endif()
-option (ENABLE_EMBEDDED_COMPILER "Enable support for 'compile_expressions' option for query execution" ON)
+option (ENABLE_EMBEDDED_COMPILER "Enable support for 'compile_expressions' option for query execution" ${ENABLE_EMBEDDED_COMPILER_DEFAULT})
if (NOT ENABLE_EMBEDDED_COMPILER)
set (USE_EMBEDDED_COMPILER 0)
diff --git a/cmake/freebsd/toolchain-x86_64.cmake b/cmake/freebsd/toolchain-x86_64.cmake
index d9839ec74ee..f9e45686db7 100644
--- a/cmake/freebsd/toolchain-x86_64.cmake
+++ b/cmake/freebsd/toolchain-x86_64.cmake
@@ -10,7 +10,7 @@ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # disable linkage check - it
set (CMAKE_AR "/usr/bin/ar" CACHE FILEPATH "" FORCE)
set (CMAKE_RANLIB "/usr/bin/ranlib" CACHE FILEPATH "" FORCE)
-set (LINKER_NAME "lld" CACHE STRING "" FORCE)
+set (LINKER_NAME "ld.lld" CACHE STRING "" FORCE)
set (CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
diff --git a/cmake/linux/toolchain-aarch64.cmake b/cmake/linux/toolchain-aarch64.cmake
index e3924fdc537..b4dc6e45cbb 100644
--- a/cmake/linux/toolchain-aarch64.cmake
+++ b/cmake/linux/toolchain-aarch64.cmake
@@ -13,7 +13,7 @@ set (CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS} --gcc-toolchain=${CMAKE_CURRENT_LIST_D
set (CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS} --gcc-toolchain=${CMAKE_CURRENT_LIST_DIR}/../toolchain/linux-aarch64")
set (CMAKE_ASM_FLAGS_INIT "${CMAKE_ASM_FLAGS} --gcc-toolchain=${CMAKE_CURRENT_LIST_DIR}/../toolchain/linux-aarch64")
-set (LINKER_NAME "lld" CACHE STRING "" FORCE)
+set (LINKER_NAME "ld.lld" CACHE STRING "" FORCE)
set (CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
diff --git a/cmake/tools.cmake b/cmake/tools.cmake
index 8ff94ab867b..f94f4b289a3 100644
--- a/cmake/tools.cmake
+++ b/cmake/tools.cmake
@@ -79,8 +79,9 @@ endif ()
if (LINKER_NAME)
if (COMPILER_CLANG AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12.0.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 12.0.0))
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --ld-path=${LINKER_NAME}")
- set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --ld-path=${LINKER_NAME}")
+ find_program (LLD_PATH NAMES ${LINKER_NAME})
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --ld-path=${LLD_PATH}")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --ld-path=${LLD_PATH}")
else ()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=${LINKER_NAME}")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=${LINKER_NAME}")
diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake
index a85fe8963c7..0b6bbe36cf9 100644
--- a/cmake/warnings.cmake
+++ b/cmake/warnings.cmake
@@ -192,4 +192,29 @@ elseif (COMPILER_GCC)
# For some reason (bug in gcc?) macro 'GCC diagnostic ignored "-Wstringop-overflow"' doesn't help.
add_cxx_compile_options(-Wno-stringop-overflow)
endif()
+
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
+ # reinterpretAs.cpp:182:31: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type
+ # ‘using ToFieldType = using FieldType = using UUID = struct StrongTypedef, DB::UUIDTag>’
+ # {aka ‘struct StrongTypedef, DB::UUIDTag>’} from an array of ‘const char8_t’
+ add_cxx_compile_options(-Wno-error=class-memaccess)
+
+ # Maybe false positive...
+ # In file included from /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/memory:673,
+ # In function ‘void std::__1::__libcpp_operator_delete(_Args ...) [with _Args = {void*, long unsigned int}]’,
+ # inlined from ‘void std::__1::__do_deallocate_handle_size(void*, size_t, _Args ...) [with _Args = {}]’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/new:271:34,
+ # inlined from ‘void std::__1::__libcpp_deallocate(void*, size_t, size_t)’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/new:285:41,
+ # inlined from ‘constexpr void std::__1::allocator<_Tp>::deallocate(_Tp*, size_t) [with _Tp = char]’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/memory:849:39,
+ # inlined from ‘static constexpr void std::__1::allocator_traits<_Alloc>::deallocate(std::__1::allocator_traits<_Alloc>::allocator_type&, std::__1::allocator_traits<_Alloc>::pointer, std::__1::allocator_traits<_Alloc>::size_type) [with _Alloc = std::__1::allocator]’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/__memory/allocator_traits.h:476:24,
+ # inlined from ‘std::__1::basic_string<_CharT, _Traits, _Allocator>::~basic_string() [with _CharT = char; _Traits = std::__1::char_traits; _Allocator = std::__1::allocator]’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/string:2219:35,
+ # inlined from ‘std::__1::basic_string<_CharT, _Traits, _Allocator>::~basic_string() [with _CharT = char; _Traits = std::__1::char_traits; _Allocator = std::__1::allocator]’ at /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/string:2213:1,
+ # inlined from ‘DB::JSONBuilder::JSONMap::Pair::~Pair()’ at /home/jakalletti/ClickHouse/ClickHouse/src/Common/JSONBuilder.h:90:12,
+ # inlined from ‘void DB::JSONBuilder::JSONMap::add(std::__1::string, DB::JSONBuilder::ItemPtr)’ at /home/jakalletti/ClickHouse/ClickHouse/src/Common/JSONBuilder.h:97:68,
+ # inlined from ‘virtual void DB::ExpressionStep::describeActions(DB::JSONBuilder::JSONMap&) const’ at /home/jakalletti/ClickHouse/ClickHouse/src/Processors/QueryPlan/ExpressionStep.cpp:102:12:
+ # /home/jakalletti/ClickHouse/ClickHouse/contrib/libcxx/include/new:247:20: error: ‘void operator delete(void*, size_t)’ called on a pointer to an unallocated object ‘7598543875853023301’ [-Werror=free-nonheap-object]
+ add_cxx_compile_options(-Wno-error=free-nonheap-object)
+
+ # AggregateFunctionAvg.h:203:100: error: ‘this’ pointer is null [-Werror=nonnull]
+ add_cxx_compile_options(-Wno-error=nonnull)
+ endif()
endif ()
diff --git a/cmake/yandex/ya.make.versions.inc b/cmake/yandex/ya.make.versions.inc
deleted file mode 100644
index 6910164d0aa..00000000000
--- a/cmake/yandex/ya.make.versions.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-INCLUDE(${ARCADIA_ROOT}/clickhouse/cmake/autogenerated_versions.txt)
-
-# TODO: not sure if this is customizable per-binary
-SET(VERSION_NAME "ClickHouse")
-
-# TODO: not quite sure how to replace dash with space in ya.make
-SET(VERSION_FULL "${VERSION_NAME}-${VERSION_STRING}")
-
-CFLAGS (GLOBAL -DDBMS_NAME=\"ClickHouse\")
-CFLAGS (GLOBAL -DDBMS_VERSION_MAJOR=${VERSION_MAJOR})
-CFLAGS (GLOBAL -DDBMS_VERSION_MINOR=${VERSION_MINOR})
-CFLAGS (GLOBAL -DDBMS_VERSION_PATCH=${VERSION_PATCH})
-CFLAGS (GLOBAL -DVERSION_FULL=\"\\\"${VERSION_FULL}\\\"\")
-CFLAGS (GLOBAL -DVERSION_MAJOR=${VERSION_MAJOR})
-CFLAGS (GLOBAL -DVERSION_MINOR=${VERSION_MINOR})
-CFLAGS (GLOBAL -DVERSION_PATCH=${VERSION_PATCH})
-
-# TODO: not supported yet, not sure if ya.make supports arithmetic.
-CFLAGS (GLOBAL -DVERSION_INTEGER=0)
-
-CFLAGS (GLOBAL -DVERSION_NAME=\"\\\"${VERSION_NAME}\\\"\")
-CFLAGS (GLOBAL -DVERSION_OFFICIAL=\"-arcadia\")
-CFLAGS (GLOBAL -DVERSION_REVISION=${VERSION_REVISION})
-CFLAGS (GLOBAL -DVERSION_STRING=\"\\\"${VERSION_STRING}\\\"\")
-
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index e6e098a05b3..140cc0846ec 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -33,6 +33,7 @@ endif()
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
add_subdirectory (abseil-cpp-cmake)
+add_subdirectory (magic-enum-cmake)
add_subdirectory (boost-cmake)
add_subdirectory (cctz-cmake)
add_subdirectory (consistent-hashing)
@@ -206,12 +207,14 @@ elseif(GTEST_SRC_DIR)
target_compile_definitions(gtest INTERFACE GTEST_HAS_POSIX_RE=0)
endif()
-if (USE_EMBEDDED_COMPILER)
+function(add_llvm)
# ld: unknown option: --color-diagnostics
if (APPLE)
set (LINKER_SUPPORTS_COLOR_DIAGNOSTICS 0 CACHE INTERNAL "")
endif ()
+ # Do not adjust RPATH in llvm, since then it will not be able to find libcxx/libcxxabi/libunwind
+ set (CMAKE_INSTALL_RPATH "ON")
set (LLVM_ENABLE_EH 1 CACHE INTERNAL "")
set (LLVM_ENABLE_RTTI 1 CACHE INTERNAL "")
set (LLVM_ENABLE_PIC 0 CACHE INTERNAL "")
@@ -219,13 +222,12 @@ if (USE_EMBEDDED_COMPILER)
# Need to use C++17 since the compilation is not possible with C++20 currently, due to ambiguous operator != etc.
# LLVM project will set its default value for the -std=... but our global setting from CMake will override it.
- set (CMAKE_CXX_STANDARD_bak ${CMAKE_CXX_STANDARD})
set (CMAKE_CXX_STANDARD 17)
add_subdirectory (llvm/llvm)
-
- set (CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD_bak})
- unset (CMAKE_CXX_STANDARD_bak)
+endfunction()
+if (USE_EMBEDDED_COMPILER)
+ add_llvm()
endif ()
if (USE_INTERNAL_LIBGSASL_LIBRARY)
diff --git a/contrib/abseil-cpp b/contrib/abseil-cpp
index 4f3b686f86c..b004a8a0241 160000
--- a/contrib/abseil-cpp
+++ b/contrib/abseil-cpp
@@ -1 +1 @@
-Subproject commit 4f3b686f86c3ebaba7e4e926e62a79cb1c659a54
+Subproject commit b004a8a02418b83de8b686caa0b0f6e39ac2191f
diff --git a/contrib/boost b/contrib/boost
index 9cf09dbfd55..66d17f060c4 160000
--- a/contrib/boost
+++ b/contrib/boost
@@ -1 +1 @@
-Subproject commit 9cf09dbfd55a5c6202dedbdf40781a51b02c2675
+Subproject commit 66d17f060c4867aeea99fa2a20cfdae89ae2a2ec
diff --git a/contrib/boost-cmake/CMakeLists.txt b/contrib/boost-cmake/CMakeLists.txt
index 675931d319f..27072910135 100644
--- a/contrib/boost-cmake/CMakeLists.txt
+++ b/contrib/boost-cmake/CMakeLists.txt
@@ -16,7 +16,7 @@ if (NOT USE_INTERNAL_BOOST_LIBRARY)
graph
)
- if(Boost_INCLUDE_DIR AND Boost_FILESYSTEM_LIBRARY AND Boost_FILESYSTEM_LIBRARY AND
+ if(Boost_INCLUDE_DIR AND Boost_FILESYSTEM_LIBRARY AND
Boost_PROGRAM_OPTIONS_LIBRARY AND Boost_REGEX_LIBRARY AND Boost_SYSTEM_LIBRARY AND Boost_CONTEXT_LIBRARY AND
Boost_COROUTINE_LIBRARY AND Boost_GRAPH_LIBRARY)
@@ -238,4 +238,14 @@ if (NOT EXTERNAL_BOOST_FOUND)
target_include_directories (_boost_graph PRIVATE ${LIBRARY_DIR})
target_link_libraries(_boost_graph PRIVATE _boost_regex)
+ # circular buffer
+ add_library(_boost_circular_buffer INTERFACE)
+ add_library(boost::circular_buffer ALIAS _boost_circular_buffer)
+ target_include_directories(_boost_circular_buffer SYSTEM BEFORE INTERFACE ${LIBRARY_DIR})
+
+ # heap
+ add_library(_boost_heap INTERFACE)
+ add_library(boost::heap ALIAS _boost_heap)
+ target_include_directories(_boost_heap SYSTEM BEFORE INTERFACE ${LIBRARY_DIR})
+
endif ()
diff --git a/contrib/fastops b/contrib/fastops
index 88752a5e03c..012b777df9e 160000
--- a/contrib/fastops
+++ b/contrib/fastops
@@ -1 +1 @@
-Subproject commit 88752a5e03cf34639a4a37a4b41d8b463fffd2b5
+Subproject commit 012b777df9e2d145a24800a6c8c3d4a0249bb09e
diff --git a/contrib/libhdfs3 b/contrib/libhdfs3
index 095b9d48b40..082e55f17d1 160000
--- a/contrib/libhdfs3
+++ b/contrib/libhdfs3
@@ -1 +1 @@
-Subproject commit 095b9d48b400abb72d967cb0539af13b1e3d90cf
+Subproject commit 082e55f17d1c58bf124290fb044fea40e985ec11
diff --git a/contrib/llvm b/contrib/llvm
index e5751459412..f30bbecef78 160000
--- a/contrib/llvm
+++ b/contrib/llvm
@@ -1 +1 @@
-Subproject commit e5751459412bce1391fb7a2e9bbc01e131bf72f1
+Subproject commit f30bbecef78b75b527e257c1304d0be2f2f95975
diff --git a/contrib/magic-enum-cmake/CMakeLists.txt b/contrib/magic-enum-cmake/CMakeLists.txt
new file mode 100644
index 00000000000..142f9c7c755
--- /dev/null
+++ b/contrib/magic-enum-cmake/CMakeLists.txt
@@ -0,0 +1,3 @@
+set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/magic_enum")
+add_library (magic_enum INTERFACE)
+target_include_directories(magic_enum INTERFACE ${LIBRARY_DIR}/include)
diff --git a/contrib/magic_enum b/contrib/magic_enum
new file mode 160000
index 00000000000..38f86e4d093
--- /dev/null
+++ b/contrib/magic_enum
@@ -0,0 +1 @@
+Subproject commit 38f86e4d093cfc9034a140d37de2168e3951bef3
diff --git a/contrib/rocksdb b/contrib/rocksdb
index b6480c69bf3..5ea892c8673 160000
--- a/contrib/rocksdb
+++ b/contrib/rocksdb
@@ -1 +1 @@
-Subproject commit b6480c69bf3ab6e298e0d019a07fd4f69029b26a
+Subproject commit 5ea892c8673e6c5a052887653673b967d44cc59b
diff --git a/debian/changelog b/debian/changelog
index f3e740d20cf..460424bdb36 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-clickhouse (21.10.1.1) unstable; urgency=low
+clickhouse (21.11.1.1) unstable; urgency=low
* Modified source code
- -- clickhouse-release Sat, 17 Jul 2021 08:45:03 +0300
+ -- clickhouse-release Thu, 09 Sep 2021 12:03:26 +0300
diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init
index 4e70d382b36..1dd87fe80ae 100755
--- a/debian/clickhouse-server.init
+++ b/debian/clickhouse-server.init
@@ -3,10 +3,17 @@
# Provides: clickhouse-server
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
-# Required-Start: $network
-# Required-Stop: $network
+# Should-Start: $time $network
+# Should-Stop: $network
# Short-Description: Yandex clickhouse-server daemon
### END INIT INFO
+#
+# NOTES:
+# - Should-* -- script can start if the listed facilities are missing, unlike Required-*
+#
+# For the documentation [1]:
+#
+# [1]: https://wiki.debian.org/LSBInitScripts
CLICKHOUSE_USER=clickhouse
CLICKHOUSE_GROUP=${CLICKHOUSE_USER}
diff --git a/debian/clickhouse-server.service b/debian/clickhouse-server.service
index b9681f9279e..bc19235cb3a 100644
--- a/debian/clickhouse-server.service
+++ b/debian/clickhouse-server.service
@@ -1,7 +1,12 @@
[Unit]
Description=ClickHouse Server (analytic DBMS for big data)
Requires=network-online.target
-After=network-online.target
+# NOTE: that After/Wants=time-sync.target is not enough, you need to ensure
+# that the time was adjusted already, if you use systemd-timesyncd you are
+# safe, but if you use ntp or some other daemon, you should configure it
+# additionaly.
+After=time-sync.target network-online.target
+Wants=time-sync.target
[Service]
Type=simple
@@ -16,4 +21,5 @@ LimitNOFILE=500000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE
[Install]
+# ClickHouse should not start from the rescue shell (rescue.target).
WantedBy=multi-user.target
diff --git a/debian/control b/debian/control
index 9b34e982698..633b7e7c8a3 100644
--- a/debian/control
+++ b/debian/control
@@ -1,16 +1,13 @@
Source: clickhouse
Section: database
Priority: optional
-Maintainer: Alexey Milovidov
+Maintainer: Alexey Milovidov
Build-Depends: debhelper (>= 9),
cmake | cmake3,
ninja-build,
- clang-11,
- llvm-11,
+ clang-13,
+ llvm-13,
libc6-dev,
- libicu-dev,
- libreadline-dev,
- gperf,
tzdata
Standards-Version: 3.9.8
diff --git a/debian/rules b/debian/rules
index 73d1f3d3b34..4562d24bec4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,8 +36,8 @@ endif
CMAKE_FLAGS += -DENABLE_UTILS=0
-DEB_CC ?= $(shell which gcc-10 gcc-9 gcc | head -n1)
-DEB_CXX ?= $(shell which g++-10 g++-9 g++ | head -n1)
+DEB_CC ?= $(shell which gcc-11 gcc-10 gcc-9 gcc | head -n1)
+DEB_CXX ?= $(shell which g++-11 g++-10 g++-9 g++ | head -n1)
ifdef DEB_CXX
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile
index abe102e9c80..5a998ffbe3e 100644
--- a/docker/builder/Dockerfile
+++ b/docker/builder/Dockerfile
@@ -1,6 +1,6 @@
FROM ubuntu:20.04
-ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
+ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
diff --git a/docker/builder/build.sh b/docker/builder/build.sh
index d4cf662e91b..1025af3f96e 100755
--- a/docker/builder/build.sh
+++ b/docker/builder/build.sh
@@ -4,7 +4,7 @@ set -e
#ccache -s # uncomment to display CCache statistics
mkdir -p /server/build_docker
cd /server/build_docker
-cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v clang-11)" "-DCMAKE_CXX_COMPILER=$(command -v clang++-11)"
+cmake -G Ninja /server "-DCMAKE_C_COMPILER=$(command -v clang-13)" "-DCMAKE_CXX_COMPILER=$(command -v clang++-13)"
# Set the number of build jobs to the half of number of virtual CPU cores (rounded up).
# By default, ninja use all virtual CPU cores, that leads to very high memory consumption without much improvement in build time.
diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile
index 1b398b43c32..962459ccead 100644
--- a/docker/client/Dockerfile
+++ b/docker/client/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:18.04
ARG repository="deb https://repo.clickhouse.tech/deb/stable/ main/"
-ARG version=21.10.1.*
+ARG version=21.11.1.*
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
diff --git a/docker/images.json b/docker/images.json
index e2e22468596..96424bb9432 100644
--- a/docker/images.json
+++ b/docker/images.json
@@ -1,12 +1,12 @@
{
"docker/packager/deb": {
- "name": "yandex/clickhouse-deb-builder",
+ "name": "clickhouse/deb-builder",
"dependent": [
"docker/packager/unbundled"
]
},
"docker/packager/binary": {
- "name": "yandex/clickhouse-binary-builder",
+ "name": "clickhouse/binary-builder",
"dependent": [
"docker/test/split_build_smoke_test",
"docker/test/pvs",
@@ -14,155 +14,150 @@
]
},
"docker/packager/unbundled": {
- "name": "yandex/clickhouse-unbundled-builder",
+ "name": "clickhouse/unbundled-builder",
"dependent": []
},
"docker/test/compatibility/centos": {
- "name": "yandex/clickhouse-test-old-centos",
+ "name": "clickhouse/test-old-centos",
"dependent": []
},
"docker/test/compatibility/ubuntu": {
- "name": "yandex/clickhouse-test-old-ubuntu",
+ "name": "clickhouse/test-old-ubuntu",
"dependent": []
},
"docker/test/integration/base": {
- "name": "yandex/clickhouse-integration-test",
+ "name": "clickhouse/integration-test",
"dependent": []
},
"docker/test/fuzzer": {
- "name": "yandex/clickhouse-fuzzer",
+ "name": "clickhouse/fuzzer",
"dependent": []
},
"docker/test/performance-comparison": {
- "name": "yandex/clickhouse-performance-comparison",
+ "name": "clickhouse/performance-comparison",
"dependent": []
},
"docker/test/pvs": {
- "name": "yandex/clickhouse-pvs-test",
+ "name": "clickhouse/pvs-test",
"dependent": []
},
"docker/test/stateless": {
- "name": "yandex/clickhouse-stateless-test",
+ "name": "clickhouse/stateless-test",
"dependent": [
"docker/test/stateful",
"docker/test/coverage",
"docker/test/unit"
]
},
- "docker/test/stateless_pytest": {
- "name": "yandex/clickhouse-stateless-pytest",
- "dependent": []
- },
"docker/test/stateful": {
- "name": "yandex/clickhouse-stateful-test",
+ "name": "clickhouse/stateful-test",
"dependent": [
"docker/test/stress"
]
},
"docker/test/coverage": {
- "name": "yandex/clickhouse-test-coverage",
+ "name": "clickhouse/test-coverage",
"dependent": []
},
"docker/test/unit": {
- "name": "yandex/clickhouse-unit-test",
+ "name": "clickhouse/unit-test",
"dependent": []
},
"docker/test/stress": {
- "name": "yandex/clickhouse-stress-test",
+ "name": "clickhouse/stress-test",
"dependent": []
},
"docker/test/split_build_smoke_test": {
- "name": "yandex/clickhouse-split-build-smoke-test",
+ "name": "clickhouse/split-build-smoke-test",
"dependent": []
},
"docker/test/codebrowser": {
- "name": "yandex/clickhouse-codebrowser",
+ "name": "clickhouse/codebrowser",
"dependent": []
},
"docker/test/integration/runner": {
- "name": "yandex/clickhouse-integration-tests-runner",
+ "name": "clickhouse/integration-tests-runner",
"dependent": []
},
"docker/test/testflows/runner": {
- "name": "yandex/clickhouse-testflows-runner",
+ "name": "clickhouse/testflows-runner",
"dependent": []
},
"docker/test/fasttest": {
- "name": "yandex/clickhouse-fasttest",
+ "name": "clickhouse/fasttest",
"dependent": []
},
"docker/test/style": {
- "name": "yandex/clickhouse-style-test",
+ "name": "clickhouse/style-test",
"dependent": []
},
"docker/test/integration/s3_proxy": {
- "name": "yandex/clickhouse-s3-proxy",
+ "name": "clickhouse/s3-proxy",
"dependent": []
},
"docker/test/integration/resolver": {
- "name": "yandex/clickhouse-python-bottle",
+ "name": "clickhouse/python-bottle",
"dependent": []
},
"docker/test/integration/helper_container": {
- "name": "yandex/clickhouse-integration-helper",
+ "name": "clickhouse/integration-helper",
"dependent": []
},
"docker/test/integration/mysql_golang_client": {
- "name": "yandex/clickhouse-mysql-golang-client",
+ "name": "clickhouse/mysql-golang-client",
"dependent": []
},
"docker/test/integration/mysql_java_client": {
- "name": "yandex/clickhouse-mysql-java-client",
+ "name": "clickhouse/mysql-java-client",
"dependent": []
},
"docker/test/integration/mysql_js_client": {
- "name": "yandex/clickhouse-mysql-js-client",
+ "name": "clickhouse/mysql-js-client",
"dependent": []
},
"docker/test/integration/mysql_php_client": {
- "name": "yandex/clickhouse-mysql-php-client",
+ "name": "clickhouse/mysql-php-client",
"dependent": []
},
"docker/test/integration/postgresql_java_client": {
- "name": "yandex/clickhouse-postgresql-java-client",
+ "name": "clickhouse/postgresql-java-client",
"dependent": []
},
"docker/test/integration/kerberos_kdc": {
- "name": "yandex/clickhouse-kerberos-kdc",
+ "name": "clickhouse/kerberos-kdc",
"dependent": []
},
"docker/test/base": {
- "name": "yandex/clickhouse-test-base",
+ "name": "clickhouse/test-base",
"dependent": [
"docker/test/stateless",
"docker/test/stateless_unbundled",
- "docker/test/stateless_pytest",
"docker/test/integration/base",
"docker/test/fuzzer",
"docker/test/keeper-jepsen"
]
},
"docker/packager/unbundled": {
- "name": "yandex/clickhouse-unbundled-builder",
+ "name": "clickhouse/unbundled-builder",
"dependent": [
"docker/test/stateless_unbundled"
]
},
"docker/test/stateless_unbundled": {
- "name": "yandex/clickhouse-stateless-unbundled-test",
+ "name": "clickhouse/stateless-unbundled-test",
"dependent": [
]
},
"docker/test/integration/kerberized_hadoop": {
- "name": "yandex/clickhouse-kerberized-hadoop",
+ "name": "clickhouse/kerberized-hadoop",
"dependent": []
},
"docker/test/sqlancer": {
- "name": "yandex/clickhouse-sqlancer-test",
+ "name": "clickhouse/sqlancer-test",
"dependent": []
},
"docker/test/keeper-jepsen": {
- "name": "yandex/clickhouse-keeper-jepsen-test",
+ "name": "clickhouse/keeper-jepsen-test",
"dependent": []
}
}
diff --git a/docker/packager/binary/Dockerfile b/docker/packager/binary/Dockerfile
index 0393669df48..23012a38f9d 100644
--- a/docker/packager/binary/Dockerfile
+++ b/docker/packager/binary/Dockerfile
@@ -1,7 +1,7 @@
-# docker build -t yandex/clickhouse-binary-builder .
+# docker build -t clickhouse/binary-builder .
FROM ubuntu:20.04
-ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
+ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
@@ -39,20 +39,18 @@ RUN apt-get update \
bash \
build-essential \
ccache \
- clang-11 \
- clang-tidy-11 \
cmake \
curl \
- g++-10 \
- gcc-10 \
gdb \
git \
gperf \
+ clang-${LLVM_VERSION} \
+ clang-tidy-${LLVM_VERSION} \
+ lld-${LLVM_VERSION} \
+ llvm-${LLVM_VERSION} \
+ llvm-${LLVM_VERSION}-dev \
libicu-dev \
libreadline-dev \
- lld-11 \
- llvm-11 \
- llvm-11-dev \
moreutils \
ninja-build \
pigz \
@@ -102,15 +100,10 @@ RUN wget -nv "https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.0
# Download toolchain for FreeBSD 11.3
RUN wget -nv https://clickhouse-datasets.s3.yandex.net/toolchains/toolchains/freebsd-11.3-toolchain.tar.xz
-# NOTE: For some reason we have outdated version of gcc-10 in ubuntu 20.04 stable.
-# Current workaround is to use latest version proposed repo. Remove as soon as
-# gcc-10.2 appear in stable repo.
-RUN echo 'deb http://archive.ubuntu.com/ubuntu/ focal-proposed restricted main multiverse universe' > /etc/apt/sources.list.d/proposed-repositories.list
-
-RUN apt-get update \
- && apt-get install gcc-10 g++-10 --yes
-
-RUN rm /etc/apt/sources.list.d/proposed-repositories.list && apt-get update
+# NOTE: Seems like gcc-11 is too new for ubuntu20 repository
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test --yes \
+ && apt-get update \
+ && apt-get install gcc-11 g++-11 --yes
COPY build.sh /
diff --git a/docker/packager/binary/build.sh b/docker/packager/binary/build.sh
index b9900e34bf1..71402a2fd66 100755
--- a/docker/packager/binary/build.sh
+++ b/docker/packager/binary/build.sh
@@ -4,7 +4,6 @@ set -x -e
mkdir -p build/cmake/toolchain/darwin-x86_64
tar xJf MacOSX11.0.sdk.tar.xz -C build/cmake/toolchain/darwin-x86_64 --strip-components=1
-
ln -sf darwin-x86_64 build/cmake/toolchain/darwin-aarch64
mkdir -p build/cmake/toolchain/linux-aarch64
@@ -23,6 +22,7 @@ cd build/build_docker
rm -f CMakeCache.txt
# Read cmake arguments into array (possibly empty)
read -ra CMAKE_FLAGS <<< "${CMAKE_FLAGS:-}"
+env
cmake --debug-trycompile --verbose=1 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
ccache --show-config ||:
diff --git a/docker/packager/deb/Dockerfile b/docker/packager/deb/Dockerfile
index 294c8645455..318b960e0b4 100644
--- a/docker/packager/deb/Dockerfile
+++ b/docker/packager/deb/Dockerfile
@@ -1,7 +1,7 @@
-# docker build -t yandex/clickhouse-deb-builder .
+# docker build -t clickhouse/deb-builder .
FROM ubuntu:20.04
-ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
+ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
@@ -37,17 +37,17 @@ RUN curl -O https://clickhouse-datasets.s3.yandex.net/utils/1/dpkg-deb \
RUN apt-get update \
&& apt-get install \
alien \
- clang-11 \
- clang-tidy-11 \
+ clang-${LLVM_VERSION} \
+ clang-tidy-${LLVM_VERSION} \
cmake \
debhelper \
devscripts \
gdb \
git \
gperf \
- lld-11 \
- llvm-11 \
- llvm-11-dev \
+ lld-${LLVM_VERSION} \
+ llvm-${LLVM_VERSION} \
+ llvm-${LLVM_VERSION}-dev \
moreutils \
ninja-build \
perl \
@@ -57,15 +57,11 @@ RUN apt-get update \
tzdata \
--yes --no-install-recommends
-# NOTE: For some reason we have outdated version of gcc-10 in ubuntu 20.04 stable.
-# Current workaround is to use latest version proposed repo. Remove as soon as
-# gcc-10.2 appear in stable repo.
-RUN echo 'deb http://archive.ubuntu.com/ubuntu/ focal-proposed restricted main multiverse universe' > /etc/apt/sources.list.d/proposed-repositories.list
+# NOTE: Seems like gcc-11 is too new for ubuntu20 repository
+RUN add-apt-repository ppa:ubuntu-toolchain-r/test --yes \
+ && apt-get update \
+ && apt-get install gcc-11 g++-11 --yes
-RUN apt-get update \
- && apt-get install gcc-10 g++-10 --yes --no-install-recommends
-
-RUN rm /etc/apt/sources.list.d/proposed-repositories.list && apt-get update
# This symlink required by gcc to find lld compiler
RUN ln -s /usr/bin/lld-${LLVM_VERSION} /usr/bin/ld.lld
diff --git a/docker/packager/packager b/docker/packager/packager
index 673878bce43..f8e5fd717cf 100755
--- a/docker/packager/packager
+++ b/docker/packager/packager
@@ -9,9 +9,9 @@ import sys
SCRIPT_PATH = os.path.realpath(__file__)
IMAGE_MAP = {
- "deb": "yandex/clickhouse-deb-builder",
- "binary": "yandex/clickhouse-binary-builder",
- "unbundled": "yandex/clickhouse-unbundled-builder"
+ "deb": "clickhouse/deb-builder",
+ "binary": "clickhouse/binary-builder",
+ "unbundled": "clickhouse/unbundled-builder"
}
def check_image_exists_locally(image_name):
@@ -75,7 +75,7 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
# Explicitly use LLD with Clang by default.
# Don't force linker for cross-compilation.
if is_clang and not is_cross_compile:
- cmake_flags.append("-DLINKER_NAME=lld")
+ cmake_flags.append("-DLINKER_NAME=ld.lld")
if is_cross_darwin:
cc = compiler[:-len(DARWIN_SUFFIX)]
@@ -204,7 +204,9 @@ if __name__ == "__main__":
parser.add_argument("--output-dir", required=True)
parser.add_argument("--build-type", choices=("debug", ""), default="")
parser.add_argument("--compiler", choices=("clang-11", "clang-11-darwin", "clang-11-darwin-aarch64", "clang-11-aarch64",
- "clang-11-freebsd", "gcc-10"), default="clang-11")
+ "clang-12", "clang-12-darwin", "clang-12-darwin-aarch64", "clang-12-aarch64",
+ "clang-13", "clang-13-darwin", "clang-13-darwin-aarch64", "clang-13-aarch64",
+ "clang-11-freebsd", "clang-12-freebsd", "clang-13-freebsd", "gcc-11"), default="clang-13")
parser.add_argument("--sanitizer", choices=("address", "thread", "memory", "undefined", ""), default="")
parser.add_argument("--unbundled", action="store_true")
parser.add_argument("--split-binary", action="store_true")
diff --git a/docker/packager/unbundled/Dockerfile b/docker/packager/unbundled/Dockerfile
index b2d9f555f19..4fe093a0751 100644
--- a/docker/packager/unbundled/Dockerfile
+++ b/docker/packager/unbundled/Dockerfile
@@ -1,5 +1,5 @@
-# docker build -t yandex/clickhouse-unbundled-builder .
-FROM yandex/clickhouse-deb-builder
+# docker build -t clickhouse/unbundled-builder .
+FROM clickhouse/deb-builder
RUN export CODENAME="$(lsb_release --codename --short | tr 'A-Z' 'a-z')" \
&& wget -nv -O /tmp/arrow-keyring.deb "https://apache.jfrog.io/artifactory/arrow/ubuntu/apache-arrow-apt-source-latest-${CODENAME}.deb" \
@@ -17,6 +17,7 @@ RUN apt-get update \
devscripts \
libc++-dev \
libc++abi-dev \
+ libboost-all-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-filesystem-dev \
diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile
index 6307e74c633..7309574b16c 100644
--- a/docker/server/Dockerfile
+++ b/docker/server/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:20.04
ARG repository="deb https://repo.clickhouse.tech/deb/stable/ main/"
-ARG version=21.10.1.*
+ARG version=21.11.1.*
ARG gosu_ver=1.10
# set non-empty deb_location_url url to create a docker image
diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile
index 62cfcf9e896..b3a23bf9662 100644
--- a/docker/test/Dockerfile
+++ b/docker/test/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:18.04
ARG repository="deb https://repo.clickhouse.tech/deb/stable/ main/"
-ARG version=21.10.1.*
+ARG version=21.11.1.*
RUN apt-get update && \
apt-get install -y apt-transport-https dirmngr && \
diff --git a/docker/test/base/Dockerfile b/docker/test/base/Dockerfile
index 611ef6b7702..2d49c207ac3 100644
--- a/docker/test/base/Dockerfile
+++ b/docker/test/base/Dockerfile
@@ -1,7 +1,7 @@
-# docker build -t yandex/clickhouse-test-base .
+# docker build -t clickhouse/test-base .
FROM ubuntu:20.04
-ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
+ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
diff --git a/docker/test/codebrowser/Dockerfile b/docker/test/codebrowser/Dockerfile
index 33173ab90f9..94aa321252b 100644
--- a/docker/test/codebrowser/Dockerfile
+++ b/docker/test/codebrowser/Dockerfile
@@ -1,6 +1,6 @@
-# docker build --network=host -t yandex/clickhouse-codebrowser .
-# docker run --volume=path_to_repo:/repo_folder --volume=path_to_result:/test_output yandex/clickhouse-codebrowser
-FROM yandex/clickhouse-binary-builder
+# docker build --network=host -t clickhouse/codebrowser .
+# docker run --volume=path_to_repo:/repo_folder --volume=path_to_result:/test_output clickhouse/codebrowser
+FROM clickhouse/binary-builder
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get --yes --allow-unauthenticated install clang-9 libl
# https://github.com/ClickHouse-Extras/woboq_codebrowser/commit/37e15eaf377b920acb0b48dbe82471be9203f76b
RUN git clone https://github.com/ClickHouse-Extras/woboq_codebrowser
-RUN cd woboq_codebrowser && cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang\+\+-9 -DCMAKE_C_COMPILER=clang-9 && make -j
+RUN cd woboq_codebrowser && cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang\+\+-13 -DCMAKE_C_COMPILER=clang-13 && make -j
ENV CODEGEN=/woboq_codebrowser/generator/codebrowser_generator
ENV CODEINDEX=/woboq_codebrowser/indexgenerator/codebrowser_indexgenerator
@@ -24,7 +24,7 @@ ENV SHA=nosha
ENV DATA="data"
CMD mkdir -p $BUILD_DIRECTORY && cd $BUILD_DIRECTORY && \
- cmake $SOURCE_DIRECTORY -DCMAKE_CXX_COMPILER=/usr/bin/clang\+\+-11 -DCMAKE_C_COMPILER=/usr/bin/clang-11 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_EMBEDDED_COMPILER=0 -DENABLE_S3=0 && \
+ cmake $SOURCE_DIRECTORY -DCMAKE_CXX_COMPILER=/usr/bin/clang\+\+-13 -DCMAKE_C_COMPILER=/usr/bin/clang-13 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_EMBEDDED_COMPILER=0 -DENABLE_S3=0 && \
mkdir -p $HTML_RESULT_DIRECTORY && \
$CODEGEN -b $BUILD_DIRECTORY -a -o $HTML_RESULT_DIRECTORY -p ClickHouse:$SOURCE_DIRECTORY:$SHA -d $DATA | ts '%Y-%m-%d %H:%M:%S' && \
cp -r $STATIC_DATA $HTML_RESULT_DIRECTORY/ &&\
diff --git a/docker/test/compatibility/centos/Dockerfile b/docker/test/compatibility/centos/Dockerfile
index 0ef119d1bb1..628609e374f 100644
--- a/docker/test/compatibility/centos/Dockerfile
+++ b/docker/test/compatibility/centos/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-test-old-centos .
+# docker build -t clickhouse/test-old-centos .
FROM centos:5
CMD /bin/sh -c "/clickhouse server --config /config/config.xml > /var/log/clickhouse-server/stderr.log 2>&1 & \
diff --git a/docker/test/compatibility/ubuntu/Dockerfile b/docker/test/compatibility/ubuntu/Dockerfile
index 28f89e47b95..ddd0a76bd44 100644
--- a/docker/test/compatibility/ubuntu/Dockerfile
+++ b/docker/test/compatibility/ubuntu/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-test-old-ubuntu .
+# docker build -t clickhouse/test-old-ubuntu .
FROM ubuntu:12.04
CMD /bin/sh -c "/clickhouse server --config /config/config.xml > /var/log/clickhouse-server/stderr.log 2>&1 & \
diff --git a/docker/test/coverage/Dockerfile b/docker/test/coverage/Dockerfile
index 681f65e0f6f..ccf0bbc7c83 100644
--- a/docker/test/coverage/Dockerfile
+++ b/docker/test/coverage/Dockerfile
@@ -1,5 +1,5 @@
-# docker build -t yandex/clickhouse-test-coverage .
-FROM yandex/clickhouse-stateless-test
+# docker build -t clickhouse/test-coverage .
+FROM clickhouse/stateless-test
RUN apt-get update -y \
&& env DEBIAN_FRONTEND=noninteractive \
diff --git a/docker/test/coverage/run.sh b/docker/test/coverage/run.sh
index 11b6ce13ea1..807efdf1e47 100755
--- a/docker/test/coverage/run.sh
+++ b/docker/test/coverage/run.sh
@@ -80,7 +80,7 @@ LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-client --query "RENAM
LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-client --query "RENAME TABLE datasets.visits_v1 TO test.visits"
LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-client --query "SHOW TABLES FROM test"
-LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-test -j 8 --testname --shard --zookeeper --print-time --use-skip-list 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee /test_result.txt
+LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-test -j 8 --testname --shard --zookeeper --print-time 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee /test_result.txt
readarray -t FAILED_TESTS < <(awk '/FAIL|TIMEOUT|ERROR/ { print substr($3, 1, length($3)-1) }' "/test_result.txt")
@@ -97,7 +97,7 @@ then
echo "Going to run again: ${FAILED_TESTS[*]}"
- LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-test --order=random --testname --shard --zookeeper --use-skip-list "${FAILED_TESTS[@]}" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee -a /test_result.txt
+ LLVM_PROFILE_FILE='client_coverage_%5m.profraw' clickhouse-test --order=random --testname --shard --zookeeper "${FAILED_TESTS[@]}" 2>&1 | ts '%Y-%m-%d %H:%M:%S' | tee -a /test_result.txt
else
echo "No failed tests"
fi
diff --git a/docker/test/coverage/s3downloader b/docker/test/coverage/s3downloader
index 363ece8dac6..eb3b3cd9faf 100755
--- a/docker/test/coverage/s3downloader
+++ b/docker/test/coverage/s3downloader
@@ -92,7 +92,7 @@ if __name__ == "__main__":
logging.info("Some exception occured %s", str(ex))
raise
finally:
- logging.info("Will remove dowloaded file %s from filesystem if it exists", temp_archive_path)
+ logging.info("Will remove downloaded file %s from filesystem if it exists", temp_archive_path)
if os.path.exists(temp_archive_path):
os.remove(temp_archive_path)
logging.info("Processing of %s finished", dataset)
diff --git a/docker/test/fasttest/Dockerfile b/docker/test/fasttest/Dockerfile
index 2e0bbcd350f..3119b2f1bb3 100644
--- a/docker/test/fasttest/Dockerfile
+++ b/docker/test/fasttest/Dockerfile
@@ -1,7 +1,7 @@
-# docker build -t yandex/clickhouse-fasttest .
+# docker build -t clickhouse/fasttest .
FROM ubuntu:20.04
-ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=11
+ENV DEBIAN_FRONTEND=noninteractive LLVM_VERSION=13
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh
index b7c8240abba..0cda2f8f17f 100755
--- a/docker/test/fasttest/run.sh
+++ b/docker/test/fasttest/run.sh
@@ -9,7 +9,7 @@ trap 'kill $(jobs -pr) ||:' EXIT
stage=${stage:-}
# Compiler version, normally set by Dockerfile
-export LLVM_VERSION=${LLVM_VERSION:-11}
+export LLVM_VERSION=${LLVM_VERSION:-13}
# A variable to pass additional flags to CMake.
# Here we explicitly default it to nothing so that bash doesn't complain about
@@ -159,6 +159,7 @@ function clone_submodules
cd "$FASTTEST_SOURCE"
SUBMODULES_TO_UPDATE=(
+ contrib/magic_enum
contrib/abseil-cpp
contrib/boost
contrib/zlib-ng
@@ -261,150 +262,8 @@ function run_tests
start_server
- TESTS_TO_SKIP=(
- 00105_shard_collations
- 00109_shard_totals_after_having
- 00110_external_sort
- 00302_http_compression
- 00417_kill_query
- 00436_convert_charset
- 00490_special_line_separators_and_characters_outside_of_bmp
- 00652_replicated_mutations_zookeeper
- 00682_empty_parts_merge
- 00701_rollup
- 00834_cancel_http_readonly_queries_on_client_close
- 00911_tautological_compare
-
- # Hyperscan
- 00926_multimatch
- 00929_multi_match_edit_distance
- 01681_hyperscan_debug_assertion
- 02004_max_hyperscan_regex_length
-
- 01176_mysql_client_interactive # requires mysql client
- 01031_mutations_interpreter_and_context
- 01053_ssd_dictionary # this test mistakenly requires acces to /var/lib/clickhouse -- can't run this locally, disabled
- 01083_expressions_in_engine_arguments
- 01092_memory_profiler
- 01098_msgpack_format
- 01098_temporary_and_external_tables
- 01103_check_cpu_instructions_at_startup # avoid dependency on qemu -- invonvenient when running locally
- 01193_metadata_loading
- 01238_http_memory_tracking # max_memory_usage_for_user can interfere another queries running concurrently
- 01251_dict_is_in_infinite_loop
- 01259_dictionary_custom_settings_ddl
- 01268_dictionary_direct_layout
- 01280_ssd_complex_key_dictionary
- 01281_group_by_limit_memory_tracking # max_memory_usage_for_user can interfere another queries running concurrently
- 01318_encrypt # Depends on OpenSSL
- 01318_decrypt # Depends on OpenSSL
- 01663_aes_msan # Depends on OpenSSL
- 01667_aes_args_check # Depends on OpenSSL
- 01683_codec_encrypted # Depends on OpenSSL
- 01776_decrypt_aead_size_check # Depends on OpenSSL
- 01811_filter_by_null # Depends on OpenSSL
- 02012_sha512_fixedstring # Depends on OpenSSL
- 01281_unsucceeded_insert_select_queries_counter
- 01292_create_user
- 01294_lazy_database_concurrent
- 01305_replica_create_drop_zookeeper
- 01354_order_by_tuple_collate_const
- 01355_ilike
- 01411_bayesian_ab_testing
- 01798_uniq_theta_sketch
- 01799_long_uniq_theta_sketch
- 01890_stem # depends on libstemmer_c
- 02003_compress_bz2 # depends on bzip2
- 01059_storage_file_compression # depends on brotli and bzip2
- collate
- collation
- _orc_
- arrow
- avro
- base64
- brotli
- capnproto
- client
- ddl_dictionaries
- h3
- hashing
- hdfs
- java_hash
- json
- limit_memory
- live_view
- memory_leak
- memory_limit
- mysql
- odbc
- parallel_alter
- parquet
- protobuf
- secure
- sha256
- xz
-
- # Not sure why these two fail even in sequential mode. Disabled for now
- # to make some progress.
- 00646_url_engine
- 00974_query_profiler
-
- # In fasttest, ENABLE_LIBRARIES=0, so rocksdb engine is not enabled by default
- 01504_rocksdb
- 01686_rocksdb
-
- # Look at DistributedFilesToInsert, so cannot run in parallel.
- 01460_DistributedFilesToInsert
-
- 01541_max_memory_usage_for_user_long
-
- # Require python libraries like scipy, pandas and numpy
- 01322_ttest_scipy
- 01561_mann_whitney_scipy
-
- 01545_system_errors
- # Checks system.errors
- 01563_distributed_query_finish
-
- # nc - command not found
- 01601_proxy_protocol
- 01622_defaults_for_url_engine
-
- # JSON functions
- 01666_blns
-
- # Requires postgresql-client
- 01802_test_postgresql_protocol_with_row_policy
-
- # Depends on AWS
- 01801_s3_cluster
- 02012_settings_clause_for_s3
-
- # needs psql
- 01889_postgresql_protocol_null_fields
-
- # needs pv
- 01923_network_receive_time_metric_insert
-
- 01889_sqlite_read_write
-
- # needs s2
- 01849_geoToS2
- 01851_s2_to_geo
- 01852_s2_get_neighbours
- 01853_s2_cells_intersect
- 01854_s2_cap_contains
- 01854_s2_cap_union
-
- # needs s3
- 01944_insert_partition_by
-
- # depends on Go
- 02013_zlib_read_after_eof
- )
-
- time clickhouse-test --hung-check -j 8 --order=random --use-skip-list \
- --no-long --testname --shard --zookeeper --skip "${TESTS_TO_SKIP[@]}" \
+ time clickhouse-test --hung-check -j 8 --order=random \
+ --fast-tests-only --no-long --testname --shard --zookeeper \
-- "$FASTTEST_FOCUS" 2>&1 \
| ts '%Y-%m-%d %H:%M:%S' \
| tee "$FASTTEST_OUTPUT/test_log.txt"
diff --git a/docker/test/fuzzer/Dockerfile b/docker/test/fuzzer/Dockerfile
index 9a96ac1dfa7..6444e745c47 100644
--- a/docker/test/fuzzer/Dockerfile
+++ b/docker/test/fuzzer/Dockerfile
@@ -1,5 +1,5 @@
-# docker build -t yandex/clickhouse-fuzzer .
-FROM yandex/clickhouse-test-base
+# docker build -t clickhouse/fuzzer .
+FROM clickhouse/test-base
ENV LANG=C.UTF-8
ENV TZ=Europe/Moscow
@@ -36,5 +36,5 @@ CMD set -o pipefail \
&& cd /workspace \
&& /run-fuzzer.sh 2>&1 | ts "$(printf '%%Y-%%m-%%d %%H:%%M:%%S\t')" | tee main.log
-# docker run --network=host --volume :/workspace -e PR_TO_TEST=<> -e SHA_TO_TEST=<> yandex/clickhouse-fuzzer
+# docker run --network=host --volume :/workspace -e PR_TO_TEST=<> -e SHA_TO_TEST=<> clickhouse/fuzzer
diff --git a/docker/test/fuzzer/run-fuzzer.sh b/docker/test/fuzzer/run-fuzzer.sh
index 603c35ede54..0b26476c20e 100755
--- a/docker/test/fuzzer/run-fuzzer.sh
+++ b/docker/test/fuzzer/run-fuzzer.sh
@@ -12,7 +12,7 @@ stage=${stage:-}
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "$script_dir"
repo_dir=ch
-BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-11_debug_none_bundled_unsplitted_disable_False_binary"}
+BINARY_TO_DOWNLOAD=${BINARY_TO_DOWNLOAD:="clang-13_debug_none_bundled_unsplitted_disable_False_binary"}
function clone
{
diff --git a/docker/test/integration/base/Dockerfile b/docker/test/integration/base/Dockerfile
index 344c1b9a698..519c64297e5 100644
--- a/docker/test/integration/base/Dockerfile
+++ b/docker/test/integration/base/Dockerfile
@@ -1,5 +1,5 @@
-# docker build -t yandex/clickhouse-integration-test .
-FROM yandex/clickhouse-test-base
+# docker build -t clickhouse/integration-test .
+FROM clickhouse/test-base
SHELL ["/bin/bash", "-c"]
diff --git a/docker/test/integration/helper_container/Dockerfile b/docker/test/integration/helper_container/Dockerfile
index 922eb2c6f22..6a093081bf2 100644
--- a/docker/test/integration/helper_container/Dockerfile
+++ b/docker/test/integration/helper_container/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-integration-helper .
+# docker build -t clickhouse/integration-helper .
# Helper docker container to run iptables without sudo
FROM alpine
diff --git a/docker/test/integration/kerberized_hadoop/Dockerfile b/docker/test/integration/kerberized_hadoop/Dockerfile
index 6a2fd96e7a7..11da590f901 100644
--- a/docker/test/integration/kerberized_hadoop/Dockerfile
+++ b/docker/test/integration/kerberized_hadoop/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-kerberized-hadoop .
+# docker build -t clickhouse/kerberized-hadoop .
FROM sequenceiq/hadoop-docker:2.7.0
RUN sed -i -e 's/^\#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo
diff --git a/docker/test/integration/kerberos_kdc/Dockerfile b/docker/test/integration/kerberos_kdc/Dockerfile
index ea231b1191d..a203c33a331 100644
--- a/docker/test/integration/kerberos_kdc/Dockerfile
+++ b/docker/test/integration/kerberos_kdc/Dockerfile
@@ -1,9 +1,9 @@
-# docker build -t yandex/clickhouse-kerberos-kdc .
+# docker build -t clickhouse/kerberos-kdc .
+FROM centos:6
-FROM centos:6.6
-# old OS to make is faster and smaller
+RUN sed -i '/^mirrorlist/s/^/#/;/^#baseurl/{s/#//;s/mirror.centos.org\/centos\/$releasever/vault.centos.org\/6.10/}' /etc/yum.repos.d/*B*
-RUN yum install -y krb5-server krb5-libs krb5-auth-dialog krb5-workstation
+RUN yum install -y ca-certificates krb5-server krb5-libs krb5-auth-dialog krb5-workstation
EXPOSE 88 749
diff --git a/docker/test/integration/mysql_golang_client/Dockerfile b/docker/test/integration/mysql_golang_client/Dockerfile
index 4380383d1fb..68b0aaab42c 100644
--- a/docker/test/integration/mysql_golang_client/Dockerfile
+++ b/docker/test/integration/mysql_golang_client/Dockerfile
@@ -1,7 +1,7 @@
-# docker build -t yandex/clickhouse-mysql-golang-client .
+# docker build -t clickhouse/mysql-golang-client .
# MySQL golang client docker container
-FROM golang:1.12.2
+FROM golang:1.13
RUN go get "github.com/go-sql-driver/mysql"
diff --git a/docker/test/integration/mysql_java_client/Dockerfile b/docker/test/integration/mysql_java_client/Dockerfile
index fcb6a39f33b..0abf50cd493 100644
--- a/docker/test/integration/mysql_java_client/Dockerfile
+++ b/docker/test/integration/mysql_java_client/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-mysql-java-client .
+# docker build -t clickhouse/mysql-java-client .
# MySQL Java client docker container
FROM ubuntu:18.04
diff --git a/docker/test/integration/mysql_js_client/Dockerfile b/docker/test/integration/mysql_js_client/Dockerfile
index 4f12de004ac..b1397b40d38 100644
--- a/docker/test/integration/mysql_js_client/Dockerfile
+++ b/docker/test/integration/mysql_js_client/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-mysql-js-client .
+# docker build -t clickhouse/mysql-js-client .
# MySQL JavaScript client docker container
FROM node:8
diff --git a/docker/test/integration/mysql_php_client/Dockerfile b/docker/test/integration/mysql_php_client/Dockerfile
index e2ceb62f44f..0fb77bf8ffb 100644
--- a/docker/test/integration/mysql_php_client/Dockerfile
+++ b/docker/test/integration/mysql_php_client/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-mysql-php-client .
+# docker build -t clickhouse/mysql-php-client .
# MySQL PHP client docker container
FROM php:7.3-cli
diff --git a/docker/test/integration/postgresql_java_client/Dockerfile b/docker/test/integration/postgresql_java_client/Dockerfile
index eab236c9590..f5484028ec9 100644
--- a/docker/test/integration/postgresql_java_client/Dockerfile
+++ b/docker/test/integration/postgresql_java_client/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-postgresql-java-client .
+# docker build -t clickhouse/postgresql-java-client .
# PostgreSQL Java client docker container
FROM ubuntu:18.04
diff --git a/docker/test/integration/resolver/Dockerfile b/docker/test/integration/resolver/Dockerfile
index b0efb4b46d5..01b9b777614 100644
--- a/docker/test/integration/resolver/Dockerfile
+++ b/docker/test/integration/resolver/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-python-bottle .
+# docker build -t clickhouse/python-bottle .
# Helper docker container to run python bottle apps
FROM python:3
diff --git a/docker/test/integration/runner/Dockerfile b/docker/test/integration/runner/Dockerfile
index ef333e461c5..06e1f64ced2 100644
--- a/docker/test/integration/runner/Dockerfile
+++ b/docker/test/integration/runner/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-integration-tests-runner .
+# docker build -t clickhouse/integration-tests-runner .
FROM ubuntu:20.04
RUN sed -i 's|http://archive|http://ru.archive|g' /etc/apt/sources.list
diff --git a/docker/test/integration/runner/compose/docker_compose_jdbc_bridge.yml b/docker/test/integration/runner/compose/docker_compose_jdbc_bridge.yml
index a65ef629df6..b3686adc21c 100644
--- a/docker/test/integration/runner/compose/docker_compose_jdbc_bridge.yml
+++ b/docker/test/integration/runner/compose/docker_compose_jdbc_bridge.yml
@@ -1,7 +1,7 @@
version: '2.3'
services:
bridge1:
- image: yandex/clickhouse-jdbc-bridge
+ image: clickhouse/jdbc-bridge
command: |
/bin/bash -c 'cat << EOF > config/datasources/self.json
{
diff --git a/docker/test/integration/runner/compose/docker_compose_keeper.yml b/docker/test/integration/runner/compose/docker_compose_keeper.yml
index e11a13e6eab..134ffbff1f7 100644
--- a/docker/test/integration/runner/compose/docker_compose_keeper.yml
+++ b/docker/test/integration/runner/compose/docker_compose_keeper.yml
@@ -1,7 +1,7 @@
version: '2.3'
services:
zoo1:
- image: ${image:-yandex/clickhouse-integration-test}
+ image: ${image:-clickhouse/integration-test}
restart: always
user: ${user:-}
volumes:
@@ -31,7 +31,7 @@ services:
- inet6
- rotate
zoo2:
- image: ${image:-yandex/clickhouse-integration-test}
+ image: ${image:-clickhouse/integration-test}
restart: always
user: ${user:-}
volumes:
@@ -61,7 +61,7 @@ services:
- inet6
- rotate
zoo3:
- image: ${image:-yandex/clickhouse-integration-test}
+ image: ${image:-clickhouse/integration-test}
restart: always
user: ${user:-}
volumes:
diff --git a/docker/test/integration/runner/compose/docker_compose_kerberized_hdfs.yml b/docker/test/integration/runner/compose/docker_compose_kerberized_hdfs.yml
index b09e75a8515..88be3e45085 100644
--- a/docker/test/integration/runner/compose/docker_compose_kerberized_hdfs.yml
+++ b/docker/test/integration/runner/compose/docker_compose_kerberized_hdfs.yml
@@ -4,7 +4,7 @@ services:
kerberizedhdfs1:
cap_add:
- DAC_READ_SEARCH
- image: yandex/clickhouse-kerberized-hadoop:16621
+ image: clickhouse/kerberized-hadoop
hostname: kerberizedhdfs1
restart: always
volumes:
@@ -22,7 +22,7 @@ services:
entrypoint: /etc/bootstrap.sh -d
hdfskerberos:
- image: yandex/clickhouse-kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG:-latest}
+ image: clickhouse/kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG:-latest}
hostname: hdfskerberos
volumes:
- ${KERBERIZED_HDFS_DIR}/secrets:/tmp/keytab
diff --git a/docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml b/docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml
index 081b90c4f27..d57e4e4d5be 100644
--- a/docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml
+++ b/docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml
@@ -50,7 +50,7 @@ services:
- label:disable
kafka_kerberos:
- image: yandex/clickhouse-kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG:-latest}
+ image: clickhouse/kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG:-latest}
hostname: kafka_kerberos
volumes:
- ${KERBERIZED_KAFKA_DIR}/secrets:/tmp/keytab
diff --git a/docker/test/integration/runner/compose/docker_compose_minio.yml b/docker/test/integration/runner/compose/docker_compose_minio.yml
index 96a5f8bdc31..4384c0868a5 100644
--- a/docker/test/integration/runner/compose/docker_compose_minio.yml
+++ b/docker/test/integration/runner/compose/docker_compose_minio.yml
@@ -19,14 +19,14 @@ services:
# HTTP proxies for Minio.
proxy1:
- image: yandex/clickhouse-s3-proxy
+ image: clickhouse/s3-proxy
expose:
- "8080" # Redirect proxy port
- "80" # Reverse proxy port
- "443" # Reverse proxy port (secure)
proxy2:
- image: yandex/clickhouse-s3-proxy
+ image: clickhouse/s3-proxy
expose:
- "8080"
- "80"
@@ -34,7 +34,7 @@ services:
# Empty container to run proxy resolver.
resolver:
- image: yandex/clickhouse-python-bottle
+ image: clickhouse/python-bottle
expose:
- "8080"
tty: true
diff --git a/docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml b/docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml
index a6a338eb6a8..56cc0410574 100644
--- a/docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml
+++ b/docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml
@@ -1,6 +1,6 @@
version: '2.3'
services:
golang1:
- image: yandex/clickhouse-mysql-golang-client:${DOCKER_MYSQL_GOLANG_CLIENT_TAG:-latest}
+ image: clickhouse/mysql-golang-client:${DOCKER_MYSQL_GOLANG_CLIENT_TAG:-latest}
# to keep container running
command: sleep infinity
diff --git a/docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml b/docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml
index 21d927df82c..eb5ffb01baa 100644
--- a/docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml
+++ b/docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml
@@ -1,6 +1,6 @@
version: '2.3'
services:
java1:
- image: yandex/clickhouse-mysql-java-client:${DOCKER_MYSQL_JAVA_CLIENT_TAG:-latest}
+ image: clickhouse/mysql-java-client:${DOCKER_MYSQL_JAVA_CLIENT_TAG:-latest}
# to keep container running
command: sleep infinity
diff --git a/docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml b/docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml
index dbd85cf2382..90939449c5f 100644
--- a/docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml
+++ b/docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml
@@ -1,6 +1,6 @@
version: '2.3'
services:
mysqljs1:
- image: yandex/clickhouse-mysql-js-client:${DOCKER_MYSQL_JS_CLIENT_TAG:-latest}
+ image: clickhouse/mysql-js-client:${DOCKER_MYSQL_JS_CLIENT_TAG:-latest}
# to keep container running
command: sleep infinity
diff --git a/docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml b/docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml
index f24f5337a7e..408b8ff089a 100644
--- a/docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml
+++ b/docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml
@@ -1,6 +1,6 @@
version: '2.3'
services:
php1:
- image: yandex/clickhouse-mysql-php-client:${DOCKER_MYSQL_PHP_CLIENT_TAG:-latest}
+ image: clickhouse/mysql-php-client:${DOCKER_MYSQL_PHP_CLIENT_TAG:-latest}
# to keep container running
command: sleep infinity
diff --git a/docker/test/integration/runner/compose/docker_compose_postgresql_java_client.yml b/docker/test/integration/runner/compose/docker_compose_postgresql_java_client.yml
index 38191f1bdd6..904bfffdfd5 100644
--- a/docker/test/integration/runner/compose/docker_compose_postgresql_java_client.yml
+++ b/docker/test/integration/runner/compose/docker_compose_postgresql_java_client.yml
@@ -1,6 +1,6 @@
version: '2.2'
services:
java:
- image: yandex/clickhouse-postgresql-java-client:${DOCKER_POSTGRESQL_JAVA_CLIENT_TAG:-latest}
+ image: clickhouse/postgresql-java-client:${DOCKER_POSTGRESQL_JAVA_CLIENT_TAG:-latest}
# to keep container running
command: sleep infinity
diff --git a/docker/test/integration/s3_proxy/Dockerfile b/docker/test/integration/s3_proxy/Dockerfile
index d8b1754fa71..5858218e4e4 100644
--- a/docker/test/integration/s3_proxy/Dockerfile
+++ b/docker/test/integration/s3_proxy/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-s3-proxy .
+# docker build -t clickhouse/s3-proxy .
FROM nginx:alpine
COPY run.sh /run.sh
diff --git a/docker/test/keeper-jepsen/Dockerfile b/docker/test/keeper-jepsen/Dockerfile
index 1a62d5e793f..5bb7f9433c2 100644
--- a/docker/test/keeper-jepsen/Dockerfile
+++ b/docker/test/keeper-jepsen/Dockerfile
@@ -1,5 +1,5 @@
-# docker build -t yandex/clickhouse-keeper-jepsen-test .
-FROM yandex/clickhouse-test-base
+# docker build -t clickhouse/keeper-jepsen-test .
+FROM clickhouse/test-base
ENV DEBIAN_FRONTEND=noninteractive
ENV CLOJURE_VERSION=1.10.3.814
diff --git a/docker/test/keeper-jepsen/run.sh b/docker/test/keeper-jepsen/run.sh
index 352585e16e3..d7534270e2c 100644
--- a/docker/test/keeper-jepsen/run.sh
+++ b/docker/test/keeper-jepsen/run.sh
@@ -2,7 +2,7 @@
set -euo pipefail
-CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.yandex.net/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-11_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse"}
+CLICKHOUSE_PACKAGE=${CLICKHOUSE_PACKAGE:="https://clickhouse-builds.s3.yandex.net/$PR_TO_TEST/$SHA_TO_TEST/clickhouse_build_check/clang-13_relwithdebuginfo_none_bundled_unsplitted_disable_False_binary/clickhouse"}
CLICKHOUSE_REPO_PATH=${CLICKHOUSE_REPO_PATH:=""}
diff --git a/docker/test/performance-comparison/Dockerfile b/docker/test/performance-comparison/Dockerfile
index 1a61c4b274a..88b66d42ecb 100644
--- a/docker/test/performance-comparison/Dockerfile
+++ b/docker/test/performance-comparison/Dockerfile
@@ -1,4 +1,4 @@
-# docker build -t yandex/clickhouse-performance-comparison .
+# docker build -t clickhouse/performance-comparison .
FROM ubuntu:18.04
ENV LANG=C.UTF-8
@@ -54,4 +54,4 @@ COPY * /
# it gives '/bin/sh: 1: [bash,: not found' otherwise.
CMD ["bash", "-c", "node=$((RANDOM % $(numactl --hardware | sed -n 's/^.*available:\\(.*\\)nodes.*$/\\1/p'))); echo Will bind to NUMA node $node; numactl --cpunodebind=$node --membind=$node /entrypoint.sh"]
-# docker run --network=host --volume :/workspace --volume=