mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Allow run query with remote() in clickhouse-local; Aloow redefine config from command line for clickhouse-local
This commit is contained in:
parent
f9cab91447
commit
7e7b5b3810
@ -34,6 +34,7 @@
|
||||
#include <Dictionaries/registerDictionaries.h>
|
||||
#include <boost/program_options/options_description.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <common/argsToConfig.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -497,6 +498,11 @@ void LocalServer::init(int argc, char ** argv)
|
||||
config().setString("logger.level", options["logger.level"].as<std::string>());
|
||||
if (options.count("ignore-error"))
|
||||
config().setBool("ignore-error", true);
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
for (int arg_num = 1; arg_num < argc; ++arg_num)
|
||||
arguments.emplace_back(argv[arg_num]);
|
||||
argsToConfig(arguments, config(), 100);
|
||||
}
|
||||
|
||||
void LocalServer::applyCmdOptions()
|
||||
|
@ -1524,7 +1524,7 @@ UInt16 Context::getTCPPort() const
|
||||
auto lock = getLock();
|
||||
|
||||
auto & config = getConfigRef();
|
||||
return config.getInt("tcp_port");
|
||||
return config.getInt("tcp_port", DBMS_DEFAULT_PORT);
|
||||
}
|
||||
|
||||
std::optional<UInt16> Context::getTCPPortSecure() const
|
||||
|
@ -9,3 +9,5 @@
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
|
@ -24,3 +24,6 @@ $CLICKHOUSE_CLIENT -q "SELECT * FROM remote('${CLICKHOUSE_HOST}:${CLICKHOUSE_POR
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote(test_shard_localhost, system, one);"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM remote(test_shard_localhost, system, one, 'default', '');"
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM cluster('test_shard_localhost', system, one);"
|
||||
|
||||
$CLICKHOUSE_LOCAL --query "SELECT count() FROM remote('127.0.0.1', system.one)"
|
||||
$CLICKHOUSE_LOCAL --query "SELECT count() FROM remote('127.0.0.1', system.one)" -- --tcp_port=59000
|
||||
|
Loading…
Reference in New Issue
Block a user