Address review feedback on PR #99972: rename the previously added
`-m`, `--multiquery` flag to `--queries-format` with two possible
values:
- `tsv` (default) - one tab-escaped query per line (existing behavior)
- `script` - parse stdin as a script of queries separated by `;`
The new name better reflects that `clickhouse-benchmark` already
supports multiple queries by default, and only the input *format*
changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
PR #79465 changed `--reconnect` from a boolean flag to an integer option
of type `value<size_t>()->default_value(0)` to support `--reconnect=N`
(reconnect every N queries) without losing the previous boolean
semantics. However the bare `--reconnect` form (no value) regressed:
boost::program_options requires a value for `value<T>()` options unless
an `implicit_value` is also specified, so the old `--reconnect` syntax
now fails with:
Bad arguments: the required argument for option '--reconnect' is missing
Restore the previous behaviour by adding `->implicit_value(1)` to the
option definition. The full set of forms now works:
--reconnect reconnect every query (same as --reconnect=1)
--reconnect=0 never reconnect (same as omitting the flag)
--reconnect=N reconnect every N queries
(no --reconnect) never reconnect
Add a stateless regression test
`04244_benchmark_reconnect_flag_101748.sh` that asserts all three
spellings parse successfully.
Closes#101748
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]>
Extract `ErrnoException` into `Common/ErrnoException.h` to reduce the
include footprint of `Exception.h`. This removes `<base/errnoToString.h>`
and `<cerrno>` from `Exception.h`, which is included by ~95% of all
translation units.
All files referencing `ErrnoException` now include the new header
directly. Files that used `errnoToString` without `ErrnoException`
got an explicit `<base/errnoToString.h>` include.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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]>
Support --connection in clickhouse-benchmarks. It is the same as
supported by clickhouse-client, you can specify predefined connections
in client config.xml/config.yaml under connections_credentials path, to
avoid explicitly specifying user/password via command line arguments.