Commit Graph
46 Commits
Author SHA1 Message Date
Alexey MilovidovandGitHub 842b133f8d Merge pull request #100399 from ClickHouse/clang-tidy-init-variables
Enable clang-tidy check for uninitialized variables
2026-05-31 21:56:29 -07:00
Alexey Milovidov a4a69d3774 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Client/BuzzHouse/Generator/QueryOracle.h
#	src/Functions/hilbertEncode.cpp
#	src/Interpreters/ProfileEventsExt.h
#	src/Storages/Statistics/ConditionSelectivityEstimator.cpp
#	src/Storages/Statistics/Statistics.cpp
#	src/Storages/Statistics/tests/gtest_stats.cpp
2026-05-19 16:20:47 +00:00
Alexey Milovidov 7a2f9f408a Merge remote-tracking branch 'origin/master' into fix-compiler-warnings 2026-05-19 15:05:56 +00:00
Raúl MarínandClaude Opus 4.7 88cf709ca1 Share shellQuote and apply it to remaining shell sinks
Move the `shellQuote` helper out of `clickhouse install` into
`Common/shellQuote.h` so it can be reused. Apply it to two more
shell-command construction sites:

- `formatWithSudo` on FreeBSD wraps the inner command in `su -c '...'`.
  All current callers pass static literals, but an embedded single
  quote would break the wrapper. Quote the command via `shellQuote`
  so future callers can pass arbitrary strings safely.
- `clickhouse git-import` interpolates a commit hash parsed from
  `git log --pretty=%H` into `git show ... {hash}` and runs it via
  `/bin/sh -c`. `%H` is hex-only today, but a hand-crafted hash list
  or a future format change should not be able to inject shell
  syntax through the input.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-18 14:50:27 +00:00
Alexey Milovidov 9567f0d9ba Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Processors/QueryPlan/Optimizations/Optimizations.h
#	src/Storages/MaterializedView/RefreshTask.cpp
2026-05-08 03:15:33 +00:00
Alexey Milovidov 7d54e33c7c Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	programs/main.cpp
2026-05-06 03:18:15 +00:00
Alexey MilovidovandClaude Opus 4.6 8b47d200d5 Enable -Wmissing-prototypes compiler warning
Add `static` to file-local functions and forward declarations
for cross-TU functions to satisfy `-Wmissing-prototypes`.

This ensures all functions have visible prototypes before their
definitions, improving code quality and catching accidental
linkage issues.

Reference: https://github.com/ClickHouse/ClickHouse/issues/76944

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-27 20:11:07 +00:00
Alexey MilovidovandClaude Opus 4.6 d249cd3f9d Fix clang-tidy cppcoreguidelines-init-variables and hicpp-member-init after merge with master
New code from master introduced uninitialized variables and struct
members that trigger the newly enabled clang-tidy checks. Fix all 368
errors by adding default initializers (`{}`, `= 0`, `= nullptr`) to
local variables and struct/class member declarations.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100399&sha=78a76ff56fc5747009e8c34795b8a3cb2432eeae&name_0=PR

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-24 11:25:35 +00:00
Alexey MilovidovandGitHub 85164c93d4 Revert "Revert "Improve help output for ClickHouse applications"" 2026-02-27 00:49:00 +01:00
Alexey MilovidovandGitHub e8654c51eb Revert "Improve help output for ClickHouse applications" 2026-02-26 07:51:17 +01:00
Alexey MilovidovandClaude Opus 4.6 f31adb4a49 Fix CI failures: wrap long help text lines and fix git-import --help abort
- Wrap long lines in `getHelpHeader` and `getHelpFooter` for `clickhouse client`
  and `clickhouse local` to keep lines within reasonable width,
  fixing the 00910_client_window_size_detection test
- Use `createOptionsDescription` instead of raw `po::options_description` constructor
  in `git-import` and `static-files-disk-uploader` to handle zero terminal width
  properly, fixing the `git-import --help` abort in debug builds
  (03823_clickhouse_help_return_codes test)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-05 22:21:04 +01:00
Alexey MilovidovandClaude Opus 4.5 62ccfbd3aa Improve help output for ClickHouse applications
This commit improves the help output for all ClickHouse applications:

- Add `clickhouse help` command that lists all available subcommands
- Return exit code 0 for all help messages (previously some returned 1)
- Output help messages to stdout instead of stderr
- Use "clickhouse <cmd>" format instead of argv[0] in help messages
- Add dynamic `app_name` detection for `clickhouse client` and `clickhouse local`
  to show correct invocation name based on how the binary was called
- Add `--no-sudo` option for `clickhouse start` and `clickhouse restart`
  for environments without sudo (e.g., Docker containers)
- Add detailed help headers and footers for client and local with usage examples

