Skip to content

Commit caa3b07

Browse files
Merge pull request ClickHouse#80293 from ClickHouse/clickhouse-local-extra-options
Allow extra options in `clickhouse-local` without the equality sign
2 parents ce890ea + cc7659f commit caa3b07

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/Client/ClientBaseOptimizedParts.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ void ClientApplicationBase::parseAndCheckOptions(OptionsDescription & options_de
102102
/// Check positional options.
103103
for (const auto & op : parsed.options)
104104
{
105+
/// Skip all options after empty `--`. These are processed separately into the Application configuration.
106+
if (op.string_key.empty() && op.original_tokens[0].starts_with("--"))
107+
break;
108+
105109
if (!op.unregistered && op.string_key.empty() && !op.original_tokens[0].starts_with("--")
106110
&& !op.original_tokens[0].empty() && !op.value.empty())
107111
{
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
666
2+
666
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
# shellcheck source=../shell_config.sh
5+
. "$CURDIR"/../shell_config.sh
6+
7+
${CLICKHOUSE_LOCAL} --query "SELECT getServerSetting('max_connections')" -- --max_connections=666
8+
${CLICKHOUSE_LOCAL} --query "SELECT getServerSetting('max_connections')" -- --max_connections 666

0 commit comments

Comments
 (0)