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]>
shell-like completion support in clickhouse keeper-client (handle
completions of arguments in quotes, i.e. 'foo ba', handle escaped
arguments, i.e. foo\ ba, make ls print quoted nodes, if they have
whitespaces)
Also remove on_complete_modify_callback hack, replace it with pure
getCompletions implementation
Co-Authored-By: Claude <[email protected]>
Add support of `password` and `identity` fields to keeper-client config.
More over, those parameters could be passed via CLICKHOUSE_KEEPER_PASSWORD
and CLICKHOUSE_KEEPER_IDENTITY environment variables. The priority is
the following: CMD PARAMS > ENVIRONMENT VARIABLES > CONFIG FILE.
Fix command name completion which was broken because appending a closing
quote before tokenizing caused the tokenizer to misinterpret command
prefixes (e.g. 'ls') as path arguments. Split into two-phase approach:
probe the original prefix to decide command vs path, then append quote
only for path parsing.
Fix double closing quote when TAB is pressed with cursor before an
existing closing quote — strip the old quote so completion re-adds it
with the correct suffix (closing quote for leaves, / for directories).
Remove duplicate methods (askConfirmation, getAbsolutePath, loadCommands)
now provided by KeeperClientBase.
Add PTY-based autocomplete test covering command completion, path
completion, directory trailing slash, leaf closing quote, and drill-down.
Assisted-by: Claude Opus 4.6 via GitHub Copilot
The `execute_query` method in the Python test helper uses `epoll` to
read from both stdout and stderr of the keeper-client process. When
a command fails, the keeper-client writes the error to stderr and then
the separator to stdout. However, when both events arrive simultaneously
in `epoll.poll()`, the loop could process stdout first, find the
separator, and return successfully without ever reading the pending
stderr error data - causing the exception to be silently swallowed.
Fix both sides:
- C++ (`KeeperClient.cpp`): flush stderr before writing the stdout
separator, ensuring error data is in the pipe buffer first.
- Python (`keeper_utils.py`): process stderr events before stdout
events in the poll loop, so errors are always collected before
checking the separator.
Also fix test cleanup: add `try/finally` with `drop_node_if_exists`
to `test_rm_with_version` and `test_rm_without_version`, and give
`test_rm_without_version` its own unique node path instead of
reusing `/test_rm_with_version_node`.
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97554&sha=3f86a6142c6920239c1b3adedfe82ccb5fcd6515&name_0=PR&name_1=Integration%20tests%20%28amd_binary%2C%204%2F5%29
Co-Authored-By: Claude Opus 4.6 <[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]>