Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER DELETE unexpectedly deletes NULL rows #9088

Closed
chu1070y opened this issue Feb 12, 2020 · 8 comments · Fixed by #12153
Closed

ALTER DELETE unexpectedly deletes NULL rows #9088

chu1070y opened this issue Feb 12, 2020 · 8 comments · Fixed by #12153
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release comp-mutations ALTER UPDATE/DELETE comp-nullable Nulls related major

Comments

@chu1070y
Copy link

chu1070y commented Feb 12, 2020

When I delete specific rows, CH also delete NULL rows too.
Is it normal?
How can I control this?

SELECT *
FROM test2

┌──EventDate─┬─CounterID─┬─UserID─┐
│ 2020-01-02 │           │      2 │
│ 2020-01-03 │ aaa       │      0 │
└────────────┴───────────┴────────┘
┌──EventDate─┬─CounterID─┬─UserID─┐
│ 2020-01-02 │           │      2 │
│ 2020-01-02 │           │      2 │
│ 2020-01-02 │ ᴺᵁᴸᴸ      │      2 │
│ 2020-01-03 │ aaa       │      0 │
│ 2020-01-03 │ aaa       │      0 │
│ 2020-01-03 │ aaa       │   ᴺᵁᴸᴸ │
└────────────┴───────────┴────────┘

8 rows in set. Elapsed: 0.002 sec. 


ALTER TABLE test2
    DELETE WHERE UserID = 0


Ok.

0 rows in set. Elapsed: 0.085 sec. 


SELECT *
FROM test2

┌──EventDate─┬─CounterID─┬─UserID─┐
│ 2020-01-02 │           │      2 │
└────────────┴───────────┴────────┘
┌──EventDate─┬─CounterID─┬─UserID─┐
│ 2020-01-02 │           │      2 │
│ 2020-01-02 │           │      2 │
│ 2020-01-02 │ ᴺᵁᴸᴸ      │      2 │
└────────────┴───────────┴────────┘

4 rows in set. Elapsed: 0.002 sec. 
@chu1070y chu1070y added the question Question? label Feb 12, 2020
@4ertus2 4ertus2 added bug Confirmed user-visible misbehaviour in official release and removed question Question? labels Feb 12, 2020
@4ertus2 4ertus2 changed the title When I delete specific rows, CH also delete NULL rows ALTER DELETE unexpectedly deletes NULL rows Feb 12, 2020
@4ertus2
Copy link
Contributor

4ertus2 commented Feb 12, 2020

Could you attach your schema here too?

@den-crane den-crane added st-need-info We need extra data to continue (waiting for response) st-need-repro We were not able to reproduce the problem, please help us. labels Feb 12, 2020
@chu1070y
Copy link
Author

CREATE TABLE default.test2
(
    `EventDate` Date,
    `CounterID` Nullable(String),
    `UserID` Nullable(UInt32)
)
ENGINE = MergeTree()
ORDER BY EventDate;

INSERT INTO test2 VALUES ('2020-01-02', '', 2)('2020-01-03', 'aaa', 0);
INSERT INTO test2 VALUES ('2020-01-02', '', 2)('2020-01-02', '', 2)('2020-01-02', NULL, 2)('2020-01-03', 'aaa', 0)('2020-01-03', 'aaa', 0)('2020-01-03', 'aaa', NULL);

@4ertus2
Copy link
Contributor

4ertus2 commented Feb 13, 2020

Cannot reproduce on master build. Could you update to the last release and reproduce it?

@4ertus2 4ertus2 added obsolete-version and removed st-need-info We need extra data to continue (waiting for response) labels Feb 13, 2020
@den-crane
Copy link
Contributor

den-crane commented Feb 13, 2020

reproduced 19.13.1.11, 19.13.6.51, 19.17.8.54 , 20.1.2, 20.2.1.2343, 20.2.1.2362 -- today nightbuilt

cat t_del.sql

drop table if exists default.test2;

CREATE TABLE default.test2
(
    `EventDate` Date,
    `CounterID` Nullable(String),
    `UserID` Nullable(UInt32)
)
ENGINE = MergeTree()
ORDER BY EventDate;

INSERT INTO default.test2 VALUES ('2020-01-02', '', 2)('2020-01-03', 'aaa', 0);
INSERT INTO default.test2 VALUES ('2020-01-02', '', 2)('2020-01-02', '', 2)('2020-01-02', NULL, 2)('2020-01-03', 'aaa', 0)('2020-01-03', 'aaa', 0)('2020-01-03', 'aaa', NULL);


SELECT * FROM default.test2;
ALTER TABLE default.test2 DELETE WHERE UserID = 0;
select sleep(3) format Null;
select '--------';
SELECT * FROM default.test2;

cat t_del.sql |clickhouse-client -mn

2020-01-02		2
2020-01-02		2
2020-01-02	\N	2
2020-01-03	aaa	0
2020-01-03	aaa	0
2020-01-03	aaa	\N
2020-01-02		2
2020-01-03	aaa	0
--------
2020-01-02		2
2020-01-02		2
2020-01-02		2
2020-01-02	\N	2

@filimonov filimonov added comp-mutations ALTER UPDATE/DELETE v20.1 and removed obsolete-version st-need-repro We were not able to reproduce the problem, please help us. labels Feb 14, 2020
@filimonov
Copy link
Contributor

filimonov commented Apr 8, 2020

Reason:

SELECT 
    UserID, 
    UserID = 0, 
    if(UserID = 0, 'delete', 'leave')
FROM default.test2
FORMAT TSV

2	0	leave
0	1	delete
2	0	leave
2	0	leave
2	0	leave
0	1	delete
0	1	delete
\N	\N	delete

@filimonov
Copy link
Contributor

filimonov commented Apr 8, 2020

Reproduces on 20.4.1 (master).

SELECT arrayJoin([0, 1, 3, NULL]) AS x,  x = 0,  if(x = 0, 'x=0', 'x<>0');

Related #5238
/cc @janplus

@alexey-milovidov
Copy link
Member

SELECT arrayJoin([0, 1, 3, NULL]) AS x, x = 0, if(x = 0, 'x=0', 'x<>0');

@filimonov The query result is totally correct and it does not relate to the issue.

alexey-milovidov pushed a commit that referenced this issue Jul 6, 2020
ALTER DELETE unexpectedly deletes NULL rows
alexey-milovidov added a commit that referenced this issue Jul 6, 2020
@filimonov
Copy link
Contributor

filimonov commented Jul 6, 2020

Are you sure? :) In the recent versions, it's correct... But at the moment of posting it wasn't. And still is not correct in supported 20.1 & 20.3 versions:

Connected to ClickHouse server version 20.3.12 revision 54433.

0d2c584f12cc :) SELECT arrayJoin([0, 1, 3, NULL]) AS x,  x = 0,  if(x = 0, 'x=0', 'x<>0');

SELECT 
    arrayJoin([0, 1, 3, NULL]) AS x, 
    x = 0, 
    if(x = 0, 'x=0', 'x<>0')

┌────x─┬─equals(arrayJoin([0, 1, 3, NULL]), 0)─┬─if(equals(arrayJoin([0, 1, 3, NULL]), 0), 'x=0', 'x<>0')─┐
│    0 │                                     1 │ x=0                                                      │
│    1 │                                     0 │ x<>0                                                     │
│    3 │                                     0 │ x<>0                                                     │
│ ᴺᵁᴸᴸ │                                  ᴺᵁᴸᴸ │ x=0                                                      │
└──────┴───────────────────────────────────────┴──────────────────────────────────────────────────────────┘
Connected to ClickHouse server version 20.4.6 revision 54434.

9cbd2f247232 :) SELECT arrayJoin([0, 1, 3, NULL]) AS x,  x = 0,  if(x = 0, 'x=0', 'x<>0');

SELECT 
    arrayJoin([0, 1, 3, NULL]) AS x, 
    x = 0, 
    if(x = 0, 'x=0', 'x<>0')

┌────x─┬─equals(arrayJoin([0, 1, 3, NULL]), 0)─┬─if(equals(arrayJoin([0, 1, 3, NULL]), 0), 'x=0', 'x<>0')─┐
│    0 │                                     1 │ x=0                                                      │
│    1 │                                     0 │ x<>0                                                     │
│    3 │                                     0 │ x<>0                                                     │
│ ᴺᵁᴸᴸ │                                  ᴺᵁᴸᴸ │ x<>0                                                     │
└──────┴───────────────────────────────────────┴──────────────────────────────────────────────────────────┘

P.S. May be it was fixed in #11807

alexey-milovidov added a commit that referenced this issue Jul 7, 2020
)

* Make topK return Enum for Enum types

* parse metadata in parallel when loading tables

* Fix error

* Fix build

* fixup

* Update ThreadProfileEvents.cpp