Closes #58244

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-05 07:12:44 +01:00
Antonio Andelic 1b27ae2c7b Merge branch 'master' into wide-integer-explicit-cast 2026-01-07 16:32:44 +01:00
Antonio Andelic 340be5a496 Enable implicit-int-conversion check 2026-01-07 16:30:57 +01:00
Alexey Milovidov a356f674c8 Fix git-import on large or invalid commits 2025-12-30 06:21:55 +01:00
Konstantin Bogdanov 48d2f3b145 Fix readability-container-contains 2025-11-04 23:40:04 +01:00
Robert SchulzeandGitHub 2f2fa8cb2e Revert "Update links to clickhouse-presentations (after naming schema changes)" 2025-01-05 13:25:43 +01:00
Robert Schulze b401b47f24 Update links to clickhouse-presentations (after naming schema changes) 2025-01-04 21:01:21 +00:00
Robert Schulze 7d6fbe5a57 Some clang-tidy fixes 2024-12-11 16:12:16 +00:00
Raúl Marín 730caf1f9e Missing include 2024-12-03 12:05:15 +01:00
Konstantin Bogdanov b2c81981fb Use clang-19 2024-11-20 23:08:47 +01:00
Sema Checherinda f1ab911910 cancel or finalize write buffer 2024-11-11 11:37:12 +01:00
Robert Schulze 2909e6451b Move StringUtils.h/cpp back to Common/ 2024-05-19 09:39:36 +00:00
Alexey Milovidov 95f12ef274 Useless changes 2024-05-09 01:08:33 +02:00
Azat Khuzhin 7fb31fe160 Remove ability to disable generic clickhouse components
Components like client/server/... are very generic, and there is no
point in disabling them, since it does not reduce amount of compiled
code a lot anyway (just a few modules for entrypoints, everything else
is already included in the clickhouse binary), and eventually they are
just symlinks to the clickhouse binary.

But there are few, that requires extra libraries, like ODBC bridge or
keeper components (and there is also standalone keeper binary compiled
with musl), those had been kept.

Also add some descriptions for some utils and change exit code to 0 for
--help.

Signed-off-by: Azat Khuzhin <[email protected]>
2024-02-12 11:10:00 +01:00
Robert Schulze 8e804487f3 Some fixups 2024-01-07 22:28:08 +00:00
Robert Schulze 7b378dbad3 Remove broken lockless variant of re2 2023-09-14 16:40:42 +00:00
Alexey MilovidovandGitHub 98ae9be734 Revert "Added tests for ClickHouse apps help and fixed help issues" 2023-04-21 01:54:34 +03:00
Yatsishin Ilya 206781cc4e Fix abort on small terminal window 2023-04-14 08:26:58 +00:00
Yatsishin Ilya 98edb9f06b Update help for clickhouse tools and add test 2023-01-31 12:19:37 +00:00
Alexander TokmakovandGitHub 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
Alexey Milovidov e4a6f2a8e1 Fix the indent field in the git-import tool 2022-11-12 18:54:48 +01:00
Antonio Andelic e64436fef3 Fix typos with new codespell 2022-09-02 08:54:48 +00:00
Robert Schulze 118e94523c Activate clang-tidy warning "readability-container-contains"
This check suggests replacing <Container>.count() by
<Container>.contains() which is more speaking and in case of
multimaps/multisets also faster.
2022-04-18 23:53:11 +02:00
zhanghuajie 9947008d31 fix crash when you use clickhouse-git-import with invalid parameter
for example:
clickhouse-git-import -xxx
2022-04-14 23:16:02 +08:00
Alexey Milovidov fe6b7c77c7 Rename "common" to "base" 2021-10-02 10:13:14 +03:00
Alexey Milovidov 8f01af62d9 Merge branch 'master' into normalize-bigint 2021-04-25 06:57:44 +03:00
Alexey Milovidov 671395e8c8 Most likely improve performance 2021-03-15 22:23:27 +03:00
Alexey Milovidov 093108bf81 Normalize BigInt implementation 2021-01-27 03:54:57 +03:00
Alexey Milovidov ecc270605d Fix error (CC @akuzm) 2020-12-19 01:07:52 +03:00
Alexey Milovidov 7d1c0f5b28 Fixed bug in git-import tool 2020-11-13 04:36:34 +03:00
Alexey Milovidov f6e9a9bdfb Merge branch 'git-to-clickhouse' of github.com:yandex/ClickHouse into git-to-clickhouse 2020-09-12 03:56:13 +03:00
Alexey Milovidov e12ae99bf7 Added review suggestion 2020-09-12 03:55:54 +03:00
alexey-milovidovandGitHub 3942cc615f Update git-import.cpp 2020-09-07 10:09:42 +03:00
Alexey Milovidov ee54971c3d Fix build 2020-09-07 07:11:03 +03:00
Alexey Milovidov d18e7adbc0 Add git-import as a tool 2020-09-07 06:22:47 +03:00