Commit Graph

39376 Commits

Author SHA1 Message Date
Anton Popov
f715bd95f1 fix writing to StorageS3 2023-03-31 14:08:28 +00:00
Robert Schulze
5d64841276
Merge pull request #48017 from ClickHouse/rs/show_columns
MySQL compatibility: Implement `SHOW COLUMNS`
2023-03-31 15:50:23 +02:00
Alexey Milovidov
3de29f5cc1
Merge pull request #48278 from azat/backups/fix-UB
Fix UB (signed integer overflow) in StorageMergeTree::backupData()
2023-03-31 16:35:10 +03:00
vdimir
2a179aed49
Fix usage common::addOverflow for floats in AggregateFunctionSparkbar 2023-03-31 13:35:07 +00:00
natasha
644d83653d only set the necessary FormatStateStacked settings 2023-03-31 14:10:16 +01:00
Anton Popov
12c7992d36
Merge pull request #48118 from CurtizJ/optimize-mapUpdate
Optimize function `mapUpdate`
2023-03-31 15:03:15 +02:00
Alexander Tokmakov
caf00b5968 Merge branch 'master' into sync_replica_lightweight 2023-03-31 14:52:55 +02:00
natasha
6caacd41d4 fix the code, single line formatter was forgotten 2023-03-31 13:45:12 +01:00
Alexey Milovidov
070210a02f
Merge pull request #48271 from vchekan/master
In messages, put values into quotes
2023-03-31 15:35:19 +03:00
vdimir
2d18689af6
use common::addOverflow in AggregateFunctionSparkbar.h 2023-03-31 11:59:13 +00:00
Alexander Tokmakov
f54fd15112 fix 2023-03-31 12:58:11 +02:00
vdimir
24b46774b0
update AggregateFunctionSparkbar.h 2023-03-31 10:58:09 +00:00
vdimir
cc61d35bc5
Fix overflow in sparkbar function 2023-03-31 10:58:08 +00:00
Alexey Milovidov
d06ab59737
Merge pull request #48279 from ClickHouse/23.4-prepare
Update version after release
2023-03-31 13:28:30 +03:00
Alexey Milovidov
dd79bf0a03 Update autogenerated version to 23.4.1.1 and contributors 2023-03-31 12:20:50 +02:00
Robert Schulze
8d91a9f4c2
Sort descendingly by elapsed time 2023-03-31 09:36:03 +00:00
Azat Khuzhin
bac7def719 Fix UB (signed integer overflow) in StorageMergeTree::backupData()
UBsan report:

    /build/src/Storages/StorageMergeTree.cpp:2088:80: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
        0 0x30c2ae7b in DB::StorageMergeTree::backupData(DB::BackupEntriesCollector&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::optional<absl::lts_20211102::InlinedVector<std::__1::shared_ptr<DB::IAST>, 7ul, std::__1::allocator<std::__1::shared_ptr<DB::IAST>>>> const&) build_docker/./src/Storages/StorageMergeTree.cpp:2088:80
        1 0x2dd641b5 in DB::BackupEntriesCollector::makeBackupEntriesForTableData(DB::QualifiedTableName const&) build_docker/./src/Backups/BackupEntriesCollector.cpp:703:18
        2 0x2dd5c2a7 in DB::BackupEntriesCollector::makeBackupEntriesForTablesData() build_docker/./src/Backups/BackupEntriesCollector.cpp:676:9
        3 0x2dd5848d in DB::BackupEntriesCollector::run() build_docker/./src/Backups/BackupEntriesCollector.cpp:119:5
        4 0x2dd84da3 in DB::BackupsWorker::doBackup(std::__1::shared_ptr<DB::ASTBackupQuery> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, DB::BackupInfo const&, DB::BackupSettings, std::__1::shared_ptr<DB::IBackupCoordination>, std::__1::shared_ptr<DB::Context const> const&, std::__1::shared_ptr<DB::Context>, bool) build_docker/./src/Backups/BackupsWorker.cpp:359:59
        5 0x2dd82405 in DB::BackupsWorker::startMakingBackup(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context const> const&) build_docker/./src/Backups/BackupsWorker.cpp:248:13
        6 0x2dd81d0a in DB::BackupsWorker::start(std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::Context>) build_docker/./src/Backups/BackupsWorker.cpp:179:16
        7 0x2f4d0d5f in DB::InterpreterBackupQuery::execute() build_docker/./src/Interpreters/InterpreterBackupQuery.cpp:39:30

    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /build/src/Storages/StorageMergeTree.cpp:2088:80 in

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-31 12:29:31 +03:00
Robert Schulze
eb93ec35f5
Merge pull request #48154 from azat/varuint-v2
Add sanity checks for writing number in variable length format (resubmit)
2023-03-31 10:59:21 +02:00
Vadym Chekan
0f4c8144a6 In messages, put values into quotes
Configuration values, such as disk names, backup engine names, etc, may give error message unintended sense, for example, if trying to backup to `disk` instead of `Disk`, the error message will be "Not found backup engine disk", which can be interpreted as "disk of backup engine not found". It might be not clear that the word "disk" comes from the query and is not part of the error message.
2023-03-30 22:46:18 -07:00
Azat Khuzhin
e16b434631 Fix compiling examples without Hive
Skip compiling comma_separated_streams since it requires Hive.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-31 06:05:16 +02:00
Anton Popov
5ceb855e7f
Merge branch 'master' into fix-race-storage-s3 2023-03-31 04:16:35 +02:00
Alexander Tokmakov
64b1f74a60 fix 2023-03-31 01:39:49 +02:00
Alexander Tokmakov
29e85bd9a4
Merge branch 'master' into fix-threadpools 2023-03-31 01:03:06 +03:00
Anton Popov
38389d878c fix one more race in StorageS3 2023-03-30 21:06:53 +00:00
Sergei Trifonov
01ed4ffca4
Merge pull request #47870 from ClickHouse/segmentator-fix
Fix CPU usage counters update logic
2023-03-30 22:55:58 +02:00
Kruglov Pavel
a3908b54c1
Merge pull request #48124 from Avogar/msgpack-more-types
Support more ClickHouse types in MsgPack format
2023-03-30 22:03:47 +02:00
Alexey Milovidov
5146dc0c53
Merge pull request #48199 from ClickHouse/qoega-patch-4
Update style in ParserKQLSort.cpp
2023-03-30 22:58:20 +03:00
Alexey Milovidov
614be6f718
Merge pull request #47387 from sippy/pg_select_from_only
Use "SELECT * FROM ONLY xyz", not "SELECT * FROM xyz" while replicating
2023-03-30 22:57:57 +03:00
Alexey Milovidov
eb38616cc9
Merge pull request #48214 from ClickHouse/remove-wrong-assert
Remove wrong assert from LogicalExpressionOptimizerPass
2023-03-30 22:55:24 +03:00
Nikolai Kochetov
fae8d7a1ee
Merge pull request #48221 from ClickHouse/fix-aggregate-projection-analysis
Disable AST optimizations for projection analysis.
2023-03-30 21:31:58 +02:00
Alexey Milovidov
6e3ced86e9
Merge pull request #48220 from ClickHouse/rs/caseinsensitive-str_to_date
MySQL compatibility: Make str_to_date alias case-insensitive
2023-03-30 22:08:01 +03:00
Alexander Tokmakov
d12bab3ce1 add zk retries for distributed ddl 2023-03-30 20:47:25 +02:00
Azat Khuzhin
edeeac84cf Fix incorrect ThreadPool usage after ThreadPool introspection
```
$ gg 'ThreadPool[^()]([A-Za-z_]\+,' src/
src/Interpreters/Context.cpp:        shared->load_marks_threadpool = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
src/Interpreters/Context.cpp:        shared->prefetch_threadpool = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
src/Interpreters/Context.cpp:        shared->threadpool_writer = std::make_unique<ThreadPool>(pool_size, pool_size, queue_size);
```