* Update browse-code.md (#12047)

* Update browse-code.md

纠正了一些翻译错误。

* Update browse-code.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Bump python-slugify from 1.2.6 to 4.0.1 in /docs/tools

Bumps [python-slugify](https://github.com/un33k/python-slugify) from 1.2.6 to 4.0.1.
- [Release notes](https://github.com/un33k/python-slugify/releases)
- [Changelog](https://github.com/un33k/python-slugify/blob/master/CHANGELOG.md)
- [Commits](un33k/python-slugify@1.2.6...4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update ThreadProfileEvents.cpp

* Update README.md

* Add a test with negative priority in test_distributed_load_balancing

* Fix typo (#12046)

* Fix test_allow_introspection.

* Try fix labda tuple(LC) argument.

* Test image changes

* Try fix labda tuple(LC) argument.

* Add pvs studio to images

* Added test.

* fix low card types in merge join (#12035)

* Update contrib/poco to ClickHouse-Extras/poco #22 (#12037)

* Updated ClickHouse-Extras/poco #22

* Fix defaultValueOfArgumentType

* Added test.

* Update cpu_synthetic.xml

* Moves task shall be started if new storage policy needs them.

* Added test for automatic start of background move task.

* Add ability to run any image version from packager and runner

* Check type of filter for prewhere.

* Check type of filter for prewhere.

* Check type of filter for prewhere.

* Check type of filter for prewhere.

* Added test.

* Try fix pk in tuple performance

Possible approach for fixing #10574

The problem is that prepared sets are built correctly, it is a hash map of key -> set
where key is a hash of AST and list of data types (when we a list of
tuples of literals).

However, when the key is built from the index to try and find if there
exists a prepared set that would match it looks for data types of the
primary key (see how data_types is populated) because the primary key
has only one field (v in my example) it can not find the prepared set.

The patch looks for any prepared indexes where data types match for the
subset of fields found in primary key, we are not interested in other
fields anyway for the purpose of primary key pruning.

* Fix partial revokes (complex cases).

* Changelog for 20.3.11, 12

* simple changelog script

* bump CI

* Fix tests.

* Add explicit test for a case where AST hashes collide for different prepared sets

* [blog] add RSS feed (#12064)

* [blog] add rss feed

* better title

* Update CHANGELOG.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* bump ci

* Moved useless S3 logging to TRACE level.

* Add a test to cover non-const tuple elemenets (just in case)

* Bump

* Update query-complexity.md

Remove a note about read limits applied on threads level.

* Update query-complexity.md

* Update query-complexity.md

* Update query-complexity.md

* DOCS-609: max_server_memory_usage (#11771)

* Revolg DOCSUP-1000 add max server memory usage setting (#125)

* Add max_server_memory_usage setting, delete max_memory_usage_for_all_queries setting.

* Syntax fixed

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Doc for the max_server_memory_usage setting. Updates.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-609: Minor fixes.

* CLICKHOUSEDOCS-609: Actualized position of the setting.

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>

* Add force_primary_key to a pk in tuple test

* DOCS-510: runningAccumulate (#12061)

* asiana21-DOCSUP-797 (#117)

* docs(runningAccumulate): the function description is added

* docs(runningAccumulate): the function description is modified

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(runningAccumulate): some changes

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(runningAccumulate): added ru translation

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-510: Minor fix.

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* CLICKHOUSEDOCS-510: Fixed links.

Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove const specifier to allow auto-move (clangtidy)

* Rewrite Set lookup to make it more readable

* [docs] Sync zh/development/build-osx.md from EN (#12071)

* ISSUES-4006 support first for ALTER ADD|MODIFY COLUMN

* Update deb image

* Don't download image twice

* Remove garbage from images

* bump ci

* Changelog for 20.1, 20.4

* fixup

* DOCS-635: Translated the EN version of the AvroConfluent format description (#11930)

* DOCSUP-1350 (#128)

* edited EN version

* add EN and RU translation

* minor changes

* CLICKHOUSEDOCS-635: Updated the description.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* Fix tests.

* Better PVS image

* DOCS-605: Description for the always_fetch_merged_part setting (#11921)

* Revolg DOCSUP-998 Document the always_fetch_merged_part setting (#123)

* Add always_fetch_merged_part setting

* revolg-DOCSUP-998-add_always_fetch_merged_part_setting link fixed

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Add always_fetch_merged_part setting. Updates.

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Add always_fetch_merged_part setting. Updates.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-605: Minor fixes.

* CLICKHOUSEDOCS-605: Added Plausible to Adopters.

* Update docs/ru/operations/settings/settings.md

Co-authored-by: alesapin <alesapin@gmail.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: alesapin <alesapin@gmail.com>

* CLICKHOUSEDOCS-605: Fixed access rights description.

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: alesapin <alesapin@gmail.com>

* Update Dockerfile

* revert e9d3c48

* [blog] 'Package Repository Behind CDN' post (#12082)

* support iframes from DataLens

* initial blog post text

* Improve REVOKE command: now it requires only grant/admin option for only
access which will be revoked.
REVOKE ALL FROM user1 now revokes all granted roles.

* Fix limiting the number of threads for VIEW.

* Update tips.md

* Added test.

* Remove pvs studio from images list

* Better shutdown and conversion

* Reverse arguments

* Fix result_rows and result_bytes metrics for selects.

* Fix result_rows and result_bytes metrics for selects.

* improve breadcrumbs markup

* Fix tests.

* fix segfault with -StateResample combinators

* Less race conditions

* fix test with buffer table

* [docker] install ca-certificates before the first apt-get update (#12095)

* [docker] install ca-certificates before first apt-get update

* Update Dockerfile

* DOCS-522: max_parser_depth (#12097)

* asiana21-DOCSUP-925-max_parser_depth (#132)

* docs(max_parser_depth): added the setting description

* docs(max_parser_depth): some changes

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(max_parser_depth): added ru translation

* docs(max_parser_depth): removed quotation marks

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-522: Fixed the link.

Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>

* Rewrite curl dependency in a more ch compatible way

- add support of unbundled curl
- add CURL::libcurl libraries
- avoid explicit linkage of daemon with curl (added with sentry)
- set CACHE variables for non-direct users:
  - mariadb-connector-c
  - aws-s3-cmake
  - sentry-native

Cc: @alexey-milovidov
Cc: @alesapin (requires docker image update)
Cc: @abyss7

Refs: #11300
Refs: #8011
Refs: #8905

v2: replace cmake/find/curl.cmake with proper contrib/curl-cmake (as
pointed by @abyss7, cmake/find/*.cmake is deprecated)

* Added results for AWS Lightsail

* (typo) in doc (#12099)

* Update polymorphic_parts_l.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_s.xml

* kafka: fix SIGSEGV on DROP TABLE

After #11599 it is possible that messages of the
ReadBufferFromKafkaConsumer will be cleaned-up right in
read_kafka_message callback (from KafkaBlockInputStream) if the stop
flag isset (i.e. DROP TABLE is waiting the consumer), and if
read_kafka_message already processed some rows it will not return 0 and
the loop after will try to get current topic from the buffer, which uses
messages in the underlying and this will got SIGSEGV:

    12:14:56.173262 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Debug> executeQuery: (from 0.0.0.0:0, user: ) DROP TABLE IF EXISTS data.queue
    12:14:56.173285 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Trace> StorageKafka (newly_queue): Waiting for cleanup
    12:14:56.180016 [ 55390 ] {} <Trace> BaseDaemon: Received signal 11
    12:14:56.180267 [ 4914 ] {} <Fatal> BaseDaemon: ########################################
    12:14:56.181879 [ 4914 ] {} <Fatal> BaseDaemon: (version 20.6.1.1, build id: 4CE0298F08583658) (from thread 55468) (no query) Received signal Segmentation fault (11)
    12:14:56.181900 [ 4914 ] {} <Fatal> BaseDaemon: Address: 0x8 Access: read. Address not mapped to object.
    12:14:56.181909 [ 4914 ] {} <Fatal> BaseDaemon: Stack trace:
    12:14:56.184676 [ 4914 ] {} <Fatal> BaseDaemon: 3. /ch/contrib/cppkafka/include/cppkafka/message.h:111: DB::KafkaBlockInputStream::readImpl() @ 0xe343f1c in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.185553 [ 4914 ] {} <Fatal> BaseDaemon: 4. /ch/contrib/libcxx/include/vector:1003: DB::IBlockInputStream::read() @ 0xd9d95bd in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188238 [ 4914 ] {} <Fatal> BaseDaemon: 5. /ch/src/DataStreams/copyData.cpp:26: DB::copyData() @ 0xd9f712a in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188780 [ 4914 ] {} <Fatal> BaseDaemon: 6. /ch/contrib/libcxx/include/vector:1532: DB::StorageKafka::streamToViews() @ 0xe335e73 in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.189331 [ 4914 ] {} <Fatal> BaseDaemon: 7. /ch/src/Storages/Kafka/StorageKafka.cpp:491: DB::StorageKafka::threadFunc() @ 0xe336738 in /usr/lib/debug/usr/bin/clickhouse

55421 thread (shows that it still waiting for deactivation):

    5  std::__1::lock_guard<>::lock_guard () at ../contrib/libcxx/include/__mutex_base:90
    6  DB::BackgroundSchedulePoolTaskInfo::deactivate (this=0x7fc7e4465f20) at ../src/Core/BackgroundSchedulePool.cpp:59
    7  DB::StorageKafka::shutdown (this=0x7fc7e45e4600) at ../contrib/libcxx/include/memory:3821

And just in case thread where read_kafka_message is called:

    0  DB::ReadBufferFromKafkaConsumer::nextImpl (this=0x7fd4901d4118) at ../contrib/libcxx/include/atomic:1491
    1  DB::ReadBuffer::next (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:59
    2  DB::ReadBuffer::eof (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:81
    3  DB::skipWhitespaceIfAny (buf=...) at ../src/IO/ReadHelpers.h:945
    4  DB::JSONEachRowRowInputFormat::readRow (ext=..., columns=..., this=0x7fd499a7a020) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:222
    5  DB::JSONEachRowRowInputFormat::readRow (this=0x7fd499a7a020, columns=..., ext=...) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:218
    6  DB::IRowInputFormat::generate (this=0x7fd499a7a020) at ../src/Processors/Formats/IRowInputFormat.cpp:64
    7  DB::ISource::work (this=0x7fd499a7a020) at ../src/Processors/ISource.cpp:48
    8  DB::KafkaBlockInputStream::<lambda()>::operator()(void) const () at ../contrib/libcxx/include/memory:3826
    9  DB::KafkaBlockInputStream::readImpl (this=0x7fd46e718820) at ../contrib/libcxx/include/new:340

Cc: @filimonov

* kafka: check that the data is still usable after parsing

* kafka: improve logging during engine shutdown

This will help with tracking possible issues, when you need to know was
buffer released or not.

* kafka: avoid superior polling after DROP/DETACH TABLE

Before this patch isStalled() was checked before polledDataUnusable(),
and after DROP TABLE isStalled() == true (although this looks tricky).

* kafka: remove outdated comment

As stated by @filimonov it is not relevant (after #11599)

* Added test.

* Create codeql-analysis.yml

* Tiny fixes

* Create anchore-analysis.yml

* Update polymorphic_parts_s.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_l.xml

* Changelog for 20.5

* Update CHANGELOG.md

* Update README.md

* Fix test (#12088)

* Test for a fixed issue #10668, related to input_format_allow_errors_num in CSV

* Add unbundled mode flag

* Remove LC converting to Arrow.

* Remove LC converting to Arrow.

* Move skip lists to clickhouse-test

* Remove LC converting to Arrow.

* More verbose message about skip

* Make skip-list optional

* Added test.

* Add type column in system.disks

* Update clickhouse-test

* Fix handling dependency of table with ENGINE=Dictionary on dictionary.

* Add test.

* Update 01355_CSV_input_format_allow_errors.sh

* Update CHANGELOG.md

* Added a showcase of minimal Docker image

* Added a comment

* Added a comment

* Added a comment

* Formatting

* contrib/unixodbc-cmake: Fix build when UNBUNDLED

target_compile_definitions may only set INTERFACE properties on IMPORTED targets

* Fix version column in replicated version collapsing merge tree (#12121)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Whitespace

* Style

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update array-functions.md (#12130)

修改编码错误

* Update array-functions.md (#12129)

修改编码错误

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: Alexander Tokmakov <avtokmakov@yandex-team.ru>
Co-authored-by: kssenii <sumarokovakseniia@mail.ru>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: chengy8934 <67622393+chengy8934@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: MicrochipQ <microchipq@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
Co-authored-by: Nicolae Vartolomei <me@nvartolomei.com>
Co-authored-by: filimonov <1549571+filimonov@users.noreply.github.com>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: zhang2014 <coswde@gmail.com>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: manmitya <30998567+manmitya@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <KochetovNicolai@users.noreply.github.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
Co-authored-by: tavplubix <tavplubix@gmail.com>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix "Arcadia" build

Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* Fix "Arcadia" build

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
…injective functions elimination (#12366)

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Update README.md

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
…resident memory (#12367)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Update README.md

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
* kafka: check that the data is still usable after parsing

* kafka: improve logging during engine shutdown

This will help with tracking possible issues, when you need to know was
buffer released or not.

* kafka: avoid superior polling after DROP/DETACH TABLE

Before this patch isStalled() was checked before polledDataUnusable(),
and after DROP TABLE isStalled() == true (although this looks tricky).

* kafka: remove outdated comment

As stated by @filimonov it is not relevant (after #11599)

* Added test.

* Create codeql-analysis.yml

* Tiny fixes

* Create anchore-analysis.yml

* Update polymorphic_parts_s.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_l.xml

* Changelog for 20.5

* Update CHANGELOG.md

* Update README.md

* Fix test (#12088)

* Test for a fixed issue #10668, related to input_format_allow_errors_num in CSV

* Add unbundled mode flag

* Remove LC converting to Arrow.

* Remove LC converting to Arrow.

* Move skip lists to clickhouse-test

* Remove LC converting to Arrow.

* More verbose message about skip

* Make skip-list optional

* Added test.

* Create initializeAggregation to initialize an aggregation function based on a value

* Add type column in system.disks

* Update clickhouse-test

* fix test with UBSan

* Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

* Fix handling dependency of table with ENGINE=Dictionary on dictionary.

* Add test.

* Update 01355_CSV_input_format_allow_errors.sh

* Update CHANGELOG.md

* Update Dockerfile

* Added a showcase of minimal Docker image

* Added a comment

* Added a comment

* Added a comment

* Formatting

* contrib/unixodbc-cmake: Fix build when UNBUNDLED

target_compile_definitions may only set INTERFACE properties on IMPORTED targets

* Fix version column in replicated version collapsing merge tree (#12121)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* split

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* No color

* throw exception on redirect limit in S3 request

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* Rename ident to indent.

* Fix minor issues after #12196

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Non-significant changes

* Update README.md

* Update int_parsing.xml

* Update build.sh

* Update packager

* Hide nonzero error code on testflows runner

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: Nikolai Kochetov <KochetovNicolai@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: tavplubix <tavplubix@gmail.com>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
* kafka: remove outdated comment

As stated by @filimonov it is not relevant (after #11599)

* Added test.

* Create codeql-analysis.yml

* Tiny fixes

* Create anchore-analysis.yml

* Update polymorphic_parts_s.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_l.xml

* Changelog for 20.5

* Update CHANGELOG.md

* Update README.md

* Fix test (#12088)

* Test for a fixed issue #10668, related to input_format_allow_errors_num in CSV

* Add unbundled mode flag

* Remove LC converting to Arrow.

* Remove LC converting to Arrow.

* Move skip lists to clickhouse-test

* Remove LC converting to Arrow.

* More verbose message about skip

* Make skip-list optional

* Added test.

* Create initializeAggregation to initialize an aggregation function based on a value

* Add type column in system.disks

* Update clickhouse-test

* fix test with UBSan

* Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

* Fix handling dependency of table with ENGINE=Dictionary on dictionary.

* Add test.

* Update 01355_CSV_input_format_allow_errors.sh

* Update CHANGELOG.md

* Update Dockerfile

* Added a showcase of minimal Docker image

* Added a comment

* Added a comment

* Added a comment

* Formatting

* contrib/unixodbc-cmake: Fix build when UNBUNDLED

target_compile_definitions may only set INTERFACE properties on IMPORTED targets

* Fix version column in replicated version collapsing merge tree (#12121)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* split

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* No color

* throw exception on redirect limit in S3 request

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* Rename ident to indent.

* Fix minor issues after #12196

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Update int_parsing.xml

* Update build.sh

* Update packager

* Hide nonzero error code on testflows runner

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: Nikolai Kochetov <KochetovNicolai@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: tavplubix <tavplubix@gmail.com>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
alesapin added a commit that referenced this issue Jul 10, 2020
…est (#12369)

* fix test with buffer table

* Adding a template of the SRS with the notes how to use it.

* Small changes to the SRS template.

* Removing unnecessary text.

* Fix small typo.

* [docker] install ca-certificates before the first apt-get update (#12095)

* [docker] install ca-certificates before first apt-get update

* Update Dockerfile

* DOCS-522: max_parser_depth (#12097)

* asiana21-DOCSUP-925-max_parser_depth (#132)

* docs(max_parser_depth): added the setting description

* docs(max_parser_depth): some changes

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(max_parser_depth): added ru translation

* docs(max_parser_depth): removed quotation marks

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-522: Fixed the link.

Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>

* Rewrite curl dependency in a more ch compatible way

- add support of unbundled curl
- add CURL::libcurl libraries
- avoid explicit linkage of daemon with curl (added with sentry)
- set CACHE variables for non-direct users:
  - mariadb-connector-c
  - aws-s3-cmake
  - sentry-native

Cc: @alexey-milovidov
Cc: @alesapin (requires docker image update)
Cc: @abyss7

Refs: #11300
Refs: #8011
Refs: #8905

v2: replace cmake/find/curl.cmake with proper contrib/curl-cmake (as
pointed by @abyss7, cmake/find/*.cmake is deprecated)

* Added results for AWS Lightsail

* (typo) in doc (#12099)

* Update polymorphic_parts_l.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_s.xml

* kafka: fix SIGSEGV on DROP TABLE

After #11599 it is possible that messages of the
ReadBufferFromKafkaConsumer will be cleaned-up right in
read_kafka_message callback (from KafkaBlockInputStream) if the stop
flag isset (i.e. DROP TABLE is waiting the consumer), and if
read_kafka_message already processed some rows it will not return 0 and
the loop after will try to get current topic from the buffer, which uses
messages in the underlying and this will got SIGSEGV:

    12:14:56.173262 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Debug> executeQuery: (from 0.0.0.0:0, user: ) DROP TABLE IF EXISTS data.queue
    12:14:56.173285 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Trace> StorageKafka (newly_queue): Waiting for cleanup
    12:14:56.180016 [ 55390 ] {} <Trace> BaseDaemon: Received signal 11
    12:14:56.180267 [ 4914 ] {} <Fatal> BaseDaemon: ########################################
    12:14:56.181879 [ 4914 ] {} <Fatal> BaseDaemon: (version 20.6.1.1, build id: 4CE0298F08583658) (from thread 55468) (no query) Received signal Segmentation fault (11)
    12:14:56.181900 [ 4914 ] {} <Fatal> BaseDaemon: Address: 0x8 Access: read. Address not mapped to object.
    12:14:56.181909 [ 4914 ] {} <Fatal> BaseDaemon: Stack trace:
    12:14:56.184676 [ 4914 ] {} <Fatal> BaseDaemon: 3. /ch/contrib/cppkafka/include/cppkafka/message.h:111: DB::KafkaBlockInputStream::readImpl() @ 0xe343f1c in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.185553 [ 4914 ] {} <Fatal> BaseDaemon: 4. /ch/contrib/libcxx/include/vector:1003: DB::IBlockInputStream::read() @ 0xd9d95bd in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188238 [ 4914 ] {} <Fatal> BaseDaemon: 5. /ch/src/DataStreams/copyData.cpp:26: DB::copyData() @ 0xd9f712a in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188780 [ 4914 ] {} <Fatal> BaseDaemon: 6. /ch/contrib/libcxx/include/vector:1532: DB::StorageKafka::streamToViews() @ 0xe335e73 in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.189331 [ 4914 ] {} <Fatal> BaseDaemon: 7. /ch/src/Storages/Kafka/StorageKafka.cpp:491: DB::StorageKafka::threadFunc() @ 0xe336738 in /usr/lib/debug/usr/bin/clickhouse

55421 thread (shows that it still waiting for deactivation):

    5  std::__1::lock_guard<>::lock_guard () at ../contrib/libcxx/include/__mutex_base:90
    6  DB::BackgroundSchedulePoolTaskInfo::deactivate (this=0x7fc7e4465f20) at ../src/Core/BackgroundSchedulePool.cpp:59
    7  DB::StorageKafka::shutdown (this=0x7fc7e45e4600) at ../contrib/libcxx/include/memory:3821

And just in case thread where read_kafka_message is called:

    0  DB::ReadBufferFromKafkaConsumer::nextImpl (this=0x7fd4901d4118) at ../contrib/libcxx/include/atomic:1491
    1  DB::ReadBuffer::next (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:59
    2  DB::ReadBuffer::eof (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:81
    3  DB::skipWhitespaceIfAny (buf=...) at ../src/IO/ReadHelpers.h:945
    4  DB::JSONEachRowRowInputFormat::readRow (ext=..., columns=..., this=0x7fd499a7a020) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:222
    5  DB::JSONEachRowRowInputFormat::readRow (this=0x7fd499a7a020, columns=..., ext=...) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:218
    6  DB::IRowInputFormat::generate (this=0x7fd499a7a020) at ../src/Processors/Formats/IRowInputFormat.cpp:64
    7  DB::ISource::work (this=0x7fd499a7a020) at ../src/Processors/ISource.cpp:48
    8  DB::KafkaBlockInputStream::<lambda()>::operator()(void) const () at ../contrib/libcxx/include/memory:3826
    9  DB::KafkaBlockInputStream::readImpl (this=0x7fd46e718820) at ../contrib/libcxx/include/new:340

Cc: @filimonov

* kafka: check that the data is still usable after parsing

* kafka: improve logging during engine shutdown

This will help with tracking possible issues, when you need to know was
buffer released or not.

* kafka: avoid superior polling after DROP/DETACH TABLE

Before this patch isStalled() was checked before polledDataUnusable(),
and after DROP TABLE isStalled() == true (although this looks tricky).

* kafka: remove outdated comment

As stated by @filimonov it is not relevant (after #11599)

* Added test.

* Create codeql-analysis.yml

* Tiny fixes

* Create anchore-analysis.yml

* Update polymorphic_parts_s.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_l.xml

* Changelog for 20.5

* Update CHANGELOG.md

* Update README.md

* Fix test (#12088)

* Test for a fixed issue #10668, related to input_format_allow_errors_num in CSV

* Add unbundled mode flag

* Remove LC converting to Arrow.

* Remove LC converting to Arrow.

* Move skip lists to clickhouse-test

* Remove LC converting to Arrow.

* More verbose message about skip

* Make skip-list optional

* Added test.

* Create initializeAggregation to initialize an aggregation function based on a value

* Add type column in system.disks

* Update clickhouse-test

* fix test with UBSan

* Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

* Fix handling dependency of table with ENGINE=Dictionary on dictionary.

* Add test.

* Update 01355_CSV_input_format_allow_errors.sh

* Update CHANGELOG.md

* Update Dockerfile

* Added a showcase of minimal Docker image

* Added a comment

* Added a comment

* Added a comment

* Formatting

* contrib/unixodbc-cmake: Fix build when UNBUNDLED

target_compile_definitions may only set INTERFACE properties on IMPORTED targets

* Fix version column in replicated version collapsing merge tree (#12121)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* split

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* No color

* throw exception on redirect limit in S3 request

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* Rename ident to indent.

* Fix minor issues after #12196

* Whitespace

* Update test

* Add documentation for arrayFill

* Non-significant changes

* Update README.md

Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: Vitaliy Zakaznikov <vzakaznikov@altinity.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: manmitya <30998567+manmitya@users.noreply.github.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: Nikolai Kochetov <KochetovNicolai@users.noreply.github.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: tavplubix <tavplubix@gmail.com>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
alesapin added a commit that referenced this issue Jul 10, 2020
* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* fix TTL after renaming column

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* Fix "Arcadia" build

* DOCS-679: netloc function (#12321)

* DOCSUP-1377 (netloc function) (#135)

* add EN description

* changes in query

* changes after review

* add RU description

* CLICKHOUSEDOCS-679: Text fixes.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
alesapin added a commit that referenced this issue Jul 10, 2020
#12259)

* simple changelog script

* bump CI

* Fix tests.

* Add explicit test for a case where AST hashes collide for different prepared sets

* [blog] add RSS feed (#12064)

* [blog] add rss feed

* better title

* Update CHANGELOG.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* bump ci

* Moved useless S3 logging to TRACE level.

* Add a test to cover non-const tuple elemenets (just in case)

* Bump

* Update query-complexity.md

Remove a note about read limits applied on threads level.

* Update query-complexity.md

* Update query-complexity.md

* Update query-complexity.md

* DOCS-609: max_server_memory_usage (#11771)

* Revolg DOCSUP-1000 add max server memory usage setting (#125)

* Add max_server_memory_usage setting, delete max_memory_usage_for_all_queries setting.

* Syntax fixed

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Doc for the max_server_memory_usage setting. Updates.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-609: Minor fixes.

* CLICKHOUSEDOCS-609: Actualized position of the setting.

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>

* Add force_primary_key to a pk in tuple test

* DOCS-510: runningAccumulate (#12061)

* asiana21-DOCSUP-797 (#117)

* docs(runningAccumulate): the function description is added

* docs(runningAccumulate): the function description is modified

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(runningAccumulate): some changes

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(runningAccumulate): added ru translation

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-510: Minor fix.

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* CLICKHOUSEDOCS-510: Fixed links.

Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove const specifier to allow auto-move (clangtidy)

* Rewrite Set lookup to make it more readable

* [docs] Sync zh/development/build-osx.md from EN (#12071)

* ISSUES-4006 support first for ALTER ADD|MODIFY COLUMN

* Update deb image

* Don't download image twice

* Remove garbage from images

* bump ci

* Changelog for 20.1, 20.4

* fixup

* DOCS-635: Translated the EN version of the AvroConfluent format description (#11930)

* DOCSUP-1350 (#128)

* edited EN version

* add EN and RU translation

* minor changes

* CLICKHOUSEDOCS-635: Updated the description.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* Fix tests.

* Better PVS image

* DOCS-605: Description for the always_fetch_merged_part setting (#11921)

* Revolg DOCSUP-998 Document the always_fetch_merged_part setting (#123)

* Add always_fetch_merged_part setting

* revolg-DOCSUP-998-add_always_fetch_merged_part_setting link fixed

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Add always_fetch_merged_part setting. Updates.

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Add always_fetch_merged_part setting. Updates.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-605: Minor fixes.

* CLICKHOUSEDOCS-605: Added Plausible to Adopters.

* Update docs/ru/operations/settings/settings.md

Co-authored-by: alesapin <alesapin@gmail.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: alesapin <alesapin@gmail.com>

* CLICKHOUSEDOCS-605: Fixed access rights description.

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: alesapin <alesapin@gmail.com>

* Update Dockerfile

* revert e9d3c48

* [blog] 'Package Repository Behind CDN' post (#12082)

* support iframes from DataLens

* initial blog post text

* Improve REVOKE command: now it requires only grant/admin option for only
access which will be revoked.
REVOKE ALL FROM user1 now revokes all granted roles.

* Fix limiting the number of threads for VIEW.

* Update tips.md

* Added test.

* Remove pvs studio from images list

* Better shutdown and conversion

* Reverse arguments

* Fix result_rows and result_bytes metrics for selects.

* Fix result_rows and result_bytes metrics for selects.

* improve breadcrumbs markup

* Fix tests.

* fix segfault with -StateResample combinators

* Less race conditions

* fix test with buffer table

* [docker] install ca-certificates before the first apt-get update (#12095)

* [docker] install ca-certificates before first apt-get update

* Update Dockerfile

* DOCS-522: max_parser_depth (#12097)

* asiana21-DOCSUP-925-max_parser_depth (#132)

* docs(max_parser_depth): added the setting description

* docs(max_parser_depth): some changes

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/operations/settings/settings.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* docs(max_parser_depth): added ru translation

* docs(max_parser_depth): removed quotation marks

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-522: Fixed the link.

Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>

* Rewrite curl dependency in a more ch compatible way

- add support of unbundled curl
- add CURL::libcurl libraries
- avoid explicit linkage of daemon with curl (added with sentry)
- set CACHE variables for non-direct users:
  - mariadb-connector-c
  - aws-s3-cmake
  - sentry-native

Cc: @alexey-milovidov
Cc: @alesapin (requires docker image update)
Cc: @abyss7

Refs: #11300
Refs: #8011
Refs: #8905

v2: replace cmake/find/curl.cmake with proper contrib/curl-cmake (as
pointed by @abyss7, cmake/find/*.cmake is deprecated)

* Added results for AWS Lightsail

* (typo) in doc (#12099)

* Update polymorphic_parts_l.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_s.xml

* kafka: fix SIGSEGV on DROP TABLE

After #11599 it is possible that messages of the
ReadBufferFromKafkaConsumer will be cleaned-up right in
read_kafka_message callback (from KafkaBlockInputStream) if the stop
flag isset (i.e. DROP TABLE is waiting the consumer), and if
read_kafka_message already processed some rows it will not return 0 and
the loop after will try to get current topic from the buffer, which uses
messages in the underlying and this will got SIGSEGV:

    12:14:56.173262 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Debug> executeQuery: (from 0.0.0.0:0, user: ) DROP TABLE IF EXISTS data.queue
    12:14:56.173285 [ 55421 ] {f7930856-d478-4e41-af56-24ce7b693e95} <Trace> StorageKafka (newly_queue): Waiting for cleanup
    12:14:56.180016 [ 55390 ] {} <Trace> BaseDaemon: Received signal 11
    12:14:56.180267 [ 4914 ] {} <Fatal> BaseDaemon: ########################################
    12:14:56.181879 [ 4914 ] {} <Fatal> BaseDaemon: (version 20.6.1.1, build id: 4CE0298F08583658) (from thread 55468) (no query) Received signal Segmentation fault (11)
    12:14:56.181900 [ 4914 ] {} <Fatal> BaseDaemon: Address: 0x8 Access: read. Address not mapped to object.
    12:14:56.181909 [ 4914 ] {} <Fatal> BaseDaemon: Stack trace:
    12:14:56.184676 [ 4914 ] {} <Fatal> BaseDaemon: 3. /ch/contrib/cppkafka/include/cppkafka/message.h:111: DB::KafkaBlockInputStream::readImpl() @ 0xe343f1c in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.185553 [ 4914 ] {} <Fatal> BaseDaemon: 4. /ch/contrib/libcxx/include/vector:1003: DB::IBlockInputStream::read() @ 0xd9d95bd in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188238 [ 4914 ] {} <Fatal> BaseDaemon: 5. /ch/src/DataStreams/copyData.cpp:26: DB::copyData() @ 0xd9f712a in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.188780 [ 4914 ] {} <Fatal> BaseDaemon: 6. /ch/contrib/libcxx/include/vector:1532: DB::StorageKafka::streamToViews() @ 0xe335e73 in /usr/lib/debug/usr/bin/clickhouse
    12:14:56.189331 [ 4914 ] {} <Fatal> BaseDaemon: 7. /ch/src/Storages/Kafka/StorageKafka.cpp:491: DB::StorageKafka::threadFunc() @ 0xe336738 in /usr/lib/debug/usr/bin/clickhouse

55421 thread (shows that it still waiting for deactivation):

    5  std::__1::lock_guard<>::lock_guard () at ../contrib/libcxx/include/__mutex_base:90
    6  DB::BackgroundSchedulePoolTaskInfo::deactivate (this=0x7fc7e4465f20) at ../src/Core/BackgroundSchedulePool.cpp:59
    7  DB::StorageKafka::shutdown (this=0x7fc7e45e4600) at ../contrib/libcxx/include/memory:3821

And just in case thread where read_kafka_message is called:

    0  DB::ReadBufferFromKafkaConsumer::nextImpl (this=0x7fd4901d4118) at ../contrib/libcxx/include/atomic:1491
    1  DB::ReadBuffer::next (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:59
    2  DB::ReadBuffer::eof (this=0x7fd4901d4118) at ../src/IO/ReadBuffer.h:81
    3  DB::skipWhitespaceIfAny (buf=...) at ../src/IO/ReadHelpers.h:945
    4  DB::JSONEachRowRowInputFormat::readRow (ext=..., columns=..., this=0x7fd499a7a020) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:222
    5  DB::JSONEachRowRowInputFormat::readRow (this=0x7fd499a7a020, columns=..., ext=...) at ../src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp:218
    6  DB::IRowInputFormat::generate (this=0x7fd499a7a020) at ../src/Processors/Formats/IRowInputFormat.cpp:64
    7  DB::ISource::work (this=0x7fd499a7a020) at ../src/Processors/ISource.cpp:48
    8  DB::KafkaBlockInputStream::<lambda()>::operator()(void) const () at ../contrib/libcxx/include/memory:3826
    9  DB::KafkaBlockInputStream::readImpl (this=0x7fd46e718820) at ../contrib/libcxx/include/new:340

Cc: @filimonov

* kafka: check that the data is still usable after parsing

* kafka: improve logging during engine shutdown

This will help with tracking possible issues, when you need to know was
buffer released or not.

* kafka: avoid superior polling after DROP/DETACH TABLE

Before this patch isStalled() was checked before polledDataUnusable(),
and after DROP TABLE isStalled() == true (although this looks tricky).

* kafka: remove outdated comment

As stated by @filimonov it is not relevant (after #11599)

* Added test.

* Create codeql-analysis.yml

* Tiny fixes

* Create anchore-analysis.yml

* Update polymorphic_parts_s.xml

* Update polymorphic_parts_m.xml

* Update polymorphic_parts_l.xml

* Changelog for 20.5

* Update CHANGELOG.md

* Update README.md

* Fix test (#12088)

* Test for a fixed issue #10668, related to input_format_allow_errors_num in CSV

* Add unbundled mode flag

* Remove LC converting to Arrow.

* Remove LC converting to Arrow.

* Move skip lists to clickhouse-test

* Remove LC converting to Arrow.

* More verbose message about skip

* Make skip-list optional

* Added test.

* Create initializeAggregation to initialize an aggregation function based on a value

* Add type column in system.disks

* Update clickhouse-test

* fix test with UBSan

* Add missing query context for system logs

Needed to allow attaching materialized views with joins or with
subqueries to system.logs.

* Fix handling dependency of table with ENGINE=Dictionary on dictionary.

* Add test.

* Update 01355_CSV_input_format_allow_errors.sh

* Update CHANGELOG.md

* Update Dockerfile

* Added a showcase of minimal Docker image

* Added a comment

* Added a comment

* Added a comment

* Formatting

* contrib/unixodbc-cmake: Fix build when UNBUNDLED

target_compile_definitions may only set INTERFACE properties on IMPORTED targets

* Fix version column in replicated version collapsing merge tree (#12121)

* poco-cmake: Fix Poco::Data::ODBC target when UNBUNDLED

By default IMPORTED target has a scope in the directory in which it is created
and below. This leads to the following issues when building UNBUNDLED:

Target "clickhouse" links to target "Poco::Data::ODBC" but the target was not
found.  Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

* Add missed <atomic> include in ProxyListConfiguration

* Improve performace of reading in order of sorting key. (#11696)

* simplify reading in order of sorting key

* add perf test for reading many parts

* Revert "simplify reading in order of sorting key"

This reverts commit 7267d7c.

* add threshold for preliminary merge for reading in order

* better threshold

* limit threads in test

* Do not enable sentry if ENABLE_LIBRARIES is not set

* Fail if curl library was enabled and was not found in case of unbundled build

* Normalize "pid" file handling #3501

* Update StatusFile.cpp

* New ISO8601 year modificators for formatDateTime

* Added a test

* Include libcurl4-openssl-dev into yandex/clickhouse-deb-builder

* Remove harmful code from "geoDistance" #12117

* Update formatDateTime.cpp

* Fix warnings from CodeQL

* Added a test

* Minor modification

* Update libdivide to the latest master

* Replace exit to abort in libdivide

* Fix potential overflow in integer division #12119

* Added a test

* Whitespace

* Added a test for #4211

* Attempt to fix "Arcadia" build

* Rename test

* Update arraySum.cpp

* Run perf tests with memory sampling (for allocations >1M)

This is to know the memory allocation size distribution, that can be
obtained later from left-metric-log.tsv.

This is an attempt to tune tcmalloc (new CPP version by google) to use
lock-free part of the allocator for typical allocations (and it is a bad
idea just to increase kMaxSize there, since number of allocation for
each size class is also important).

P.S. hope that this file will be applied, if no, then the same effect
can be reached by tunning defaults in Settings.h

Refs: #11590
Cc: @akuzm

* Make code clearer: use enum instead of `bool internal`.

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* Same change for Kafka - just in case, and to make it conform.

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: Nicolae Vartolomei <me@nvartolomei.com>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
Co-authored-by: filimonov <1549571+filimonov@users.noreply.github.com>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: zhang2014 <coswde@gmail.com>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: manmitya <30998567+manmitya@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <KochetovNicolai@users.noreply.github.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: tavplubix <tavplubix@gmail.com>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Co-authored-by: vivarum <vivarum.msk@yandex.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
alexey-milovidov added a commit that referenced this issue Jul 10, 2020
…ue (#12385)

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* fix TTL after renaming column

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* fix order of columns in WITH FILL modifier

* Fix "Arcadia" build

* Log sanitizer trap messages from separate thread

* Revert strange file

* Tested with "trap" function

* Support MySQL 'SELECT DATABASE()' query replacement

* Fix race condition in ReplicatedMergeTreeQueue

* Set CMAKE_POLICY_DEFAULT_CMP0022/CMAKE_POLICY_DEFAULT_CMP0077 globally

This will fix CMAKE_POLICY_DEFAULT_CMP0077 for snappy:

    CMake Warning (dev) at contrib/snappy/CMakeLists.txt:11 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run
    "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy
    command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Update config.h for arrow

Yes ARROW_FULL_SO_VERSION/ARROW_SO_VERSION is empty right now, like
other version variables (ARROW_VERSION_*)

Refs: #12181

* Fix jemalloc enabled detection (should goes after contrib inclusion)

* Warn if jemalloc is not enabled for non-linux too

Refs: #11897 (osx)
Refs: #11774 (freebsd)

* DOCS-679: netloc function (#12321)

* DOCSUP-1377 (netloc function) (#135)

* add EN description

* changes in query

* changes after review

* add RU description

* CLICKHOUSEDOCS-679: Text fixes.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* add docker image for fuzzer

* fixes in fuzzer docker image

* [docs] engine family introduction refactoring (#12268)

* base refactoring

* adjust links

* Update index.md

* Implemented single part uploads for DiskS3 (#12026)

* Implemented single part uploads for DiskS3.
* Added `min_multi_part_upload_size` to disk configuration.

* Rename test 01378

* Add integration test for mysql replacement query

* Fix obvious race condition in test

* [docs] split various kinds of CREATE queries into separate articles (#12328)

* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2

* reset contribs

* Update skip_list.json

* fuzzer container fix

* fuzzer docker image

* Fix error

* Miscellaneous

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
CurtizJ added a commit that referenced this issue Jul 10, 2020
…12375)

* Update StorageDictionary.h

* Update StorageDictionary.h

* ILIKE operator (#12125)

* Integrated CachingAllocator into MarkCache

* fixed build errors

* reset func hotfix

* upd: Fixing build

* updated submodules links

* fix 2

* updating grabber allocator proto

* updating lost work

* updating CMake to use concepts

* some other changes to get it building (integration into MarkCache)

* further integration into caches

* updated Async metrics, fixed some build errors

* and some other errors revealing

* added perfect forwarding to some functions

* fix: forward template

* fix: constexpr modifier

* fix: FakePODAllocator missing member func

* updated PODArray constructor taking alloc params

* fix: PODArray overload with n restored

* fix: FakePODAlloc duplicating alloc() func

* added constexpr variable for alloc_tag_t

* split cache values by allocators, provided updates

* fix: memcpy

* fix: constexpr modifier

* fix: noexcept modifier

* fix: alloc_tag_t for PODArray constructor

* fix: PODArray copy ctor with different alloc

* fix: resize() signature

* updating to lastest working master

* syncing with 273267

* first draft version

* fix: update Searcher to case-insensitive

* added ILIKE test

* fixed style errors, updated test, split like and ilike,  added notILike

* replaced inconsistent comments

* fixed show tables ilike

* updated missing test cases

* regenerated ya.make

* Update 01355_ilike.sql

Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Update SortDescription.h

* Update AggregateDescription.cpp

* add parseDateTimeBestEffortUS function (#12028)

* add function parseDateTimeBestEffortUS
* add test
* add doc

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>

* Cleanup changelog (half done). Now it is acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Now it is more acceptable #12104

* Cleanup changelog (half done). Additions requested by @filimonov #12104

* Remove underscore as word-break character. This partially reverts #11975

* Fix bad test number

* Added a test

* Change exception code from LOGICAL_ERROR to BAD_ARGUMENTS when the name of remote table is empty

* fix segfault with -StateResample combinators

* Fix bad code in redundant ORDER BY optimization #10067

* Add a test

* Support KILL QUERY [connection_id] for MySQL

* Fix error

* Autocomplete does not have to work in "Unbundled" build

* Fix transform query for external databases in presense of aliases #12032

* Whitespace

* Add MySQL to ClickHouse query replacement mapping table

* Style

* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* fix TTL after renaming column

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* fix order of columns in WITH FILL modifier

* Fix "Arcadia" build

* Log sanitizer trap messages from separate thread

* Revert strange file

* Tested with "trap" function

* Set CMAKE_POLICY_DEFAULT_CMP0022/CMAKE_POLICY_DEFAULT_CMP0077 globally

This will fix CMAKE_POLICY_DEFAULT_CMP0077 for snappy:

    CMake Warning (dev) at contrib/snappy/CMakeLists.txt:11 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run
    "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy
    command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Update config.h for arrow

Yes ARROW_FULL_SO_VERSION/ARROW_SO_VERSION is empty right now, like
other version variables (ARROW_VERSION_*)

Refs: #12181

* Fix jemalloc enabled detection (should goes after contrib inclusion)

* Warn if jemalloc is not enabled for non-linux too

Refs: #11897 (osx)
Refs: #11774 (freebsd)

* DOCS-679: netloc function (#12321)

* DOCSUP-1377 (netloc function) (#135)

* add EN description

* changes in query

* changes after review

* add RU description

* CLICKHOUSEDOCS-679: Text fixes.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* add docker image for fuzzer

* fixes in fuzzer docker image

* [docs] engine family introduction refactoring (#12268)

* base refactoring

* adjust links

* Update index.md

* Implemented single part uploads for DiskS3 (#12026)

* Implemented single part uploads for DiskS3.
* Added `min_multi_part_upload_size` to disk configuration.

* Rename test 01378

* [docs] split various kinds of CREATE queries into separate articles (#12328)

* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2

* reset contribs

* Update skip_list.json

* fuzzer container fix

* fuzzer docker image

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
Co-authored-by: myrrc <me@myrrec.space>
Co-authored-by: myrrc <me-clickhouse@myrrec.space>
Co-authored-by: flynn <fenglv15@mails.ucas.ac.cn>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
alesapin added a commit that referenced this issue Jul 14, 2020
* update ya.make

* Added function "hasThreadFuzzer"

* Fix test under ThreadFuzzer

* Test for issue #9088

ALTER DELETE unexpectedly deletes NULL rows

* Remove unused potentially dangerous function

* Fix mutations interpreter #9088

* Added a test

* Added another test just in case

* Added yet another test just in case

* Update 01358_mutation_delete_null_rows.sql

* Fix test

* Fix flaky test

* Attempt to fix flaky test 00721_force_by_identical_result_after_merge_zookeeper

* [anchore] more detailed Dockerfile scan reports (#12159)

* Update Dockerfile

* Update array-functions.md (#12130)

修改编码错误

* Add integration test for mysql replacement query

* Update array-functions.md (#12129)

修改编码错误

* fix ubsan final

* [docs] improve redirects destination

* Update SECURITY.md (#12161)

* Update Dockerfile

* Update questdb_sum_double.xml

* Place common docker compose files to integration docker container

* done

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function (#12156)

* add cluster() adn clusterAllReplicas() table functions description, add signatures to remoteSecure() table function

Signed-off-by: Slach <bloodjazman@gmail.com>

* small russian fixes

Signed-off-by: Slach <bloodjazman@gmail.com>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Update docs/en/sql-reference/table-functions/cluster.md

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* Remove -v from ninja

* [docs] introduction for integration table engines (#12167)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* Fix #10437, CR fixes

* fix style

* add select final to test

* Same change for Kafka - just in case, and to make it conform.

* Fix dictGet with bad arguments during GROUP BY injective functions elimination

* Fix dictGet arguments check during GROUP BY injective functions elimination

This patch changes the place where the dictionary will be loaded (during
syntax analysis), but I guess this is fine, it will be loaded anyway.

Fixes: #10342

* [docs] add redirect from an introduction index page (#12176)

* [website] add apple-touch-icon (#12164)

* Use ENABLE_LIBRARIES option for AMQP-CPP

This is tiny fix, there are more problems that just this small little
bit.

* Set GOOGLETEST_VERSION for googletest

Otherwise cmake reports:

    CMake Warning at contrib/googletest/googletest/CMakeLists.txt:54 (project):
      VERSION keyword not followed by a value or was followed by a value that
      expanded to nothing.

(since GOOGLETEST_VERSION is set in contrib/googletest/CMakeLists.txt)

* Bump googletest to master (to fix gcc10 builds)

gcc10 reports:

    FAILED: src/CMakeFiles/unit_tests_dbms.dir/Columns/tests/gtest_column_unique.cpp.o
    <snip>
    ../contrib/googletest/googletest/include/gtest/gtest-printers.h:287:7: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char8_t) [with _Traits = std::char_traits<char>]’
      287 |   *os << value;
          |   ~~~~^~~~~~~~
    In file included from ../base/common/../common/StringRef.h:6,
                     from ../src/Columns/IColumn.h:7,
                     from ../src/Columns/IColumnUnique.h:2,
                     from ../src/Columns/ColumnUnique.h:2,
                     from ../src/Columns/tests/gtest_column_unique.cpp:1:
    /usr/include/c++/10.1.0/ostream:544:5: note: declared here
      544 |     operator<<(basic_ostream<char, _Traits>&, char8_t) = delete;
          |

* gtest_compressionCodec: is_trivial+is_standard_layout over deprecated is_pod

* gtest_compressionCodec: use fmt over boost::format

boost::format is not compiled under gcc10:

                     from ../src/Compression/tests/gtest_compressionCodec.cpp:14:
    /usr/include/boost/format/alt_sstream_impl.hpp: In instantiation of ‘boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type = int]’:
    /usr/include/boost/format/alt_sstream_impl.hpp:227:9:   required from here
    /usr/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to ‘std::allocator<char>::allocate(std::size_t&, char*)’
      261 |                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);

(although this is system-wide boost, it is pretty recent - 1.72)

* gtest_compressionCodec: fix lack of operator<< for char8_t

* gtest_weak_hash_32: fix lack of operator<< for char8_t

* Force CMP0022 for googletest (to avoid using LINK_INTERFACE_LIBRARIES(_<CONFIG>)?)

Othewise cmake reports:

    -- Configuring done
    CMake Warning (dev) in contrib/googletest/googletest/CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      Target "gtest" has an INTERFACE_LINK_LIBRARIES property which differs from
      its LINK_INTERFACE_LIBRARIES_DEBUG properties.

      INTERFACE_LINK_LIBRARIES:

        global-group;Threads::Threads

      LINK_INTERFACE_LIBRARIES_DEBUG:

        Threads::Threads

    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Generating done
    -- Build files have been written to: /src/ch/clickhouse/.cmake-tmp

* Set CMP0077 for re2

cmake reports:

    CMake Warning (dev) at contrib/re2/CMakeLists.txt:15 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Better assert

* Don't split dictionary source's table name into schema and table name itself
if ODBC driver doesn't support schema.

* Sync reference file with changes in sql file

* [docs] introduction for third-party interfaces (#12175)

* [docs] introduction for third-party interfaces

* Update index.md

* Update index.md

* [docs] introduction for special table engines (#12170)

* [docs] introduction for integration table engines

* Update jdbc.md

* Update odbc.md

* Update mysql.md

* Update kafka.md

* Update hdfs.md

* [docs] introduction for special table engines

* Update index.md

* Update index.md

* Cap max_memory_usage* limits to the process resident memory

There are still some issues with memory tracking, but now with per-user
tracking:

    executeQuery: Code: 241, e.displayText() = DB::Exception: Memory limit (for user) exceeded: would use 437.72 GiB (attempt to allocate chunk of 4200926 bytes), maximum: 437.72 GiB (version 20.6.1.1) (from 10.7.140.7:31318)

Although the server is mostly idle:

    SELECT formatReadableSize(memory_usage)
    FROM system.processes

    ┌─formatReadableSize(memory_usage)─┐
    │ 289.28 MiB                       │
    │ 155.75 MiB                       │
    │ 0.00 B                           │
    └──────────────────────────────────┘

Refs: https://github.com/ClickHouse/ClickHouse/pull/10496/files#r450206865
Cc: @alexey-milovidov

* gtest_compressionCodec: suppress non instantiated gtest warning

gtest reports:

    [ RUN      ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance>
    ../src/Compression/tests/gtest_compressionCodec.cpp:590: Failure
    Parameterized test suite CodecTestPerformance is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.

    Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)

    To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

    GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CodecTestPerformance);
    [  FAILED  ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<CodecTestPerformance> (0 ms)

* Fix tests.

* split

* Do not try to adjust memory tracker amount if it is not larger then in total

* A test for UInt8 as bool

* Included const uint8 values in test

* changelog fixes

* remove questionable functionality

* Tests for fixed issues #10846 and #7347

* Simple (and fast) inplace fix for UInt8 -> bool

* style fix for #12152

* Added test for #3767

* Update zh kafka.md title (#12192)

* Update index.md (#12191)

Fix merge link broken

* changelog fixes

* done

* DOCSUP-1348 Russian translation for new functions (#133) (#12194)

* Russian translation for new functions

* Apply suggestions from code review

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor updates to russian text.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>

* Add runner for testflows

* fixes

* No color

* throw exception on redirect limit in S3 request

* fix test

* [docs] add intrdocution for commercial page (#12187)

* DOCS-647: toStartOfSecond (#12190)

* DOCSUP-1120 Documentation for the toStartOfSecond function (#131)

* Doc toStartOfSecond function

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Minor update for english text, russian translation added.

Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* CLICKHOUSEDOCS-647: Minor text edits.

* Update docs/en/sql-reference/functions/date-time-functions.md

* Update docs/en/sql-reference/functions/date-time-functions.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>

* [docs] refactor Domains overview (#12186)

* Add to images.json

* Sanitize LINK_LIBRARIES property for the directories (#12160)

When you will try to link target with the directory (that exists), cmake will
skip this without an error, only the following warning will be reported:

    target_link_libraries(main /tmp)

    WARNING: Target "main" requests linking to directory "/tmp".  Targets may link only to libraries.  CMake is dropping the item.

And there is no cmake policy that controls this.
(I guess the reason that it is allowed is because of FRAMEWORK for OSX).

So to avoid error-prone cmake rules, this can be sanitized.
There are the following ways:
- overwrite target_link_libraries()/link_libraries() and check *before*
  calling real macro, but this requires duplicate all supported syntax
  -- too complex
- overwrite target_link_libraries() and check LINK_LIBRARIES property, this
  works great
  -- but cannot be used with link_libraries()
- use BUILDSYSTEM_TARGETS property to get list of all targets and sanitize
  -- this will work.

I also tested it with the following patch:

    $ git di
    diff --git a/base/daemon/CMakeLists.txt b/base/daemon/CMakeLists.txt
    index 26d59a57e7..35e6ff6432 100644
    --- a/base/daemon/CMakeLists.txt
    +++ b/base/daemon/CMakeLists.txt
    @@ -9,4 +9,5 @@ target_link_libraries (daemon PUBLIC loggers PRIVATE clickhouse_common_io clickh

     if (USE_SENTRY)
         target_link_libraries (daemon PRIVATE ${SENTRY_LIBRARY})
    +    target_link_libraries (daemon PRIVATE /tmp)
     endif ()

And it works:

    CMake Error at cmake/sanitize_target_link_libraries.cmake:48 (message):
       daemon requested to link with directory: /tmp
    Call Stack (most recent call first):
      cmake/sanitize_target_link_libraries.cmake:55 (sanitize_link_libraries)
      CMakeLists.txt:425 (include)

Refs: #12041

* cleanup

* cleanup

* Revert "Run perf tests with memory sampling (for allocations >1M)"

* too slow

* style

* [docs] add intrdocution for statements page (#12189)

* [docs] add intrdocution for statements page

* Update index.md

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* AMQP requires libuv

Otherwise fails:

    FAILED: src/CMakeFiles/dbms.dir/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp.o
    ...
    In file included from ../src/Storages/RabbitMQ/RabbitMQHandler.h:9,
                     from ../src/Storages/RabbitMQ/StorageRabbitMQ.h:11,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.h:5,
                     from ../src/Storages/RabbitMQ/RabbitMQBlockInputStream.cpp:3:
    ../contrib/AMQP-CPP/include/amqpcpp/libuv.h:22:10: fatal error: uv.h: No such file or directory

* Rename ident to indent.

* Bump arrow to 0.17 (and flatbuffers to v1.12, required by arrow)

MOTIVATION:
- remove double-conversion external dependency
- remove flatc (but flatbuffers is still required, arrow just shipped
  with generated files and that's it)

CHANGED:
- remove pre-generated headers, it is shipped with the arrow
- remove flatc (see above)

NOTES (see tests changes):
- and snappy error is reported as unsupported compression.

* Fix minor issues after #12196

* Reset CurrentMetrics::MemoryTracking periodically to the process RSS

* Allow isInjective() with empty block (is function injective with any arguments)

Since most of the time function will ignore it anyway, and creating
arguments just for checking is function injective or not is overkill

* Implement getLeastSuperType for LowCardinality #8212

* Implement supertype for LowCardinality

* Whitespace

* Update test

* Added a test for PaddedPODArray just in case

* Add documentation for arrayFill

* Fix ugly ugliness

* Added a test

* Non-significant changes

* Update README.md

* Fix skip lists for old branches

* Update int_parsing.xml

* Update build.sh

* Fixes

* Update packager

* Hide nonzero error code on testflows runner

* fix builds

* Show error after TrieDictionary failed to load.

* try remove strange logic in DuplicateOrderByVisitor (#12267)

* Update README.md

* Fix typo in setting name

* Update README.md

* Fix typo in setting name

* Add tests to skip list

* Update README.md

* Update README.md

* Rerun tests

* Ignore testflows exit code

* More skip checks

* get hostname without mutex

* Add more tests to skip

* Bump CI (after non-restartable inner CI issue)

This reverts commit d199961.

* Added a test

* Fix strange code CC @Enmk. Prove: g++ -xc++ -include vector - <<< 'int main() { return std::vector<const char>{1, 2, 3}.size(); }'

* fix TTL after renaming column

* Fix ORC build (#12258)

* first try

* change submodule

* Update .gitmodules

* include build directory

* Update .gitmodules

Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>

* Fix filtering by virtual columns #12166

* Added a test

* fix order of columns in WITH FILL modifier

* Fix wrong exception code in codecs Delta, DoubleDelta #12110

* Added a test

* Fix outstandingly wrong code

* Remove ridiculous code

* Fix strange things

* Fix bad code, once again

* Remove bad ugliness

* Remove something obviously wrong

* Remove another chunk of unneeded code

* Fix "Arcadia" build

* Log sanitizer trap messages from separate thread

* Revert strange file

* Tested with "trap" function

* Support MySQL 'SELECT DATABASE()' query replacement

* Fix race condition in ReplicatedMergeTreeQueue

* Fix build

* Fix bad code

* Fix issues

* Set CMAKE_POLICY_DEFAULT_CMP0022/CMAKE_POLICY_DEFAULT_CMP0077 globally

This will fix CMAKE_POLICY_DEFAULT_CMP0077 for snappy:

    CMake Warning (dev) at contrib/snappy/CMakeLists.txt:11 (option):
      Policy CMP0077 is not set: option() honors normal variables.  Run
    "cmake
      --help-policy CMP0077" for policy details.  Use the cmake_policy
    command to
      set the policy and suppress this warning.

      For compatibility with older versions of CMake, option is clearing the
      normal variable 'BUILD_SHARED_LIBS'.
    This warning is for project developers.  Use -Wno-dev to suppress it.

* Update config.h for arrow

Yes ARROW_FULL_SO_VERSION/ARROW_SO_VERSION is empty right now, like
other version variables (ARROW_VERSION_*)

Refs: #12181

* Fix jemalloc enabled detection (should goes after contrib inclusion)

* Warn if jemalloc is not enabled for non-linux too

Refs: #11897 (osx)
Refs: #11774 (freebsd)

* DOCS-679: netloc function (#12321)

* DOCSUP-1377 (netloc function) (#135)

* add EN description

* changes in query

* changes after review

* add RU description

* CLICKHOUSEDOCS-679: Text fixes.

Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>

* add docker image for fuzzer

* fixes in fuzzer docker image

* [docs] engine family introduction refactoring (#12268)

* base refactoring

* adjust links

* Update index.md

* Implemented single part uploads for DiskS3 (#12026)

* Implemented single part uploads for DiskS3.
* Added `min_multi_part_upload_size` to disk configuration.

* Initial version

* Rename test 01378

* Add integration test for mysql replacement query

* Human readable errors in alter rename queries

* Fix tests

* Revert unrelated changes

* Fix obvious race condition in test

* [docs] split various kinds of CREATE queries into separate articles (#12328)

* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2

* reset contribs

* Update skip_list.json

* fuzzer container fix

* fuzzer docker image

* Fix tests

* Fix error

* Remove useless code

* Miscellaneous

* Allow to parse operator NOT as a function #12262

* Allow to parse operator NOT as a function #12262

Co-authored-by: Guillaume Tassery <gtassery@partners.accedian.com>
Co-authored-by: Alexey Milovidov <milovidov@yandex-team.ru>
Co-authored-by: Mikhail Filimonov <mfilimonov@altinity.com>
Co-authored-by: Yatsishin Ilya <2159081+qoega@users.noreply.github.com>
Co-authored-by: Ivan Blinkov <github@blinkov.ru>
Co-authored-by: yhgcn <yhg_cn@163.com>
Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
Co-authored-by: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com>
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
Co-authored-by: alesapin <alesapin@gmail.com>
Co-authored-by: Anton Popov <pad11rus@gmail.com>
Co-authored-by: Eugene Klimov <bloodjazman@gmail.com>
Co-authored-by: Nikita Mikhailov <jakalletti@jakalletti-build.sas.yp-c.yandex.net>
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
Co-authored-by: Vitaly Baranov <vitbar@yandex-team.ru>
Co-authored-by: Alexander Kazakov <Akazz@users.noreply.github.com>
Co-authored-by: Nikolai Kochetov <nik-kochetov@yandex-team.ru>
Co-authored-by: tavplubix <avtokmakov@yandex-team.ru>
Co-authored-by: Alexander Kuzmenkov <akuzm@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
Co-authored-by: Olga Revyakina <revolg@yandex-team.ru>
Co-authored-by: Anton Ivashkin <iantonspb@yandex-team.ru>
Co-authored-by: Artem Zuikov <chertus@gmail.com>
Co-authored-by: emironyuk <em@don.ru>
Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
Co-authored-by: Vladimir Chebotarev <vladimir.chebotarev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release comp-mutations ALTER UPDATE/DELETE comp-nullable Nulls related major
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants