ISSUES-2629 clickhouse-client: fix reading user from config

This commit is contained in:
Vladimir Kozbin 2018-08-21 17:04:27 +07:00
parent 2aa7eb463a
commit cdb7116f37

View File

@ -1685,7 +1685,7 @@ public:
config().setInt("port", options["port"].as<int>()); config().setInt("port", options["port"].as<int>());
if (options.count("secure")) if (options.count("secure"))
config().setBool("secure", true); config().setBool("secure", true);
if (options.count("user")) if (options.count("user") && !options["user"].defaulted())
config().setString("user", options["user"].as<std::string>()); config().setString("user", options["user"].as<std::string>());
if (options.count("password")) if (options.count("password"))
config().setString("password", options["password"].as<std::string>()); config().setString("password", options["password"].as<std::string>());