Commit Graph

1010 Commits

Author SHA1 Message Date
flynn
e7afe0f60f fix 2023-03-23 04:08:36 +00:00
flynn
dba352274c fix 2023-03-22 08:05:00 +00:00
flynn
ef6b891f28 fix 2023-03-22 02:47:04 +00:00
flynn
db31af84c3 fix build 2023-03-21 15:09:10 +00:00
flynn
db7582e060 AST fuzzer support fuzzing SELECT query to EXPLAIN query randomly 2023-03-21 14:26:39 +00:00
flynn
7531840fd7 Support fuzz Explain query 2023-03-21 02:41:51 +00:00
Sergei Trifonov
273770519b
Merge branch 'master' into master 2023-03-20 18:28:10 +01:00
Kruglov Pavel
1d12e85d55
Merge branch 'master' into non-blocking-connect 2023-03-20 13:23:55 +01:00
Alexey Milovidov
4a44dafdee Merge branch 'master' into decimal256-various 2023-03-20 03:30:14 +01:00
Robert Schulze
0e01e912fe
Preparation for libcxx(abi), llvm, clang-tidy 16 2023-03-19 17:25:41 +00:00
Sema Checherinda
0b641fcead
Merge pull request #47564 from CheSema/remove-redundant
remove counters for threads, fix negative counters
2023-03-18 02:23:52 +01:00
Alexey Milovidov
26d17fe560 Merge branch 'master' of github.com:ClickHouse/ClickHouse into decimal256-various 2023-03-17 22:15:16 +01:00
Robert Schulze
f72a337074
Remove cruft from build
No need to check compiler flags, clang >= 15 supports all of them.
2023-03-17 13:44:04 +00:00
avogar
4b46b5b748 Fix, make better 2023-03-17 13:02:20 +00:00
Sema Checherinda
3c6deddd1d work with comments on PR 2023-03-16 19:55:58 +01:00
Kruglov Pavel
2f2d7133c5
Fix build 2023-03-16 16:27:35 +01:00
Sema Checherinda
67ac858a52 remove counters for threads, fix negative counters 2023-03-15 22:22:22 +01:00
Andrey Zvonov
4327d707e0
Merge branch 'master' into zvonand-implicit-tz 2023-03-15 22:18:52 +01:00
Alexey Perevyshin
1e9ef12f51
Merge branch 'master' into master 2023-03-15 22:21:02 +04:00
zvonand
bbb31cf891 added validation on setting modification 2023-03-15 18:37:23 +01:00
alexX512
cbbdb5aabc Fix typos 2023-03-15 13:05:38 +00:00
avogar
9596c218d9 Merge with master 2023-03-15 12:58:56 +00:00
avogar
17f5356178 Improve async reading from socket 2023-03-15 12:18:08 +00:00
alexX512
d47e10484f Merge branch 'master' of github.com:ClickHouse/ClickHouse 2023-03-15 11:14:34 +00:00
alexX512
8590e4b459 Add tests fr stop_reading_on_first_cancel setting 2023-03-15 10:50:01 +00:00
Azat Khuzhin
bcf381c5ae Reimplement interserver mode to avoid replay attacks
Prevous implementation (DBMS_MIN_REVISION_WITH_INTERSERVER_SECRET)
accepts the salt from the client, which make it useless.