Fixes: #47880
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-30 20:08:38 +02:00
Robert Schulze
4938681f87
Fix macos build 2023-03-30 17:46:11 +00:00
Robert Schulze
191f780223
Sort output of SHOW PROCESSLIST
Follow-up to #48127
2023-03-30 17:22:20 +00:00
Mikhail f. Shiryaev
c5ec7a3ec9
Merge pull request #48235 from ClickHouse/fix-01293_show_clusters
Determine the hosts order in `SHOW CLUSTER` query
2023-03-30 18:41:56 +02:00
Antonio Andelic
80cb121d2a
Merge pull request #48092 from ClickHouse/nosign-keyword-for-s3
Add support for `NOSIGN` keyword and `no_sign_request` config for S3
2023-03-30 18:10:56 +02:00
Nikolai Kochetov
f06bdc85eb
Merge pull request #48226 from ClickHouse/rename-setting-stop_reading_on_first_cancel
Rename setting stop_reading_on_first_cancel
2023-03-30 18:03:23 +02:00
Mikhail f. Shiryaev
9593ffc7cb
Determine the hosts order in SHOW CLUSTER query 2023-03-30 17:37:31 +02:00
Nikolay Degterinsky
c363b5820e
Merge pull request #47087 from evillique/decode_ulid
Add function ULIDStringToDateTime
2023-03-30 17:19:07 +02:00
filimonov
fbb22348ea
Refactor reading the pool setting & from server config. (#48055)
After #36425 there was a lot of confusions/problems with configuring pools - when the message was confusing, and settings need to be ajusted in several places.
See some examples in #44251, #43351, #47900, #46515.

The commit includes the following changes:
1) Introduced a unified mechanism for reading pool sizes from the configuration file(s). Previously, pool sizes were read from the Context.cpp with fallbacks to profiles, whereas main_config_reloader in Server.cpp read them directly without fallbacks.
2) Corrected the data type for background_merges_mutations_concurrency_ratio. It should be float instead of int.
3) Refactored the default values for settings. Previously, they were defined in multiple places throughout the codebase, but they are now defined in one place (or two, to be exact: Settings.h and ServerSettings.h).
4) Improved documentation, including the correct message in system.settings.

