Commit Graph

751 Commits

Author SHA1 Message Date
Azat Khuzhin
8782873e4f Fix overrides via connections_credentials in case of root directives exists
Before the following did not work, it always uses user `dev`, even with
`clickhouse-client --connection prod`:

  ```yaml
  user: dev

  connections_credentials:
    prod:
      name: prod
      user: prod
  ```

The problem was that before it was not possible to distinguish options
that had been set via command line options and via configuration file.

I've splitted this two actions, and embedded a call to
parseConnectionsCredentials() in between.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-27 20:03:50 +02:00
Azat Khuzhin
4cb3de3110 Add pager property into ClientBase
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-16 22:31:55 +02:00
Azat Khuzhin
3257d5643d Move adjusting input_format_values_allow_data_after_semicolon into the client base
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-16 22:31:55 +02:00
Azat Khuzhin
2cbb069b68 Add ability to ignore data after semicolon in Values format
This is required for client, to handle comments in multiquery mode.

v0: separate context for input format
v2: cannot use separate context since params and stuff are changed in global context
v3: do not sent this setting to the server (breaks queries for readonly profiles)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-10-12 14:55:26 +02:00
Yong Wang
16f992a06e Kusto-phase2: remove fuzzing test from KQL 2023-10-10 23:50:58 -07:00
Yong Wang
8c9da6bacf Merge remote-tracking branch 'origin/master' into Kusto-phase2-oss-pr 2023-09-27 22:35:14 -07:00
Robert Schulze
cde10fe7b5
Merge remote-tracking branch 'rschu1ze/master' into clang-tidy-reenable-checks 2023-09-26 18:59:41 +00:00
George Gamezardashvili
0ce30ab6d5
SSH keys authentication (#41109)
Added new type of authentication based on SSH keys. It works only for Native TCP protocol.

Co-authored-by: Nikita Mikhaylov <nikitamikhaylov@clickhouse.com>
Co-authored-by: Robert Schulze <robert@clickhouse.com>
2023-09-26 17:50:19 +02:00
Robert Schulze
9fff447716
Re-enable clang-tidy checks 2023-09-26 09:34:12 +00:00
Yong Wang
c936c08835 Kusto-phase2: fix the CMakeList files 2023-09-25 13:43:01 -07:00
Robert Schulze
11fea581bc
Fix tests 2023-09-04 15:34:42 +00:00
Yong Wang
e5f968b0d8 Kusto-phase2: enabled fuzzing test for dialect prql 2023-08-26 07:40:40 -07:00
Yong Wang
1ec574057a Kusto-phase2: fixed some functional test 2023-08-26 07:40:40 -07:00
Larry Luo
4f02667861 Fix AST Fuzzer 2023-08-26 07:40:39 -07:00
Alexey Gerasimchuck
3140958132 Added client_info validation 2023-08-22 03:52:57 +00:00
Michael Kolupaev
dfdf5de972 Fixes 2023-07-25 10:16:28 +00:00
Vitaly Baranov
815a3857de Remove non-const function Context::getClientInfo(). 2023-07-17 15:02:07 +02:00
Alexey Gerasimchuck
3218624461
Merge branch 'master' into ADQM-956 2023-07-04 11:47:24 +10:00
Sema Checherinda
d4d85d9fe9 add explicit finalize calls 2023-06-26 16:03:47 +02:00
Alexey Gerasimchuck
25948cdd9e Added ASK_PASSWORD client constant 2023-06-19 03:57:38 +00:00
zvonand
4155d13d69 merge master and resolve conflict 2023-06-16 02:20:32 +02:00
zvonand
e60506f41b changes requested in review 2023-06-16 02:16:04 +02:00
Alexey Gerasimchuck
75e6b4475d corrections after review 2023-06-14 22:35:38 +00:00
Alexey Gerasimchuck
a6420ee338
Merge branch 'master' into ADQM-934 2023-06-15 08:25:24 +10:00
Alexey Gerasimchuck
1f76d08743 fixed --password "" --password issue 2023-06-14 02:24:45 +00:00
Alexey Gerasimchuck
f1b5d47ce2 corrections after second review iteration 2023-06-14 01:26:39 +00:00
Alexey Gerasimchuck
d0938e95e6 prohibited to use --connection 2023-06-09 06:40:57 +00:00
Alexey Gerasimchuck
7578203b46 Changes after review 2023-06-09 03:44:43 +00:00
Alexey Gerasimchuck
23a3026836 Implemented connection string 2023-06-07 03:16:29 +00:00
Andrey Zvonov
2e427ee028
Merge branch 'master' into zvonand-implicit-tz 2023-06-02 01:15:56 +03:00
Andrey Zvonov
87fc780c14
Merge branch 'master' into zvonand-implicit-tz 2023-05-30 13:13:46 +03:00
zvonand
d4cec1f0e0 fix client thread attachment + make better tests 2023-05-30 01:30:01 +02:00
Alexey Gerasimchuck
8574559e23 Disallow usage of --query and --queries-file 2023-05-28 22:25:40 +00:00
Alexey Gerasimchuck
ab5e16a713 Changes after second review iteration 2023-05-23 00:27:17 +00:00
Alexey Gerasimchuck
4a6c7254e8 --multiquery <sql> -> -n -q <sql> syntax sugar 2023-05-17 03:43:35 +00:00
Andrey Zvonov
9237b904be
Merge branch 'master' into zvonand-implicit-tz 2023-05-10 01:25:33 +02:00
Nikolay Degterinsky
b7d8c99fbe Fix member call on null pointer in fuzzer 2023-05-09 13:12:11 +00:00
zvonand
8338d54c34 Merge branch 'master' of github.com:ClickHouse/ClickHouse into zvonand-implicit-tz 2023-05-05 15:50:26 +02:00
Alexey Milovidov
98ae9be734
Revert "Added tests for ClickHouse apps help and fixed help issues" 2023-04-21 01:54:34 +03:00
Andrey Zvonov
984e8fde41
Merge branch 'master' into zvonand-implicit-tz 2023-04-20 23:13:17 +02:00
zvonand
daae5025e8 small updates due to review 2023-04-19 14:45:51 +02:00
zvonand
daef5d818a fix according to updates in ThreadStatus.h 2023-04-12 15:31:58 +02:00
zvonand
2a9f28b73b resolve 2023-04-12 12:54:39 +02:00
Yatsishin Ilya
b5b65d2149 Merge remote-tracking branch 'origin' into clickhouse-help 2023-04-11 11:24:48 +00:00
Vasily Nemkov
e36addb96a Hackish way of setting up timezone on the client
Warning: lots of debug logging
2023-04-11 13:03:03 +02:00
Nikolay Degterinsky
3b9e8a8630 Override user and password environment variables with client parameters 2023-04-05 19:40:43 +00:00
Yatsishin Ilya
d4304d2028 Merge remote-tracking branch 'origin/master' into clickhouse-help 2023-03-02 16:16:18 +00:00
Nikolay Degterinsky
af992ca2db
Better 2023-02-22 16:51:36 +01:00
Nikolay Degterinsky
cdbff57e6c
Ask for password interactively 2023-02-22 15:58:06 +01:00
Yatsishin Ilya
80857638c1 Merge remote-tracking branch 'origin/master' into clickhouse-help 2023-02-22 13:58:17 +00:00
Azat Khuzhin
2dbcfdbe15 Allow to override host for client connection credentials
Introduce new `--connection` option, by default as a connection name
`--host` will be used.

And using --connection you also can specify --host and it will be
overwritten.

Follow-up for: #45715
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-16 14:26:24 +01:00
Yatsishin Ilya
1baa15d603 Merge remote-tracking branch 'origin/master' into clickhouse-help 2023-02-07 15:46:59 +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
Yatsishin Ilya
f4cfd8a2d9 Merge remote-tracking branch 'origin' into clickhouse-help 2023-02-03 20:08:23 +00:00
Yatsishin Ilya
98edb9f06b Update help for clickhouse tools and add test 2023-01-31 12:19:37 +00:00
Azat Khuzhin
4564a1ef29 Add ability to override connection settings based on connection names
This is somehow analog of .netrc [1].

  [1]: https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html

The follow options can be overwritten on a per-hostname/connection
basis:
- hostname
- port
- secure
- user
- password
- database
- history_file

Also note, that you can have multiple settings for one hostname, can be
useful to distinguish readonly from non-readonly for example.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-01-28 17:01:12 +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
ca80240d84 Merge remote-tracking branch 'upstream/master' into HEAD 2023-01-12 12:13:45 +00:00
Nikolay Degterinsky
dfe93b5d82
Merge pull request #42284 from Algunenano/perf_experiment
Performance experiment
2022-12-30 03:14:22 +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
Raúl Marín
45d27f461b
Merge branch 'master' into perf_experiment 2022-12-20 09:07:48 +00:00
Anton Popov
b6f2754afb Merge remote-tracking branch 'upstream/master' into HEAD 2022-12-16 14:37:34 +00: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
5d9077cdb6 Merge remote-tracking branch 'upstream/master' into HEAD 2022-12-02 12:06:45 +00:00
Nikolay Degterinsky
a7eed2fd6d Throw an exception if something is broken 2022-12-01 02:59:35 +00:00
Alexey Milovidov
72bf1115e9
Merge branch 'master' into password-reset-message 2022-11-29 23:51:46 +01:00
Nikolay Degterinsky
b675898d37 Small naming fix 2022-11-29 16:36:05 +00:00
Azat Khuzhin
c35eb86a37 Fix example of colored prompt in client
After switching to replxx you don't need the following anymore:
- RL_PROMPT_START_IGNORE (\001)
- RL_PROMPT_END_IGNORE   (\002)

And those symbols also breaks the client prompt (the text length
calculated incorrectly, it does not interpret "\x01" as an escape
sequence but instead just a bunch of bytes and shows extra whitespaces
after prompt).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-11-27 20:30:00 +01:00
Nikolay Degterinsky
3fd10e0011 Better solution 2022-11-25 22:38:28 +00:00
Alexey Milovidov
c20dbb7770 Move password reset message from client to server 2022-11-22 19:34:38 +01:00
Raúl Marín
ad95846b2b AST fuzzer: Print data of INSERT VALUES 2022-11-22 13:10:53 +01:00
Yakov Olkhovskiy
60d116729c adjustments for progress option 2022-11-12 02:55:26 +00:00
Nikolai Kochetov
3eb6c03b47 Disable clickhouse local and clickhouse client non-interactive progress by default. 2022-11-09 19:46:47 +00: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
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
Alexey Milovidov
cd43595ea9 Merge branch 'master' into write-progress-to-tty 2022-10-23 01:41:17 +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
fabc8f5a18 Remove support for {database} macro from the client's prompt 2022-10-19 23:27:12 +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
Anton Popov
8ca73eab03
Merge branch 'master' into fuzz-table-definitions 2022-10-04 15:10:31 +02:00
Alexey Milovidov
5d710e21f1 Render progress directly in tty 2022-10-01 23:19:36 +02:00
Robert Schulze
cc92a2d174
Merge branch 'master' into generated-file-cleanup 2022-09-30 09:56:31 +02:00
Anton Popov
c97bec829a slightly better 2022-09-28 21:47:10 +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
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
Anton Popov
c8beae8237 Merge remote-tracking branch 'upstream/master' into HEAD 2022-09-28 12:47:02 +00:00
Yakov Olkhovskiy
1d6c6c7144
change to --accept-invalid-certificate 2022-09-25 20:54:04 -04:00
Yakov Olkhovskiy
57e875d08c add parameter --accept-certificate, set appropriate invalid certificate handling 2022-09-24 04:46:19 +00:00
Alexey Milovidov
bac578b23a
Merge pull request #41428 from ClickHouse/remove-dlopen
Remove `dlopen`
2022-09-18 00:09:57 +03:00
Alexey Milovidov
ada7a44ae4 Remove -WithTerminatingZero methods 2022-09-17 05:34:18 +02:00
Alexey Milovidov
35cce03125 Remove dlopen 2022-09-17 03:02:34 +02:00
Antonio Andelic
e64436fef3 Fix typos with new codespell 2022-09-02 08:54:48 +00:00
Robert Schulze
e8b3f56733
Limit suppression to a specific warning 2022-08-21 18:24:17 +00:00
Alexey Milovidov
74e1f4dc61 Fix clang-tidy 2022-08-20 17:09:20 +02:00
Nikita Taranov
17956cb668
Extend protocol with query parameters (#39906) 2022-08-12 14:28:35 +02:00
Anton Popov
0383250383 execute DROP queries for fuzzed tables 2022-08-12 00:32:21 +00:00
Anton Popov
e347fa2f45 add fuzzer for table definition 2022-08-11 02:34:10 +00:00
Anton Popov
4f2c73f9f6 Merge remote-tracking branch 'upstream/master' into HEAD 2022-08-04 23:08:15 +00:00
Vitaly Baranov
da0bdd474b Fix code style. 2022-07-21 10:48:53 +02:00
Vitaly Baranov
8873d16afe Fix interactive client with older server after https://github.com/ClickHouse/ClickHouse/pull/38970 2022-07-20 11:51:55 +02:00
Vitaly Baranov
fbb2e14d54 Add new table function viewIfPermitted(). 2022-07-15 15:44:29 +02:00
Anton Popov
14a3c7b8cf print changed MergeTree settings on fail 2022-07-13 20:57:24 +00:00
Anton Popov
499262dba9 allow to randomize merge tree settings 2022-07-07 22:16:01 +00:00
Alexey Milovidov
7e9a3796e9 Fix wrong docs 2022-06-21 00:09:55 +02:00
Azat Khuzhin
29a8a00656 Add ability to pass QueryKind via clickhouse-client/local (useful for debugging)
v2: fix LocalConnection::sendQuery() for Suggest (comes w/o client_info) [1]
    [1]: https://s3.amazonaws.com/clickhouse-test-reports/37290/7c85175963226ff78eec542efafcff4e650aa0f0/stateless_tests__ubsan__actions_.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-19 07:19:27 +03:00
Robert Schulze
e3cfec5b09
Merge remote-tracking branch 'origin/master' into clangtidies 2022-05-16 10:12:50 +02:00
kssenii
61f2737e17 Merge master 2022-05-10 19:31:22 +02:00
kssenii
0feda67ec4 Fix progress for insert select 2022-05-10 15:04:08 +02:00
Robert Schulze
1b81bb49b4
Enable clang-tidy modernize-deprecated-headers & hicpp-deprecated-headers
Official docs:

  Some headers from C library were deprecated in C++ and are no longer
  welcome in C++ codebases. Some have no effect in C++. For more details
  refer to the C++ 14 Standard [depr.c.headers] section. This check
  replaces C standard library headers with their C++ alternatives and
  removes redundant ones.
2022-05-09 08:23:33 +02:00
Alexey Milovidov
a121155f0a Fix conflict 2022-05-07 12:38:30 +02:00
Alexey Milovidov
1bdc51a496 Merge branch 'remind_for_external_option' of github.com:bigo-sg/ClickHouse into bigo-sg-remind_for_external_option 2022-05-07 12:36:57 +02:00
Robert Schulze
89aa9ae00f
Fixed clang-tidy check "bugprone-branch-clone"
The check is currently *not* part of .clang-tidy. It complains about:
(1) "switch has multiple consecutive identical branches"
(2) "repeated branch in conditional chain"

About (1): Lots of findings in switches were about redundant
"[[fallthrough]]" in places where the compiler would not warn anyways. I
have cleaned these up.

About (2): In if-else_if-else chains, fixing the warning would usually
mean concatenating multiple if-conditions. As this would reduce
readability in most cases, I did not fix these places.

Because of (2), I also refrained from adding "bugprone-branch-clone" to
.clang-tidy.
2022-04-30 19:40:28 +02:00
Amos Bird
4a5e4274f0
base should not depend on Common 2022-04-29 10:26:35 +08:00
Suzy Wang
59f0e83c4b
fix clang tidy warning, add nullptr check (#35540)
update passing reference instead of pointer in queryHasWithClause based on recommandation

Co-authored-by: larryluogit <larry.luo@ca.ibm.com>
2022-04-20 11:26:44 +02:00
Anton Popov
13cb564d1e
Merge pull request #35716 from kssenii/fix-local-logs-level
Fix send_logs_level for clickhouse local
2022-04-06 18:52:47 +02:00
Kseniia Sumarokova
d3763c4a62 Update ClientBase.h 2022-04-06 12:13:34 +02:00
Alexey Milovidov
3c0c1a1176 Add a comment #35919 2022-04-05 18:35:23 +02:00
Alexey Milovidov
e452949334
Merge pull request #35919 from DevTeamBK/clang-tidy-issues
Clang tidy issues
2022-04-05 19:31:09 +03:00
Meena Renganathan
cf71b18472 Modified the code to fix the getenv() call issue idenitified in the clang-tidy 2022-04-04 07:23:31 -07:00
Denny Crane
0722beca0c
Update Client.cpp 2022-03-30 08:45:30 -03:00
李扬
b84904b8a6
Update Client.cpp 2022-03-23 22:01:29 +08:00
taiyang-li
1114c54899 merge master and fix conflict 2022-03-23 11:03:25 +08:00
mergify[bot]
5295dd0ef2
Merge branch 'master' into stress-test 2022-03-17 11:10:37 +00:00
Kruglov Pavel
ea5ace7b18
Merge pull request #35309 from Avogar/fix-client-host-help
Fix disappeared host and port from client help message
2022-03-16 12:24:07 +01:00
Vladimir C
e022245a33
Merge pull request #35193 from vdimir/issue-34776 2022-03-15 19:56:09 +01:00
avogar
96c6a4b401 Fix disappeared host and port from client help message 2022-03-15 18:36:54 +00:00
vdimir
db46c2ada8
Fix reading port from config 2022-03-14 11:58:47 +00:00
kssenii
199188be08 Support test mode for clickhouse-local 2022-03-14 12:02:06 +01:00
taiyang-li
4f15955670 fix conflicts 2022-03-08 11:32:22 +08:00
taiyang-li
2283513fc8 merge master and solve conflict 2022-03-08 11:29:00 +08:00
Kruglov Pavel
dbba752398
Merge branch 'master' into stress-test 2022-03-04 18:33:37 +03:00
mergify[bot]
c90d24e10b
Merge branch 'master' into random-settings 2022-03-03 13:07:12 +00:00
avogar
d25d83580a Fix tests 2022-03-02 16:33:21 +00:00
freedomDR
43ac214dc5 get credentials from environment variables for clickhouse-client
include CLICKHOUSE_USER, CLICKHOUSE_PASSWORD
2022-03-02 00:54:51 +00:00
李扬
f2ce7cbc8f
Update Client.cpp 2022-03-01 19:29:59 +08:00
taiyang-li
7f69507c95 finish dev 2022-03-01 17:22:12 +08:00
mergify[bot]
8014cdf9d3
Merge branch 'master' into random-settings 2022-02-28 14:06:22 +00:00
vdimir
dfc990aed4
Fix using host/port from config for client 2022-02-21 12:08:23 +00:00
avogar
ba7f723961 Fix comments 2022-02-18 13:54:21 +00:00
Kruglov Pavel
e77319bf01
Merge branch 'master' into stress-test 2022-02-17 20:28:46 +03:00
avogar
1e797c1a8f Fix some tests 2022-02-16 15:10:02 +00:00