Reimplement the protocol to send the salt by the server and use it in
the client instead.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-03-15 08:28:43 +01:00
alexX512
14a7c5a019 Add stop_reading_on_first_cancel setting 2023-03-15 06:06:55 +00:00
Alexey Milovidov
e952ecae8c Add Decimal256 to a lot of places 2023-03-14 22:10:52 +01:00
Alexey Milovidov
a411ae10b5
Merge pull request #47486 from ClickHouse/revert_25674
Remove "asynchronous connection drain"
2023-03-13 21:40:39 +03:00
Vladimir C
9cb018545c
Merge pull request #47499 from FrankChen021/span_kind 2023-03-13 11:35:03 +01:00
Frank Chen
f5d5950a67 Set SpanKind for internal queries 2023-03-12 21:31:50 +08:00
Alexander Tokmakov
7b1b238d0b Revert "Merge pull request #25674 from amosbird/distributedreturnconnection"
This reverts commit 5ffd99dfd4, reversing
changes made to 2796aa333f.
2023-03-11 19:09:47 +01:00
Alexander Tokmakov
52504cc2d0 Revert "Merge pull request #27774 from amosbird/distributed-fix"
This reverts commit 86af58f54f, reversing
changes made to 34f5787f0a.
2023-03-11 17:26:30 +01:00
Alexander Tokmakov
bd124a24ea Revert "Merge pull request #31965 from azat/connection-drain-pull"
This reverts commit 6cb54b4092, reversing
changes made to 42d938ffa0.
2023-03-11 17:24:38 +01:00
Raúl Marín
7161bbeb88 More improvements based on PR review 2023-03-09 11:37:02 +01:00
Raúl Marín
ff6c9916e6 Improvements based on the PR 2023-03-08 12:32:14 +01:00
zvonand
1ce697d8c0 Revert "revert protocol changes, found better way"
This reverts commit 3a918ae66a.
2023-03-07 16:05:23 +01:00
zvonand
1fd6e3f23b Revert "fix style"
This reverts commit a7a3c9d1a6.
2023-03-07 16:02:30 +01:00
zvonand
e92501d5dd update tests + exception 2023-03-07 13:02:02 +01:00
Raúl Marín
951d65f2fd Fix debug build 2023-03-07 08:36:11 +01:00
zvonand
a7a3c9d1a6 fix style 2023-03-07 02:52:42 +01:00
zvonand
c859478db3 upd 2023-03-07 02:36:02 +01:00
zvonand
3a918ae66a revert protocol changes, found better way 2023-03-07 02:33:46 +01:00
zvonand
57c5a63721 fix receive of timezone update on processing 2023-03-06 16:39:47 +01:00
Raúl Marín
43da841e1e Style 2023-03-06 14:53:32 +01:00
Raúl Marín
7c14059f3f Update comments 2023-03-06 14:20:45 +01:00
Raúl Marín
13bda10470 Reimplement hints using the parser 2023-03-06 14:17:31 +01:00
Raúl Marín
eb2ed1b123 Add support for different expected errors 2023-03-06 12:31:54 +01:00
zvonand
f2fbf2d61e tcp protocol modification (min revision to be updated) 2023-03-06 02:52:05 +01:00
Alexander Tokmakov
edd238273c fix another bug in client 2023-03-02 19:51:05 +01:00
zvonand
a69425326d upd 2023-02-27 01:40:00 +01:00
zvonand
49fb028498 Merge branch 'master' of github.com:ClickHouse/ClickHouse into zvonand-implicit-tz 2023-02-26 17:20:09 +01:00
Azat Khuzhin
c8c8d4b42f Always bind Ctrl-T to reverse search (not only when skim is available)
This will avoid exceptions for fast tests

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-26 13:33:43 +01:00
zvonand
c3a6efe031 update 2023-02-24 20:51:12 +01:00
avogar
bf9f1663bb Fix totals and extremes with constants in clickhouse-local 2023-02-21 18:15:16 +00:00
Azat Khuzhin
f9cd66db36 Remove extra try/catch for LocalQueryState reset
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-18 10:55:09 +01:00
youennL-cs
6526c2a8ab
[RFC] Replacing merge tree new engine (#41005)
* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add keyword 'CLEANUP' when OPTIMIZE

* Cleanup uniquely when it's a replacingMergeTree

* Propagate CLEANUP information and change from 'with_cleanup' to 'cleanup'

* Cleanup data flagged as 'is_deleted'

* Fix merge when optimize and add a test

* Fix OPTIMIZE and INSERT + add tests

* New fix for cleanup at the merge

* Cleanup debug logs

* Add the SETTINGS option 'clean_deleted_rows' that can be 'never' or 'always'

* Fix regression bug; Now REplicatedMergeTree can be called as before without 'is_deleted'

* Add Replicated tests

* Disable tag 'long' for our test and cleanup some white spaces

* Update tests

* Fix tests and remove additional useless whitespace

* Fix replica test

* Style clean && add condition check for is_deleted values

* clean_deleted_rows settings is nom an enum

* Add valid default value to the clean_deleted_rows settings

* Update cleanup checkers to use the enum and fix typos in the test

* Fix submodule contrib/AMQP-CPP pointer

* Add missing messages in test reference and remove a print with non derterministic order

* fix replica test reference

* Fix edge case

* Fix a typo for the spell checker

* Fix reference

* Fix a condition to raise an error if is_deleted differ from 0/1 and cleanup

* Change tests file name and update number

* This should fix the ReplacingMergeTree parameter set

* Fix replicated parameters

* Disable allow_deprecated_syntax_for_merge_tree for our new column

* Fix a test

* Remove non deterministic order print in the test

* Test on replicas

* Remove a condition, when checking optional parameters, that should not be sueful since we disabled the deprected_syntaxe

* Revert "Remove a condition, when checking optional parameters, that should not be useful since we disabled the deprected_syntaxe"

This reverts commit b65d64c05e.

* Fix replica management and limit the number of argument to two maximum, due to the possiblity of deprecated table create/attach failing otherwise

* Test a fix for replicated log information error

* Try to add sync to have consistent results

* Change path of replicas that should cause one issue and add few prints in case it's not that

* Get cleanup info on replicas only if information found

* Fix style issues

* Try to avoid replication error 'cannot select parts...' and and replica read/write field order

* Cleanup according to PR reviews
 and add tests on error raised.

* Update src/Storages/MergeTree/registerStorageMergeTree.cpp

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>

* Select ... FINAL don't show rows with is_deleted = true

* Update and fix SELECT ... FINAL merge parameter

* Remove is_deleted rows only on the version inserted when merge

* Fix (master) updates issues

* Revert changes that should not be commited

* Add changes according to review

* Revert changes that should not be commited - part 2

---------

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 16:03:16 +03:00
Nikolay Degterinsky
3075656e1d Merge remote-tracking branch 'upstream/master' into HEAD 2023-02-15 10:06:44 +00:00
Antonio Andelic
8d16fe5793
Merge branch 'master' into add-support-for-settings-alias 2023-02-13 08:46:00 +01:00
Kruglov Pavel
e84baa9106
Merge pull request #43179 from tonickkozlov/tonickkozlov/add-interserver-dns-retries
CLICKHOUSE-2375 Add interserver DNS retries
2023-02-11 14:35:40 +01:00
Antonio Andelic
f96d480563
Merge branch 'master' into add-support-for-settings-alias 2023-02-09 16:07:45 +01:00
Azat Khuzhin
911fabd0dc Fix applying settings for FORMAT on the client
Previously the following query does not works correctly:

    SELECT number FROM numbers(5) SETTINGS output_format_json_array_of_rows = 1 FORMAT JSONEachRow

While this one works OK:

    SELECT number FROM numbers(5) FORMAT JSONEachRow SETTINGS output_format_json_array_of_rows = 1

The problem is in which AST those settings are stored, use the logic as
executeQuery() has to apply them:

  c83f701696/src/Interpreters/executeQuery.cpp (L467-L497)

Note, the only problem should be with the settings for FORMAT, since
client applies thoes settings (and formats) locally w/o server, while in
case of i.e. HTTP it will be applied on the server and everything will
works fine.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-07 18:29:40 +01:00
Antonio Andelic
12569da984 Merge branch 'master' into add-support-for-settings-alias 2023-02-05 16:08:57 +00:00
Alexey Milovidov
22bd0b6f69
Merge pull request #38983 from CurtizJ/randomize-mt-settings
Allow to randomize merge tree settings in tests
2023-02-04 02:59:52 +01:00
Nikita Mikhaylov
33877b5e00
Parallel replicas. Part [2] (#43772) 2023-02-03 14:34:18 +01:00
Azat Khuzhin
ef2bc589fa Avoid client prompt overlap after query fuzzy search
Under certain conditions it is possible for skim to overlap the prompt,
well, not overlap, but not re-render it, and so the client does not have
a nice prompt.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-02 19:31:45 +01:00
Anton Popov
d8fe2bcbaa
Merge branch 'master' into randomize-mt-settings 2023-01-27 16:03:00 +01:00
Anton Popov
92fa39798b Merge remote-tracking branch 'upstream/master' into HEAD 2023-01-26 13:29:23 +00:00
Alexander Tokmakov
3f6594f4c6 forbid old ctor of Exception 2023-01-23 22:18:05 +01:00
Alexander Tokmakov
70d1adfe4b
Better formatting for exception messages (#45449)
* save format string for NetException

* format exceptions

* format exceptions 2

* format exceptions 3

* format exceptions 4

* format exceptions 5

* format exceptions 6

* fix

* format exceptions 7

* format exceptions 8

* Update MergeTreeIndexGin.cpp

* Update AggregateFunctionMap.cpp

* Update AggregateFunctionMap.cpp

* fix
2023-01-24 00:13:58 +03:00
Anton Popov
08b2e524c7 Merge remote-tracking branch 'upstream/master' into HEAD 2023-01-23 15:34:53 +00:00
Azat Khuzhin
2a8f116c18 Forward declaration of ConcurrentBoundedQueue in ThreadStatus
ThreadStatus is the header that recomplies almost all ClickHouse
modules.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-01-21 16:02:09 +01:00
Alexander Tokmakov
870cfcc36a less fmt::runtime usages 2023-01-17 00:11:59 +01:00
Alexander Gololobov
263a3f10c9 Also copy or move PREWHERE to WHERE 2023-01-12 14:11:30 +01:00
Alexander Gololobov
2a92ae8d8e Fuzz PREWHERE clause 2023-01-12 13:14:09 +01:00
Anton Popov
ca80240d84 Merge remote-tracking branch 'upstream/master' into HEAD 2023-01-12 12:13:45 +00:00
Alexey Milovidov
1f45845e70 Fix (benign) data race in clickhouse-client 2023-01-09 08:49:21 +01:00
Nikolay Degterinsky
3a20fbdbf6 Better 2023-01-05 02:25:25 +00:00
Kruglov Pavel
966f57ef68
Merge pull request #42777 from Avogar/improve-streaming-engines
Refactor and Improve streaming engines Kafka/RabbitMQ/NATS and data formats
2023-01-02 15:59:06 +01:00
Nikolay Degterinsky
dfe93b5d82
Merge pull request #42284 from Algunenano/perf_experiment
Performance experiment
2022-12-30 03:14:22 +01:00
Kruglov Pavel
894726bd8f
Merge branch 'master' into improve-streaming-engines 2022-12-29 22:59:45 +01:00
Raúl Marín
5de11979ce
Unify query elapsed time measurements (#43455)
* Unify query elapsed time reporting

* add-test: Make shell tests executable

* Add some tests around query elapsed time

* Style and ubsan
2022-12-28 21:01:41 +01:00
Nikolay Degterinsky
e814179663 Add default password type 2022-12-28 13:26:23 +00:00
Azat Khuzhin
1f9a6076b9 Use DB::ReadBufferFromFile over std::ifstream in ReplxxLineReader
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-12-27 14:23:51 +01:00
Azat Khuzhin
b7f92454bf Move LineReader/ReplxxLineReader out from base
This will simplify linking dependencies, and anyway this classes are not
base in any sense.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-12-27 14:23:51 +01:00
Azat Khuzhin
83cad3625b Remove unused setTerminalEcho()
It had been replaced with readpassphrase in #5092

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-12-27 14:23:51 +01:00
Raúl Marín
45d27f461b
Merge branch 'master' into perf_experiment 2022-12-20 09:07:48 +00:00
Anton Popov
33dc0d8283 fix more tests 2022-12-16 17:50:01 +00:00
Anton Popov
b6f2754afb Merge remote-tracking branch 'upstream/master' into HEAD 2022-12-16 14:37:34 +00:00
Kruglov Pavel
c5b2e4cc23
Merge branch 'master' into improve-streaming-engines 2022-12-15 18:44:35 +01:00
Anton Popov
87e02a1744 Merge remote-tracking branch 'upstream/master' into HEAD 2022-12-14 02:08:10 +00:00
Nikolay Degterinsky
443bc3e656
Merge pull request #43719 from evillique/password_complexity_rules
Add password complexity rules
2022-12-13 17:56:45 +01:00
Nikolay Degterinsky
9b6d31b95d
Merge branch 'master' into perf_experiment 2022-12-13 17:15:07 +01:00
Nikolay Degterinsky
19e95e8cd8 Better implementation of password rules 2022-12-11 23:59:04 +00:00
Nikolay Degterinsky
f2c07c0337 Merge remote-tracking branch 'upstream/master' into password_complexity_rules 2022-12-10 00:46:05 +00:00
Anton Popov
0a951db1d0 fix more tests with random merge tree settings 2022-12-02 14:16:28 +00:00
Anton Popov
5d9077cdb6 Merge remote-tracking branch 'upstream/master' into HEAD 2022-12-02 12:06:45 +00:00
HarryLeeIBM
304e4a73d7 Fix setting TCP_KEEPAIDLE for s390x 2022-11-30 13:22:04 -08:00
Joanna Hulboj
d587a52afe FIXUP: PR comment 2022-11-27 11:38:43 +00:00
Joanna Hulboj
e360f85798 Added client option to display the number of locally processed rows 2022-11-27 11:38:43 +00:00
Nikolay Degterinsky
3fd10e0011 Better solution 2022-11-25 22:38:28 +00:00
Raúl Marín
4d3217cb18
Merge branch 'master' into perf_experiment 2022-11-24 10:32:12 +01:00
Kseniia Sumarokova
c81257c7e2
Merge pull request #43442 from kssenii/fix-progress-from-stdin
Show read rows for reading from stdin in client
2022-11-23 11:23:16 +01:00
Kseniia Sumarokova
b9b1d22d72
Update ClientBase.cpp 2022-11-21 15:04:37 +01:00
kssenii
10a258242d Fix progress from stdin 2022-11-21 14:11:51 +01:00
Azat Khuzhin
da8fe9c398 Fix possible heap-use-after-free in local if history file cannot be created
ASAN report:

    Code: 586. DB::ErrnoException: Cannot create file: /src/.clickhouse_history, errno: 2, strerror: No such file or directory. (CANNOT_CREATE_FILE)
    =================================================================
    ==1==ERROR: AddressSanitizer: heap-use-after-free on address 0x6240000208f0 at pc 0x000030d22ade bp 0x7ffff2ff3f70 sp 0x7ffff2ff3f68
    READ of size 8 at 0x6240000208f0 thread T2
        #0 0x30d22add in DB::ProcessList::insert() build_docker/../src/Interpreters/ProcessList.cpp:89:36
        #1 0x31411018 in DB::executeQueryImpl() build_docker/../src/Interpreters/executeQuery.cpp:516:60
        #2 0x3140e1ab in DB::executeQuery() build_docker/../src/Interpreters/executeQuery.cpp:1083:30
        #3 0x3364391e in DB::LocalConnection::sendQuery() build_docker/../src/Client/LocalConnection.cpp:119:21
        #4 0x3367bab0 in DB::Suggest::fetch() build_docker/../src/Client/Suggest.cpp:141:16
        #5 0x336820eb in void DB::Suggest::load<DB::LocalConnection>()::'lambda'()::operator()() const build_docker/../src/Client/Suggest.cpp:118:17

    0x6240000208f0 is located 2032 bytes inside of 7056-byte region [0x624000020100,0x624000021c90)
    freed by thread T0 here:

        #0 0xe381ef2 in operator delete(void*, unsigned long) (/wrk/clickhouse-asan+0xe381ef2) (BuildId: 6ea6d1a5d2d5a164f60f0fd8230936305bc8d9d0)
        #1 0x335509fe in DB::ClientBase::~ClientBase() build_docker/../src/Client/ClientBase.cpp:293:25
        #2 0x1f809bd5 in mainEntryClickHouseLocal(int, char**) build_docker/../programs/local/LocalServer.cpp:804:5
        #3 0xe3856ad in main build_docker/../programs/main.cpp:482:12
        #4 0x7ffff7dc0082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16

    previously allocated by thread T0 here:
        #0 0xe38128d in operator new(unsigned long) (/wrk/clickhouse-asan+0xe38128d) (BuildId: 6ea6d1a5d2d5a164f60f0fd8230936305bc8d9d0)
        #1 0x2f34a7f3 in std::__1::__unique_if<DB::ContextSharedPart>::__unique_single std::__1::make_unique[abi:v15003]<DB::ContextSharedPart>() build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:714:28
        #2 0x2f34a7f3 in DB::Context::createShared() build_docker/../src/Interpreters/Context.cpp:603:32
        #3 0x1f7f901d in DB::LocalServer::processConfig() build_docker/../programs/local/LocalServer.cpp:535:22
        #4 0x1f7f4d92 in DB::LocalServer::main() build_docker/../programs/local/LocalServer.cpp:419:5
        #5 0x3af24ffe in Poco::Util::Application::run() build_docker/../contrib/poco/Util/src/Application.cpp:334:8
        #6 0x1f809bca in mainEntryClickHouseLocal(int, char**) build_docker/../programs/local/LocalServer.cpp:803:20
        #7 0xe3856ad in main build_docker/../programs/main.cpp:482:12
        #8 0x7ffff7dc0082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16

    Thread T2 created by T0 here:
        #0 0xe32fedc in pthread_create (/wrk/clickhouse-asan+0xe32fedc) (BuildId: 6ea6d1a5d2d5a164f60f0fd8230936305bc8d9d0)
        #1 0x336806df in std::__1::__libcpp_thread_create[abi:v15003](unsigned long*, void* (*)(void*), void*) build_docker/../contrib/libcxx/include/__threading_support:376:10
        #2 0x336806df in std::__1:🧵:thread<void DB::Suggest::load<DB::LocalConnection>()::'lambda'(), void>() build_docker/../contrib/libcxx/include/thread:311:16
        #3 0x3367ff5b in void DB::Suggest::load<DB::LocalConnection>(std::__1::shared_ptr<DB::Context const>, DB::ConnectionParameters const&, int) build_docker/../src/Client/Suggest.cpp:110:22
        #4 0x3357fee9 in DB::ClientBase::runInteractive() build_docker/../src/Client/ClientBase.cpp:2066:22
        #5 0x1f7f5264 in DB::LocalServer::main() build_docker/../programs/local/LocalServer.cpp
        #6 0x3af24ffe in Poco::Util::Application::run() build_docker/../contrib/poco/Util/src/Application.cpp:334:8
        #7 0x1f809bca in mainEntryClickHouseLocal(int, char**) build_docker/../programs/local/LocalServer.cpp:803:20
        #8 0xe3856ad in main build_docker/../programs/main.cpp:482:12
        #9 0x7ffff7dc0082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-11-20 22:51:27 +01:00
Raúl Marín
97d6fc3071 Merge remote-tracking branch 'blessed/master' into perf_experiment 2022-11-17 11:48:46 +01:00
Nikolay Degterinsky
d48d4cf87e
Merge branch 'master' into query_parameters_inserts 2022-11-15 01:05:40 +01:00
Alexey Milovidov
127631ee47
Merge branch 'master' into perf_experiment 2022-11-12 18:58:25 +01:00
Yakov Olkhovskiy
60d116729c adjustments for progress option 2022-11-12 02:55:26 +00:00
Anton Kozlov
ccede70b5c
Merge branch 'master' into tonickkozlov/add-interserver-dns-retries 2022-11-11 14:54:30 +00:00
Anton Kozlov
024d9382c7 CLICKHOUSE-2375 Add interserver DNS retries 2022-11-11 14:47:26 +00:00
Nikolay Degterinsky
b0faecf75b Merge remote-tracking branch 'upstream/master' into query_parameters_inserts 2022-11-10 22:33:01 +00:00
Yakov Olkhovskiy
a5a1f5abf7 fix client.py - should use '--progress', return tests - they are working, fix help string 2022-11-10 07:33:54 +00:00
Nikolai Kochetov
3eb6c03b47 Disable clickhouse local and clickhouse client non-interactive progress by default. 2022-11-09 19:46:47 +00:00
Nikolay Degterinsky
2720cddeec Add support for interactive parameters in INSERT VALUES queries 2022-11-09 04:28:02 +00:00
Nikolay Degterinsky
9f7f1f05b6
Merge pull request #42634 from xiedeyantu/fix_progress_bar
Fix no progress indication on INSERT FROM INFILE
2022-11-08 03:58:38 +01:00
Alexey Milovidov
641f8576c6
Merge pull request #42003 from ClickHouse/write-progress-to-tty
Write progress directly to terminal
2022-11-05 16:51:37 +01:00
Kruglov Pavel
b124875257
Merge branch 'master' into improve-streaming-engines 2022-11-03 13:22:06 +01:00
Yakov Olkhovskiy
33f260f11f fix stule 2022-11-03 07:00:42 +00:00
Yakov Olkhovskiy
8f6f0b26a0 do not post progress to redirected stderr, adjust tests 2022-11-03 06:49:50 +00:00
Yakov Olkhovskiy
170670da59 fallback to stderr 2022-11-03 03:28:57 +00:00
Yakov Olkhovskiy
b30f2ac12d allow '--progress err' to preserve old behavior, adjust tests 2022-11-03 03:16:55 +00:00
Anton Popov
d09039418f Merge remote-tracking branch 'upstream/master' into HEAD 2022-10-28 14:35:45 +00:00
Raúl Marín
6e0a9452e7 Merge remote-tracking branch 'blessed/master' into perf_experiment 2022-10-25 15:25:06 +02:00
xiedeyantu
163001382b Fix no progress indication on INSERT FROM INFILE 2022-10-25 09:43:29 +08:00
Alexey Milovidov
8eb751fbe5 Fix error 2022-10-23 05:28:28 +02:00
Alexey Milovidov
c386898268 Fix error 2022-10-23 04:46:07 +02:00
Alexey Milovidov
cd43595ea9 Merge branch 'master' into write-progress-to-tty 2022-10-23 01:41:17 +02:00
Azat Khuzhin
56bc85746f Merge remote-tracking branch 'upstream/master' into build/shorten-64-to-32
Conflicts:
- src/Interpreters/ProcessList.cpp
2022-10-22 16:49:08 +02:00
Azat Khuzhin
905a95e166 Review fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-21 22:40:13 +02:00
Azat Khuzhin
4e76629aaf Fixes for -Wshorten-64-to-32
- lots of static_cast
- add safe_cast
- types adjustments
  - config
  - IStorage::read/watch
  - ...
- some TODO's (to convert types in future)

P.S. That was quite a journey...

v2: fixes after rebase
v3: fix conflicts after #42308 merged
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-21 13:25:19 +02:00
Alexey Milovidov
ee5f5a4cb4 Unfathomable amount of trash 2022-10-21 05:33:17 +02:00
Alexey Milovidov
fabc8f5a18 Remove support for {database} macro from the client's prompt 2022-10-19 23:27:12 +02:00
Kruglov Pavel
1b27c7ebe0
Merge pull request #42130 from azat/dist/EINTR-fix
Fix possible timeout exception for distributed queries with use_hedged_requests=0
2022-10-19 22:00:38 +02:00
Raúl Marín
e60415d07d Make clang-tidy happy 2022-10-18 11:40:12 +02:00
Anton Popov
1a9d190788 replace table name in fuzzer more often 2022-10-17 21:08:27 +00:00
Ilya Yatsishin
7fa7e1d822
Merge pull request #38519 from qoega/ast-fuzzer-where 2022-10-15 14:30:40 +02:00
Kruglov Pavel
7980920bd7
Merge branch 'master' into fix-format-row 2022-10-14 20:49:21 +02:00
FArthur-cmd
b6304c46d4 move default settings to different part of ast 2022-10-11 18:25:28 +00:00
Ilya Yatsishin
f764f4ce19
Update src/Client/QueryFuzzer.cpp 2022-10-08 08:20:17 +02:00
Yatsishin Ilya
e1859e9ee8 fix style 2022-10-07 12:43:20 +00:00
Yatsishin Ilya
f545aa1415 Merge remote-tracking branch 'origin/master' into ast-fuzzer-where 2022-10-07 12:12:27 +00:00
Yatsishin Ilya
81aec3c340 Grouping sets, rollup, cube, totals can be only with GROUP BY 2022-10-07 11:39:47 +00:00
Azat Khuzhin
20dbf5eb34 Fix possible timeout exception for distributed queries with use_hedged_requests=0
In case of possible EINTR (i.e. query profiler) it is possible for
select() from getReplicaForReading() (this is the stage when the
initiator is waiting for Cancel packet from the remote shards, that can
be sent in case of enough rows was read, or the query had been cancelled
explicitly) to return without any sockets ready, and
getReplicaForReading() will assume that the timeout happened.

Here is a stacktrace example:

    [ 59205 ] {04f3d3a4-7346-4ef2-bf57-928f9e55ed89} <Error> TCPHandler: Code: 159. DB::Exception: Received from b8:9000. DB::Exception: Timeout (-1000 ms) exceeded while reading from . Stack trace:

    0. Poco::Exception::Exception() @ 0x17e26eac in /usr/bin/clickhouse
    1. DB::Exception::Exception() @ 0xb550b9a in /usr/bin/clickhouse
    2. DB::Exception::Exception<>() @ 0x15ad1c81 in /usr/bin/clickhouse
    3. DB::MultiplexedConnections::getReplicaForReading(bool) @ 0x15ad16fc in /usr/bin/clickhouse
    4. DB::MultiplexedConnections::receivePacketUnlocked() @ 0x15ad02fd in /usr/bin/clickhouse
    5. DB::MultiplexedConnections::drain() @ 0x15ad0df8 in /usr/bin/clickhouse
    6. DB::ConnectionCollector::drainConnections(DB::IConnections&, bool) @ 0x1443c205 in /usr/bin/clickhouse
    7. DB::RemoteQueryExecutor::finish() @ 0x1445ea6a in /usr/bin/clickhouse

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-06 18:20:33 +02:00
Azat Khuzhin
4f268cb414 Fix exception message on timeout (host was missing)
Previously before the exception there is a loop for disconnecting, so
dumpAddress* will not return anything, fix this, by saving the
addresses before.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-06 18:14:53 +02:00
Robert Schulze
da5a2e2db0
Merge remote-tracking branch 'origin/master' into generated-file-cleanup
Physical merge conflicts:
- src/Common/ZooKeeper/ZooKeeperImpl.cpp
- src/Core/config_core.h.in
- src/Functions/FunctionsAES.h
- src/Functions/config_functions.h.in
- src/configure_config.cmake

Logical merge conflicts:
- Functions/tryDecrypt.cpp
2022-10-06 08:43:25 +00:00
Yatsishin Ilya
533b813c8e better 2022-10-05 12:42:45 +00:00
Yatsishin Ilya
f3a74f0169 Added fuzzer for WHERE and more cases in GROUP BY 2022-10-05 12:42:45 +00:00
Alexey Milovidov
eef40ce884 Some attempt 2022-10-05 02:29:52 +02:00
Anton Popov
8ca73eab03
Merge branch 'master' into fuzz-table-definitions 2022-10-04 15:10:31 +02:00
Anton Popov
59605a6c7e
Apply suggestions from code review
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
2022-10-04 13:40:59 +02:00
Robert Schulze
db5ef7b3cb
Merge branch 'master' into generated-file-cleanup 2022-10-02 23:13:18 +02:00
Alexey Milovidov
bc473f4ec0 Something 2022-10-02 16:08:33 +02:00
Alexey Milovidov
90b9afab21 Remove useless code 2022-10-02 01:50:36 +02:00
Alexey Milovidov
5be163b646 Fix comment 2022-10-02 01:24:27 +02:00
Alexey Milovidov
8b84788d08 Fix error 2022-10-02 00:38:41 +02:00
Alexey Milovidov
5d710e21f1 Render progress directly in tty 2022-10-01 23:19:36 +02:00
Anton Popov
a3009ed9e4 fix clang-tidy 2022-09-30 13:54:05 +00:00
Anton Popov
14119fc306 more often mutations for complex type 2022-09-28 21:10:41 +00:00
Anton Popov
986f00f6d9 clear fuzzed tables after drop 2022-09-28 21:06:50 +00:00
Anton Popov
34bc16cd5b avoid more useless errors 2022-09-28 15:55:39 +00:00
Anton Popov
4ac5df2540 drop all fuzzed tables 2022-09-28 14:52:10 +00:00
Robert Schulze
f24fab7747
Fix some #include atrocities 2022-09-28 13:49:28 +00:00
avogar
c353928eb5 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-format-row 2022-09-28 13:15:51 +00:00
Robert Schulze
6d70b4a1f6
Generate config_version.h into ${CONFIG_INCLUDE_PATH}
This makes the target location consistent with other auto-generated
files like config_formats.h, config_core.h, and config_functions.h and
simplifies the build of clickhouse_common.
2022-09-28 12:48:26 +00:00
Robert Schulze
78fc36ca49
Generate config.h into ${CONFIG_INCLUDE_PATH}
This makes the target location consistent with other auto-generated
files like config_formats.h, config_core.h, and config_functions.h and
simplifies the build of clickhouse_common.
2022-09-28 12:48:26 +00:00
Anton Popov
c8beae8237 Merge remote-tracking branch 'upstream/master' into HEAD 2022-09-28 12:47:02 +00:00
Yakov Olkhovskiy
7c94f98f6a
Merge pull request #37961 from ClibMouse/Kusto-phase1
Kusto phase1
2022-09-27 12:42:15 -04:00
Kseniia Sumarokova
caf6a99f41
Merge pull request #41011 from kssenii/fix-thread-status
Fix incorrect attach query in threadpool readers, get rid of static threadpools for reads/writes, make threadpool size for reads/writes configurable
2022-09-27 11:35:07 +02:00
Nikita Mikhaylov
e897816572
Evict stale DNS entries from cache in case of network errors (#41707) 2022-09-25 14:06:13 +02:00
kssenii
ab702e43fc Merge remote-tracking branch 'upstream/master' into fix-thread-status 2022-09-23 15:21:33 +02:00
avogar
22560698a8 Fix tests 2022-09-21 16:53:39 +00:00
avogar
f956e7915e Fix tests 2022-09-20 20:37:30 +00:00
Yong Wang
ec852b3faa Kusto-phase1 : change the parser in ClientBase from shared_ptr to unique_ptr 2022-09-18 20:38:07 -07:00
Yong Wang
4e4a04c08b
Merge branch 'ClickHouse:master' into Kusto-phase1 2022-09-18 21:40:30 -04:00
Alexey Milovidov
791de6592b Remove trash from Field 2022-09-18 05:16:08 +02:00
Alexey Milovidov
ada7a44ae4 Remove -WithTerminatingZero methods 2022-09-17 05:34:18 +02:00
Kruglov Pavel
3396ff6c3a
Merge pull request #40516 from zjial/record_errors_for_import_by_csv
Record errors while reading text formats (CSV, TSV).
2022-09-14 12:52:32 +02:00
kssenii
52ef3758c4 Merge remote-tracking branch 'upstream/master' into fix-thread-status 2022-09-13 16:34:31 +02:00
Alexander Tokmakov
54001d3871
Revert "Fix uncaught DNS_ERROR on failed connection to replicas" 2022-09-13 13:51:09 +03:00
Kseniia Sumarokova
b2c9c04c7b
Merge pull request #40821 from kssenii/improve-marks-cache-loading
Allow to load marks in threadpool in advance
2022-09-13 12:31:58 +02:00
kssenii
b7d751b782 Merge remote-tracking branch 'upstream/master' into improve-marks-cache-loading 2022-09-11 13:23:30 +02:00
Alexey Milovidov
fa62c7e982 Fix half of trash 2022-09-10 04:08:16 +02:00
zhenjial
469ceaa156 code optimization 2022-09-09 00:47:43 +08:00
Kruglov Pavel
04aea19b31
Merge pull request #40881 from coelho/patch-1
Fix uncaught DNS_ERROR on failed connection to replicas
2022-09-08 13:32:45 +02:00
kssenii
66d65df193 Fix thread status destruction order for clickhouse-local 2022-09-07 20:17:36 +02:00
kssenii
487bc0fba3 Fix heap use after free 2022-09-06 16:50:58 +02:00
zhenjial
0f788d98f5 new implementation 2022-09-06 20:39:54 +08:00
zhenjial
3c43b8ac43 just use file to store errors 2022-09-06 17:20:00 +08:00
zhenjial
18db90dcfc Record errors while reading text formats (CSV, TSV). 2022-09-06 17:19:15 +08:00
Yong Wang
2ca54d12ee
Merge branch 'ClickHouse:master' into Kusto-phase1 2022-09-05 17:42:38 -04:00
Antonio Andelic
e64436fef3 Fix typos with new codespell 2022-09-02 08:54:48 +00:00
Frank Chen
9d63cbe811 Merge 'origin/master' into tracing_context_propagation to resolve conflicts 2022-09-01 23:18:59 +08:00
Robert Coelho
19097c433d
fix compile error 2022-09-01 01:34:41 -04:00
Robert Coelho
e0597700eb
Fix uncaught DNS_ERROR on failed connection to replicas
DNS_ERROR would cause the replica to not be marked as unusable, resulting in the replica being repeatedly reattempted on subsequent queries and for connection failover to break.
(This is common in Kubernetes setups where a replica has failed and it's DNS record is returning NXDOMAIN)

On SELECT, would additionally result in an intermittent query error if the failed replica is chosen:
"Code: 198. DB::Exception: Received from localhost:9000. DB::Exception: Not found address of host: chi-clickhouse-main-2-0: While executing Remote. (DNS_ERROR)"
2022-08-31 20:34:14 -04:00
Robert Schulze
7a4978e600
docs: mention where else shortcuts are used 2022-08-30 17:00:25 +00:00
Robert Schulze
413a5759e1
style: eliminate some newlines
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-08-30 17:00:20 +00:00
Robert Schulze
9baf0d745a
feat: make last command available in clickhouse-client interactive mode 2022-08-30 16:59:14 +00:00
Frank Chen
92f7ca3616 Move TracingContextOnThread::current() out of class for simplicity
Signed-off-by: Frank Chen <frank.chen021@outlook.com>
2022-08-25 20:23:56 +08:00