Skip to content

Commit

Permalink
Backport #61530 to 24.2: Fix client -s argument
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-clickhouse committed Mar 21, 2024
1 parent 0048e80 commit 7f869c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion programs/client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ void Client::addOptions(OptionsDescription & options_description)
("config,c", po::value<std::string>(), "config-file path (another shorthand)")
("connection", po::value<std::string>(), "connection to use (from the client config), by default connection name is hostname")
("secure,s", "Use TLS connection")
("no-secure,s", "Don't use TLS connection")
("no-secure", "Don't use TLS connection")
("user,u", po::value<std::string>()->default_value("default"), "user")
("password", po::value<std::string>(), "password")
("ask-password", "ask-password")
Expand Down
2 changes: 2 additions & 0 deletions tests/queries/0_stateless/00505_secure.reference
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0
1
2
3
4
Expand Down
6 changes: 6 additions & 0 deletions tests/queries/0_stateless/00505_secure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh

$CLICKHOUSE_CLIENT --no-secure -q "SELECT 0;"

# Use $CLICKHOUSE_CLIENT_SECURE, but replace `--secure` by `-s` to test it
CLICKHOUSE_CLIENT_S=${CLICKHOUSE_CLIENT_SECURE/ --secure / -s }
$CLICKHOUSE_CLIENT_S -q "SELECT 1;"

$CLICKHOUSE_CLIENT_SECURE -q "SELECT 2;"

#disable test
Expand Down

0 comments on commit 7f869c2

Please sign in to comment.