Commit Graph

120614 Commits

Author SHA1 Message Date
Kruglov Pavel
d2d100b68a
Cancel execution in PipelineExecutor in case of exception in graph->updateNode 2023-07-24 17:05:57 +02:00
flynn
5d318ef72a
Merge branch 'master' into avro-fix 2023-07-24 22:13:18 +08:00
Alexander Tokmakov
faca49a905 Merge branch 'master' into add_delay_for_replicated 2023-07-24 16:07:38 +02:00
robot-ch-test-poll3
40f53c4659
Merge pull request #52515 from ClickHouse/fix-test_throttling
Fix `test_throttling`
2023-07-24 15:58:28 +02:00
Nikita Taranov
c6e6fd7613
Shard OpenedFileCache to avoid lock contention (#51341)
* shard OpenedFileCache to avoid lock contention

* Update OpenedFileCache.h

* fix build

---------

Co-authored-by: Alexey Milovidov <milovidov@clickhouse.com>
2023-07-24 15:58:21 +02:00
Nikolay Degterinsky
40652cf2de
Merge pull request #51899 from evillique/describe-table-settings
Allow SETTINGS before FORMAT in DESCRIBE TABLE query
2023-07-24 15:24:41 +02:00
Raúl Marín
c7239c64ea Remove unused code 2023-07-24 15:16:44 +02:00
Nikita Taranov
df5ff1383c
Fix settings not applied for explain query when format provided (#51859) 2023-07-24 14:57:05 +02:00
Alexander Tokmakov
dd491eeae2
Merge pull request #52514 from azat/tests/fix-test_version_update_after_mutation
Fix flakiness of test_version_update_after_mutation by enabling force_remove_data_recursively_on_drop
2023-07-24 15:23:12 +03:00
Anton Popov
79cc818903 try to fix test 2023-07-24 11:06:21 +00:00
Anton Popov
347f442f84 Merge remote-tracking branch 'upstream/master' into HEAD 2023-07-24 10:55:31 +00:00
Antonio Andelic
5da6c99f6d
Add comment 2023-07-24 12:02:27 +02:00
Anton Popov
2471b032ab fix lightweight delete after drop of projection 2023-07-24 09:52:49 +00:00
Roman Vasin
0af869ff0f
Merge branch 'master' into ADQM-822 2023-07-24 12:23:11 +03:00
Antonio Andelic
3710c7238d Fix test_throttling 2023-07-24 09:19:06 +00:00
Val Doroshchuk
efa638ef3c MaterializedMySQL: Support unquoted utf-8 strings in DDL
Since ClickHouse does not support unquoted utf-8 strings but MySQL does.

Instead of fixing Lexer to recognize utf-8 chars as TokenType::BareWord,
suggesting to quote all unrecognized tokens before applying any DDL.

Actual parsing and validating the syntax will be done by particular Parser.

If there is any TokenType::Error, the query is unable to be parsed anyway.
Quoting such tokens can provide the support of utf-8 names.

See `tryQuoteUnrecognizedTokens` and `QuoteUnrecognizedTokensTest`.

mysql> CREATE TABLE 道.渠(...

is converted to

CREATE TABLE `道`.`渠`(...

Also fixed the bug with missing * while doing SELECT in full sync because db or table name are back quoted when not needed.
2023-07-24 11:12:10 +02:00
Azat Khuzhin
0401dc453e Fix flakiness of test_version_update_after_mutation by enabling force_remove_data_recursively_on_drop
Since there can be some leftovers:

    2023.07.24 07:08:25.238066 [ 140 ] {} <Error> Application: Code: 219. DB::Exception: Cannot drop: filesystem error: in remove: Directory not empty ["/var/lib/clickhouse/data/system/"]. Probably database contain some detached tables or metadata leftovers from Ordinary engine. If you want to remove all data anyway, try to attach database back and drop it again with enabled force_remove_data_recursively_on_drop setting: Exception while trying to convert database system from Ordinary to Atomic. It may be in some intermediate state. You can finish conversion manually by moving the rest tables from system to .tmp_convert.system.9396432095832455195 (using RENAME TABLE) and executing DROP DATABASE system and RENAME DATABASE .tmp_convert.system.9396432095832455195 TO system. (DATABASE_NOT_EMPTY), Stack trace (when copying this message, always include the lines below):

    0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000e68af57 in /usr/bin/clickhouse
    1. ? @ 0x000000000cab443c in /usr/bin/clickhouse
    2. DB::DatabaseOnDisk::drop(std::shared_ptr<DB::Context const>) @ 0x000000001328d617 in /usr/bin/clickhouse
    3. DB::DatabaseCatalog::detachDatabase(std::shared_ptr<DB::Context const>, String const&, bool, bool) @ 0x0000000013524a6c in /usr/bin/clickhouse
    4. DB::InterpreterDropQuery::executeToDatabaseImpl(DB::ASTDropQuery const&, std::shared_ptr<DB::IDatabase>&, std::vector<StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag>, std::allocator<StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag>>>&) @ 0x0000000013bc05e4 in /usr/bin/clickhouse
    5. DB::InterpreterDropQuery::executeToDatabase(DB::ASTDropQuery const&) @ 0x0000000013bbc6b8 in /usr/bin/clickhouse
    6. DB::InterpreterDropQuery::execute() @ 0x0000000013bbba22 in /usr/bin/clickhouse
    7. ? @ 0x00000000140b13a5 in /usr/bin/clickhouse
    8. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x00000000140ad20e in /usr/bin/clickhouse
    9. ? @ 0x00000000140d2ef0 in /usr/bin/clickhouse
    10. DB::maybeConvertSystemDatabase(std::shared_ptr<DB::Context>) @ 0x00000000140d0aaf in /usr/bin/clickhouse
    11. DB::Server::main(std::vector<String, std::allocator<String>> const&) @ 0x000000000e724e55 in /usr/bin/clickhouse
    12. Poco::Util::Application::run() @ 0x0000000017ead086 in /usr/bin/clickhouse
    13. DB::Server::run() @ 0x000000000e714a5d in /usr/bin/clickhouse
    14. Poco::Util::ServerApplication::run(int, char**) @ 0x0000000017ec07b9 in /usr/bin/clickhouse
    15. mainEntryClickHouseServer(int, char**) @ 0x000000000e711a26 in /usr/bin/clickhouse
    16. main @ 0x0000000008cf13cf in /usr/bin/clickhouse
    17. __libc_start_main @ 0x0000000000021b97 in /lib/x86_64-linux-gnu/libc-2.27.so
    18. _start @ 0x00000000080705ae in /usr/bin/clickhouse
     (version 23.7.1.2012)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 10:34:50 +02:00
Smita Kulkarni
0e46cf86b7 Added try-except to check cases when second backup/restore is picked up first 2023-07-24 08:52:19 +02:00
Alexey Milovidov
c794922401 More tests 2023-07-24 08:20:30 +02:00
Alexey Milovidov
890a3754a6 Fix error 2023-07-24 08:19:46 +02:00
Alexey Milovidov
aaa0bf64fd Add a test 2023-07-24 08:05:55 +02:00
Alexey Milovidov
ceaaa78fdc Fix transform 2023-07-24 08:04:38 +02:00
Dmitry Kardymon
810137e57a Add new peak_memory_usage to docs 2023-07-24 05:59:07 +00:00
Alexey Milovidov
b225f9c34b
Merge pull request #52450 from ClickHouse/remove-to-decimal-string
Remove `toDecimalString`
2023-07-24 08:40:51 +03:00
Alexey Milovidov
f17844e9c2
Merge pull request #51037 from azat/dist/optimize_skip_unused_shards-join-fix
Fix optimize_skip_unused_shards with JOINs
2023-07-24 08:31:00 +03:00
Dmitry Kardymon
62f9a953fe Merge remote-tracking branch 'origin/master' into ADQM-940 2023-07-24 04:52:12 +00:00
Azat Khuzhin
6ae4d29180 Fix tests after session_timezone randomization
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 06:24:31 +02:00
Azat Khuzhin
bc167dfde8 clickhouse-test: add proper escaping for HTTP parameters
The problem is that old versions of cURL (7.81.0 at least) handle
additional parameters incorrectly if in previous parameter was "/":

    $ docker run --rm curlimages/curl:8.1.2 --http1.1 --get -vvv 'http://kernel.org/?bar=foo/baz' --data-urlencode "query=select 1 format Null"; echo
    > GET /?bar=foo/baz&query=select+1+format+Null HTTP/1.1
    > User-Agent: curl/8.1.2

    $ docker run --rm curlimages/curl:7.81.0 --http1.1 --get -vvv 'http://kernel.org/?bar=foo/baz' --data-urlencode "query=select 1 format Null"; echo
    > GET /?bar=foo/baz?query=select+1+format+Null HTTP/1.1
    > User-Agent: curl/7.81.0-DEV

Note, that I thought about making the same for cli, but it is not that
easy, even after getting rid of sh -c and string contantenation, it
still cannot be done for CLICKHOUSE_CLIENT_OPT.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 06:13:12 +02:00
Azat Khuzhin
2389e0f0b6 Randomize timezone in tests across non-deterministic around 1970 and default
There was some cases when some patches to the datetime code leads to
flaky tests, due to the tests itself had been runned using regular
timezone (TZ).

But if you will this tests with something "specific" (that is not
strictly defined around 1970 year), those tests will fail.

So to catch such issues in the PRs itself, let's randomize
session_timezone as well.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 06:13:12 +02:00
Alexey Milovidov
0c765ddc5c Merge branch 'master' into sql-fetch-allow-without-offset 2023-07-24 05:56:46 +02:00
Alexey Milovidov
ac54be9652 Fix a test 2023-07-24 05:56:18 +02:00
Azat Khuzhin
4a33e027c5 Split StorageReplicatedMergeTree reading methods
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
323128df6f Remove non existing ctor of Cluster::Address
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
83c0f03b98 Change signature of the updateSettingsForCluster() to avoid cluster requirement
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
b222476090 Add ability to pass table for connections checks per-shard to ReadFromRemote
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
67095d2150 Fix comment for function argument in TableFunctionRemote
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
a0070eda02 Slightly optimize code in ClusterProxy::executeQuery()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Azat Khuzhin
d7f7f16fbc Introduce IStorage::supportsTrivialCountOptimization()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-24 05:50:44 +02:00
Alexey Milovidov
169b9d5cc0 Fix tidy 2023-07-24 05:49:06 +02:00
Alexey Milovidov
e87f976f2b Merge branch 'master' into remove-wrong-code 2023-07-24 05:48:06 +02:00
Alexey Milovidov
a1a79eee0f
Merge pull request #51383 from ClickHouse/fix-potentially-bad-code
Remove suspicious code
2023-07-24 06:46:31 +03:00
Alexey Milovidov
eb5038f3e9
Merge pull request #52295 from ClickHouse/allow_vertical_merges_from_compact_to_wide_parts
Enable `allow_vertical_merges_from_compact_to_wide_parts` by default
2023-07-24 06:44:33 +03:00
robot-ch-test-poll4
a104ce6b3b
Merge pull request #52467 from hanfei1991/hanfei/refine-52451
do not throw exception in OptimizedRegularExpressionImpl::analyze
2023-07-24 05:38:54 +02:00
Alexey Milovidov
75efee9675 Fix errors 2023-07-24 05:34:00 +02:00
Alexey Milovidov
a17652a422 Merge branch 'master' into incbin 2023-07-24 05:33:52 +02:00
JackyWoo
ab3376a998
Merge branch 'master' into rewrite_uniq_to_count 2023-07-24 11:04:36 +08:00
Alexey Milovidov
1037b4ecb1 Merge branch 'master' into sql-fetch-allow-without-offset 2023-07-24 02:33:01 +02:00
robot-ch-test-poll2
2b0c423d7d
Merge pull request #52499 from ClickHouse/try-fix-join-ast-fuzz-asan
Try to fix asan wanring in HashJoin
2023-07-24 02:10:59 +02:00
Alexey Milovidov
1bc83afa54
Merge branch 'master' into fix-potentially-bad-code 2023-07-24 03:02:57 +03:00
Alexey Milovidov
e8b271e878
Merge pull request #51916 from ClickHouse/maybe-better-tests
Maybe better tests
2023-07-24 03:01:39 +03:00