Additionally make the code more conform with #46550.
2023-03-30 16:44:11 +02:00
Alexander Tokmakov
131395b00f
Merge pull request #48171 from aalexfvk/add_option_disable_on_cluster_queries
Add allow_distributed_ddl_queries option to the cluster config
2023-03-30 17:29:02 +03:00
Robert Schulze
1b709d0bc0
Merge branch 'master' into rs/caseinsensitive-str_to_date 2023-03-30 16:23:18 +02:00
Robert Schulze
9cf45e5436
Merge branch 'master' into rs/no-default-format-string 2023-03-30 16:23:14 +02:00
Anton Popov
e72472e71b
Merge branch 'master' into fix-race-storage-s3 2023-03-30 16:19:57 +02:00
Nikolai Kochetov
a8a28bdf3d Merge branch 'master' into rename-setting-stop_reading_on_first_cancel 2023-03-30 16:07:14 +02:00
Nikolai Kochetov
f870e6f7a9 Rename setting stop_reading_on_first_cancel to partial_result_on_first_cancel. 2023-03-30 14:00:44 +00:00
Robert Schulze
8b2fc8a40a
parseDateTime[InJodaSyntax](): Require format argument
Function parseDateTime[InJodaSyntax]() previously accepted an
(undocumented) default format string. The problem was that
1. there is no "natural" default format
2. MySQL str_to_date() (= the motivation for
   parseDateTime[InJodaSyntax]()) also provides no default format.

--> get rid of the default format
2023-03-30 12:25:55 +00:00
Nikolai Kochetov
ad246d669e Disable AST optimizations for projection analysis. 2023-03-30 12:08:52 +00:00
Robert Schulze
2df32324af
MySQL compatibility: Make str_to_date alias case-insensitive
MySQL doesn't care about the case
2023-03-30 12:06:20 +00:00
Alexander Tokmakov
681d5b25bf
Merge pull request #48208 from ClickHouse/remove-unused-setting
Remove unused setting
2023-03-30 15:02:44 +03:00
Nikolai Kochetov
b3d77c0c30
Merge pull request #48177 from ClickHouse/deprecate-explain-query-tree-with-disabled-analyzer
Deprecate EXPLAIN QUERY TREE with disabled analyzer.
2023-03-30 13:56:40 +02:00
Alexey Milovidov
cb27416d8e
Merge pull request #48102 from ClickHouse/vdimir/25402_storage_merge_explain_graph_crash
Fix crash in explain graph with StorageMerge
2023-03-30 13:54:22 +03:00
Antonio Andelic
b22d3e9136 Remove wrong assert 2023-03-30 10:21:48 +00:00
Alexey Milovidov
103972497b Remove unused setting 2023-03-30 12:07:56 +02:00
Ilya Yatsishin
baabc49f33
Update ParserKQLSort.cpp
Style
2023-03-30 11:01:51 +02:00
Robert Schulze
b0473098c6
Merge branch 'master' into qc-compression 2023-03-30 10:55:42 +02:00
Robert Schulze
47fd1ee06d
Merge pull request #48127 from ClickHouse/rs/sort-show
Sort output of SHOW <INFO> statements
2023-03-30 10:54:23 +02:00
Robert Schulze
d24d1b48df
Merge branch 'master' into varuint-v2 2023-03-30 10:24:58 +02:00
Antonio Andelic
a307e0d95d
Merge pull request #48168 from ClickHouse/logical-optimizer-ignore-nulls
Correctly handle NULL constants in logical optimizer for new analyzer
2023-03-30 10:24:25 +02:00
Nikolay Degterinsky
8c8c746451
Update FunctionsCodingULID.cpp 2023-03-30 09:04:36 +02:00
Nikolay Degterinsky
870ee4b4f5
Merge pull request #47813 from FrankChen021/query_id
Add `X-ClickHouse-Query-Id` to HTTP response when queries fail to execute
2023-03-30 09:00:03 +02:00
Antonio Andelic
9db58532f4
Clang-tidy fix 2023-03-30 08:41:14 +02:00
Alexey Milovidov
5ca488d70e
Update src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2023-03-30 09:14:52 +03:00
Nikolay Degterinsky
1bc5489e04
Merge pull request #47895 from evillique/fix-isipv6-function
Fix isIPv6String function
2023-03-30 01:45:08 +02:00
Nikolay Degterinsky
5b53f5ddae
Merge branch 'master' into decode_ulid 2023-03-30 01:37:14 +02:00
Alexey Milovidov
a629fa3ed9
Merge pull request #48162 from ClickHouse/vdimir/remove_unused_from_gtest_transform_query
Remove unused mockSystemDatabase from gtest_transform_query_for_exter…
2023-03-30 01:29:42 +03:00
Alexey Milovidov
e982fb9f1c
Merge pull request #47880 from azat/threadpool-introspection
ThreadPool metrics introspection
2023-03-30 01:27:31 +03:00
Alexey Milovidov
c00a2fc851
Merge pull request #48184 from Avogar/fix-avro
Fix possible member call on null pointer in Avro format
2023-03-30 01:19:44 +03:00
Anton Popov
ed29c141fb fix race in StorageS3 2023-03-29 22:13:45 +00:00
Nikita Taranov
460a83feb6
Fix aggregation by partitions (#47634) 2023-03-29 23:59:39 +02:00
Alexey Milovidov
13761fe891
Merge pull request #48133 from ClickHouse/allow-to-skip-errors-of-enums
Allow skipping errors related to unknown enum values in row input formats
2023-03-29 23:20:05 +03:00
Alexander Gololobov
98b3617ce2
Merge pull request #48150 from DimasKovas/fix_stdlib_compatibility
Fix stdlib compatibility issues
2023-03-29 21:29:33 +02:00
avogar
db83dd4e52 Fix possible member call on null pointer in Avro format 2023-03-29 17:33:22 +00:00
Aleksei Filatov
0ac9dcd723 Add allow_distributed_ddl_queries option to the cluster config 2023-03-29 18:15:46 +03:00
Nikolai Kochetov
85795965c0 Deprecate EXPLAIN QUERY TREE with disabled analyzer. 2023-03-29 14:59:01 +00:00
Alexey Milovidov
cc345853e7
Merge pull request #47594 from ClickHouse/decimal256-various
Add specializations for Decimal256 in various places
2023-03-29 17:33:20 +03:00
Frank Chen
87d235e842
Some improvements about names of span logs (#47667) 2023-03-29 16:28:36 +02:00
Alexander Tokmakov
c5b6ed410d
Merge pull request #48130 from ClickHouse/support_undrop_table
Merging "Support undrop table"
2023-03-29 16:49:58 +03:00
Vitaly Baranov
481a7a76ac
Simplify backup coordination for file infos (#48095)
* Remove obsolete code for archive suffixes.

* Simplify backup coordination, stop using it for restoring.

* Build all file infos before writing to backup. Decrease number of znodes.

* Split long values before writing to ZooKeeper.

* Use separate mutexes for unrelated activities.

* Make test test_disallow_concurrency less flaky.

* Add comments and test for backup_keeper_value_max_size.
2023-03-29 15:19:40 +02:00
Robert Schulze
b324d0ed5e
Merge branch 'master' into qc-compression 2023-03-29 15:09:22 +02:00
Antonio Andelic
80f0251ff2 better 2023-03-29 12:54:57 +00:00
Antonio Andelic
611e7c6382 Ignore null constants in logical optimizer 2023-03-29 12:37:43 +00:00
Antonio Andelic
44e95aa65f Merge branch 'master' into nosign-keyword-for-s3 2023-03-29 11:10:03 +00:00
Antonio Andelic
7b1ad221b2 Address PR comments 2023-03-29 11:08:44 +00:00
robot-ch-test-poll
04d30a2afb
Merge pull request #48119 from Avogar/avro-more-types
Support more ClickHouse types in Avro format
2023-03-29 13:07:35 +02:00
vdimir
bdc8a47bcf
Remove unused mockSystemDatabase from gtest_transform_query_for_external_database 2023-03-29 11:02:50 +00:00
Azat Khuzhin
d7d9f0cb6b Fix overflow of VarUInt format in Progress packets
Otherwise query like this, can trigger sanity check:

    WITH x AS (SELECT [], number AS a FROM numbers(9223372036854775807)), y AS (SELECT arrayLastOrNull(x -> (x >= -inf), []), arrayLastOrNull(x -> (x >= NULL), [1]), number AS a FROM numbers(1.)) SELECT [1023], * FROM x WHERE a IN (SELECT a FROM y) ORDER BY arrayLastOrNull(x -> (x >= 1025), [1048577, 1048576]) DESC NULLS LAST, '0.0000000002' ASC NULLS LAST, a DESC NULLS FIRST

CI: https://s3.amazonaws.com/clickhouse-test-reports/0/a9bcd022d5f4a5be530595dbfae3ed177b5c1972/fuzzer_astfuzzermsan/report.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-29 12:42:45 +02:00
Robert Schulze
d0f4c63d27
Fix tests 2023-03-29 10:30:40 +00:00
Kseniia Sumarokova
9e8bbe4bfe
Merge pull request #47987 from kssenii/try-fix-rabbitmq-test
Try fix rabbitmq test
2023-03-29 12:20:05 +02:00
Vladimir C
570426141e
Merge branch 'master' into vdimir/direct-dict-async-read 2023-03-29 11:58:08 +02:00
vdimir
588fdcffdf
comment child_plans in ReadFromMerge 2023-03-29 09:42:32 +00:00
Dmitrii Kovalkov
71a6a02e88 fix stdlib compatibility issues 2023-03-29 12:20:27 +03:00
Azat Khuzhin
9457b1cc46 Use VAR_UINT_MAX for unknown_packet_in_send_data
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-29 11:02:33 +02:00
Azat Khuzhin
36f6408ada Add sanity checks for writing number in variable length format
And just to double check:

    # var_uint 9223372036854775807
    ffffffffffffffff7f
    ffffffffffffffff7f
    ffffffffffffffff7f
    x: 9223372036854775807, y: 9223372036854775807
    # var_uint 9223372036854775808
    808080808080808080
    808080808080808080
    808080808080808080
    x: 9223372036854775808, y: 0

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-29 11:02:33 +02:00
Azat Khuzhin
f38a7aeabe ThreadPool metrics introspection
There are lots of thread pools and simple local-vs-global is not enough
already, it is good to know which one in particular uses threads.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-29 10:46:59 +02:00
Robert Schulze
b4c8ef980c
Merge pull request #47838 from zvonand/zvonand-formatdecimal
Add toDecimalString function
2023-03-29 10:41:12 +02:00
Antonio Andelic
50ed205aa0
Merge pull request #47303 from ClickHouse/avoid-merging-partition
Skip merged partitions for `min_age_to_force_merge_seconds` merges
2023-03-29 09:31:00 +02:00
robot-ch-test-poll1
decc4fbc98
Merge pull request #48132 from ClickHouse/fix-double-whitespace-2
Fix double whitespace in exception message
2023-03-29 08:06:31 +02:00
Alexander Tokmakov
cfe0fb6571 fix 2023-03-29 03:31:39 +02:00